进行恢复
该参数默认值为FALSE,为TRUE说明,在破坏唯一性的情况下强制重置日志,打开数据库。在打开的过程中,Oracle会跳过一致性检查,使数据库处于不一致的状态下打开。
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
System altered.
修改后,重启数据库。
SQL> shutdown immeditae
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 146472960 bytes
Fixed Size 1298472 bytes
Variable Size 92278744 bytes
Database Buffers 50331648 bytes
Redo Buffers 2564096 bytes
Database mounted.
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 3046568 generated at 09/26/2010 00:59:56 needed for thread 1
ORA-00289: suggestion :
/u01/flash_recovery_area/ORCL/archivelog/2010_09_26/o1_mf_1_2_%u_.arc
ORA-00280: change 3046568 for thread 1 is in sequence #2
Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/oradata/orcl/system01.dbf'
ORA-01112: media recovery not started
如果这里出现错误,跳过即可
SQL> alter database open resetlogs;
Database altered.
检查发现,日志文件已恢复。
SQL> !ls -l /u01/oradata1
total 102528
-rw-r----- 1 oracle oinstall 52429312 Sep 26 03:49 redo010.log
-rw-r----- 1 oracle oinstall 52429312 Sep 26 03:54 redo02.log
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 146472960 bytes
Fixed Size 1298472 bytes
Variable Size 92278744 bytes
Database Buffers 50331648 bytes
Redo Buffers 2564096 bytes
Database mounted.
Database opened.
数据库被打开后,马上执行全备,shutdown数据库,修改_all_resetlogs_corrupt参数为FALSE