本文共 5837 字,大约阅读时间需要 19 分钟。
一套10.2.0.5的physical standby,主库挂载了一系列的sas磁盘,新增的磁盘路径在备库上不存在,因此需要设置备库参数db_file_name_convert,但是敲入命令出错,原本的'/storage/disk00','/data/oracle/oradata/test'敲成了'/storage/disk0*','/data/oracle/oradata/test'在主库新增表空间的时候备库出现错误,备库alertlog如下
WARNING: File being created with same name as in PrimaryExisting file may be overwrittenErrors in file /data/oracle/diag/rdbms/test/trace/test_pr00_6397.trc:ORA-01119: error in creating database file '/storage/disk00/JUSTIN_01.dbf'ORA-27054: NFS file system where the file is created or resides is not mounted with correct optionsLinux-x86_64 Error: 13: Permission deniedFile #166 added to control file as 'UNNAMED00166'.Originally created as:'/storage/disk00/JUSTIN_01.dbf'Recovery was unable to create the file as:'/storage/disk00/JUSTIN_01.dbf'MRP0: Background Media Recovery terminated with error 1274Errors in file /data/oracle/diag/rdbms/test/trace/test_pr00_6397.trc:ORA-01274: cannot add datafile '/storage/disk00/JUSTIN_01.dbf' - file could not be createdManaged Standby Recovery not using Real Time ApplyRecovery interrupted!Recovered data files to a consistent state at change 23332162008Tue Oct 11 14:44:44 2011MRP0: Background Media Recovery process shutdown (test)
由于备库不存在/storage/disk00,无法创建datafile导致recovery被中止此时尝试启动备库的recovery进程,观察alertlog可以看到,recovery的slave进程由于ora-1111错误而退出Tue Oct 11 14:46:43 2011ALTER DATABASE RECOVER managed standby database using current logfile disconnect from session Attempt to start background Managed Standby Recovery process (test)Tue Oct 11 14:46:43 2011MRP0 started with pid=26, OS id=6441 MRP0: Background Managed Standby Recovery process started (test) started logmerger processTue Oct 11 14:46:48 2011Managed Standby Recovery starting Real Time ApplyTue Oct 11 14:46:48 2011Errors in file /data/oracle/diag/rdbms/test/trace/test_dbw0_6353.trc:ORA-01186: file 166 failed verification testsORA-01157: cannot identify/lock data file 166 - see DBWR trace fileORA-01111: name for data file 166 is unknown - rename to correct fileORA-01110: data file 166: '/data/oracle/product/11.2.0/db1/dbs/UNNAMED00166'File 166 not verified due to error ORA-01157MRP0: Background Media Recovery terminated with error 1111Errors in file /data/oracle/diag/rdbms/test/trace/test_pr00_6475.trc:ORA-01111: name for data file 166 is unknown - rename to correct fileORA-01110: data file 166: '/data/oracle/product/11.2.0/db1/dbs/UNNAMED00166'ORA-01157: cannot identify/lock data file 166 - see DBWR trace fileORA-01111: name for data file 166 is unknown - rename to correct fileORA-01110: data file 166: '/data/oracle/product/11.2.0/db1/dbs/UNNAMED00166'Managed Standby Recovery not using Real Time ApplySlave exiting with ORA-1111 exceptionErrors in file /data/oracle/diag/rdbms/test/trace/test_pr00_6475.trc:ORA-01111: name for data file 166 is unknown - rename to correct fileORA-01110: data file 166: '/data/oracle/product/11.2.0/db1/dbs/UNNAMED00166'ORA-01157: cannot identify/lock data file 166 - see DBWR trace fileORA-01111: name for data file 166 is unknown - rename to correct fileORA-01110: data file 166: '/data/oracle/product/11.2.0/db1/dbs/UNNAMED00166'Recovery Slave PR00 previously exited with exception 1111MRP0: Background Media Recovery process shutdown (test)Completed: ALTER DATABASE RECOVER managed standby database using current logfile disconnect from session Tue Oct 11 14:47:06 2011Archived Log entry 4801 added for thread 1 sequence 10651 ID 0xe339e88c dest 1:Tue Oct 11 14:47:06 2011RFS[1]: Selected log 6 for thread 1 sequence 10652 dbid -482780276 branch 754336076Tue Oct 11 14:47:25 2011Archived Log entry 4802 added for thread 1 sequence 10652 ID 0xe339e88c dest 1:Tue Oct 11 14:47:25 2011RFS[1]: Selected log 6 for thread 1 sequence 10653 dbid -482780276 branch 754336076
此时备库已经无法正常恢复了,也无法openSQL> alter database open;alter database open*ERROR at line 1:ORA-10458: standby database requires recoveryORA-01157: cannot identify/lock data file 166 - see DBWR trace fileORA-01111: name for data file 166 is unknown - rename to correct fileORA-01110: data file 166: '/data/oracle/product/11.2.0/db1/dbs/UNNAMED00166'解决办法,修改备库的db_file_name_convert参数使之正确,在主库将新增的tablespace drop,接着在备库执行offline drop SQL> alter database datafile '/data/oracle/product/11.2.0/db1/dbs/UNNAMED00166' 2 offline drop;
Database altered.此时v$datafile中还可以看到该文件记录SQL> select ts#,name from v$datafile;
TS# NAME---------- ---------------------------------------------------------------------------------------------------- 0 /data/oracle/oradata/test/system.dbf 1 /data/oracle/oradata/test/undotbs01.dbf 2 /data/oracle/oradata/test/sysaux.dbf 10 /data/oracle/product/11.2.0/db1/dbs/UNNAMED00166开启备库恢复进程,此时备库恢复正常,通过alertlog可以看出备库的执行步骤由于db_file_name_convert设置正确,先增加datafile,然后再delete并drop tablespaceCompleted: ALTER DATABASE RECOVER managed standby database using current logfile disconnect from session Recovery created file /data/oracle/oradata/test/JUSTIN_01.dbfSuccessfully added datafile 166 to media recoveryDatafile #166: '/data/oracle/oradata/test/JUSTIN_01.dbf'Recovery deleting file #166:'/data/oracle/oradata/test/JUSTIN_01.dbf' from controlfile.Deleted file /data/oracle/oradata/test/JUSTIN_01.dbfRecovery dropped tablespace 'JUSTIN'Media Recovery Log /data/oracle/oradata/test/arch/1_10652_754336076.dbfMedia Recovery Log /data/oracle/oradata/test/arch/1_10653_754336076.dbfMedia Recovery Log /data/oracle/oradata/test/arch/1_10654_754336076.dbfMedia Recovery Waiting for thread 1 sequence 10655 (in transit)Recovery of Online Redo Log: Thread 1 Group 6 Seq 10655 Reading mem 0 Mem# 0: /data/oracle/oradata/test/standbyredo6.logTue Oct 11 14:54:08 2011
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15480802/viewspace-708959/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/15480802/viewspace-708959/