_allow_resetlogs_corruption open the database

 

I lost in the analog archive log, when not fully recovered, unable to open the data, and finally be opened using _allow_resetlogs_corruption

 

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01152: file 9 was not restored from a sufficiently old backup
ORA-01110: data file 9:
'/u01/app/oracle/oradata/ora12c/ora12cpdb1/system01.dbf'


SQL>

SQL> startup force;
ORACLE instance started.

Total System Global Area  771751936 bytes
Fixed Size                  8797536 bytes
Variable Size             566231712 bytes
Database Buffers          192937984 bytes
Redo Buffers                3784704 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

备份spfile
SQL> create pfile='/home/oracle/pfile.txt' from spfile;

File created.

开启_allow_resetlogs_corruption
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;

 

尝试恢复
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 2184138 generated at 12/11/2019 01:29:23 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/archive_log/1_41_1026270447.dbf
ORA-00280: change 2184138 for thread 1 is in sequence #41


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
'/u01/app/oracle/archive_log/1_41_1026270447.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7


ORA-00308: cannot open archived log
'/u01/app/oracle/archive_log/1_41_1026270447.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7


ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 9 was not restored from a sufficiently old backup
ORA-01110: data file 9:
'/u01/app/oracle/oradata/ora12c/ora12cpdb1/system01.dbf'

重启动
SQL>  startup force;
ORACLE instance started.

Total System Global Area  771751936 bytes
Fixed Size                  8797536 bytes
Variable Size             566231712 bytes
Database Buffers          192937984 bytes
Redo Buffers                3784704 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.

关闭_allow_resetlogs_corruption
SQL> alter system set "_allow_resetlogs_corruption"=false scope=spfile;

System altered.

打开数据库
SQL> startup force;
ORACLE instance started.

Total System Global Area  771751936 bytes
Fixed Size                  8797536 bytes
Variable Size             566231712 bytes
Database Buffers          192937984 bytes
Redo Buffers                3784704 bytes
Database mounted.
Database opened.
SQL>

Guess you like

Origin www.cnblogs.com/hxlasky/p/12022989.html