- alter database open resetlogs;
- recover database using backup controfile;
- alter database open resetlogs。
- alter system set “_allow_resetlogs_corruption”=true scope=spfile;
- startup force mount;
- alter database open resetlogs;
1.模拟文件丢失
rm -rf redo0*
2.关闭数据库进行恢复
SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.
3.启动mount
SQL> startup mount;ORACLE instance started.Total System Global Area 838857584 bytesFixed Size 8901488 bytesVariable Size 700448768 bytesDatabase Buffers 121634816 bytesRedo Buffers 7872512 bytesDatabase mounted.
4.尝试能否打开数据库
SQL> alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-01139: RESETLOGS option only valid after an incomplete database recovery
5.添加隐藏参数
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;System altered.
6.尝试使用控制文件恢复
SQL> recover database using backup controlfile;ORA-00279: change 5453650 generated at 09/02/2019 21:34:57 needed for thread 1ORA-00289: suggestion :/opt/oracle/fast_recovery_area/ORCLCDB/archivelog/2019_09_02/o1_mf_1_114_%u_.arcORA-00280: change 5453650 for thread 1 is in sequence #114Specify log: {<RET>=suggested | filename | AUTO | CANCEL}ORA-00308: cannot open archived log'/opt/oracle/fast_recovery_area/ORCLCDB/archivelog/2019_09_02/o1_mf_1_114_%u_.arc'ORA-27037: unable to obtain file statusLinux-x86_64 Error: 2: No such file or directoryAdditional information: 7
7.一致性关闭,先启动mount,在使用resetlogs启动数据库。
SQL> shutdown immediate;ORA-01109: database not openDatabase dismounted.ORACLE instance shut down.SQL> alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-01034: ORACLE not availableProcess ID: 0Session ID: 0 Serial number: 0SQL> startup mount;ORACLE instance started.Total System Global Area 838857584 bytesFixed Size 8901488 bytesVariable Size 700448768 bytesDatabase Buffers 121634816 bytesRedo Buffers 7872512 bytesDatabase mounted.SQL> alter database open resetlogs;Database altered.
8.取消隐藏参数,一致性关闭数据库,重新open打开。
SQL> alter system set "_allow_resetlogs_corruption"=false scope=spfile;System altered.SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 838857584 bytesFixed Size 8901488 bytesVariable Size 700448768 bytesDatabase Buffers 121634816 bytesRedo Buffers 7872512 bytesDatabase mounted.Database opened.SQL>
