月度归档:2015年07月

手工添加备库文件

早上在Oracle11.2.0.4,Dataguard环境下,主库增加一个数据文件,导致备库无法日志无法应用,检查发现备库初始化参数STANDBY_FILE_MANAGEMENT为MANUL,

告警日志信息如下:

Archived Log entry 1283 added for thread 1 sequence 2182 ID 0x540eaffc dest 1:
Thu Jul 16 09:24:14 2015
Media Recovery Log /oracle/u01/oracle/db1124/oradata/orcl/arch/1_2182_875790564.dbf
File #17 added to control file as ‘UNNAMED00017′ because
the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
The file should be manually created to continue.

解决办法:

1,查看文件号

select * from v$datafile;

2,创建文件

alter database create datafile 18 as ‘/oracle/u01/oracle/db1124/oradata/orcl/NTSMS06.DBF’

3,开启日志应用

Alter database recover managed standby database disconnect from session

如果standby_file_management参数为auto,主库添加数据文件,且转化路径没有在初始化参数中配置,则可以采用以下步骤解决:

1, 先将初始话参数standby_file_management 改为manual
SQL> alter system set standby_file_management=manual;
2, SQL> alter database create datafile 18 as ‘/oracle/u01/oracle/db1124/oradata/orcl/NTSMS06.DBF’
3,– SQL>Recover standby database
4, SQL>Alter database recover managed standby database disconnect from session
5, SQL> alter system set standby_file_management=auto;

maven 增加oracle驱动

D:\db\oracle\product\11.2.0\dbhome_1\jdbc\lib>mvn install:install-file -DgroupId
=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.1.0 -Dpackaging=jar -Dfile=ojdb
c6.jar
[INFO] Scanning for projects…
[INFO]
[INFO] ————————————————————————
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ————————————————————————
[INFO]
[INFO] — maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom

[INFO] Installing D:\db\oracle\product\11.2.0\dbhome_1\jdbc\lib\ojdbc6.jar to D:
\java\mvn_repository\com\oracle\ojdbc6\11.2.0.1.0\ojdbc6-11.2.0.1.0.jar
[INFO] Installing C:\Users\zhong\AppData\Local\Temp\mvninstall514906640323213049
9.pom to D:\java\mvn_repository\com\oracle\ojdbc6\11.2.0.1.0\ojdbc6-11.2.0.1.0.p
om
[INFO] ————————————————————————
[INFO] BUILD SUCCESS
[INFO] ————————————————————————
[INFO] Total time: 1.385 s
[INFO] Finished at: 2015-07-11T16:28:23+08:00
[INFO] Final Memory: 7M/244M
[INFO] ————————————————————————

在pom文件中增加

<dependency>

<groupId>com.oracle</groupId>

<artifactId>ojdbc6</artifactId>

<version>11.2.0.1.0</version>

</dependency>