- 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 bytes
Fixed Size 8901488 bytes
Variable Size 700448768 bytes
Database Buffers 121634816 bytes
Redo Buffers 7872512 bytes
Database 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 1
ORA-00289: suggestion :
/opt/oracle/fast_recovery_area/ORCLCDB/archivelog/2019_09_02/o1_mf_1_114_%u_.arc
ORA-00280: change 5453650 for thread 1 is in sequence #114
Specify 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_.ar
c'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
7.一致性关闭,先启动mount,在使用resetlogs启动数据库。
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
SQL> startup mount;
ORACLE instance started.
Total System Global Area 838857584 bytes
Fixed Size 8901488 bytes
Variable Size 700448768 bytes
Database Buffers 121634816 bytes
Redo Buffers 7872512 bytes
Database 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> startup
ORACLE instance started.
Total System Global Area 838857584 bytes
Fixed Size 8901488 bytes
Variable Size 700448768 bytes
Database Buffers 121634816 bytes
Redo Buffers 7872512 bytes
Database mounted.
Database opened.
SQL>