1. alter database open resetlogs;
    2. recover database using backup controfile;
    3. alter database open resetlogs。
    4. alter system set “_allow_resetlogs_corruption”=true scope=spfile;
    5. startup force mount;
    6. alter database open resetlogs;

    1.模拟文件丢失

    1. rm -rf redo0*

    2.关闭数据库进行恢复

    1. SQL> shutdown immediate;
    2. Database closed.
    3. Database dismounted.
    4. ORACLE instance shut down.

    3.启动mount

    1. SQL> startup mount;
    2. ORACLE instance started.
    3. Total System Global Area 838857584 bytes
    4. Fixed Size 8901488 bytes
    5. Variable Size 700448768 bytes
    6. Database Buffers 121634816 bytes
    7. Redo Buffers 7872512 bytes
    8. Database mounted.

    4.尝试能否打开数据库

    1. SQL> alter database open resetlogs;
    2. alter database open resetlogs
    3. *
    4. ERROR at line 1:
    5. ORA-01139: RESETLOGS option only valid after an incomplete database recovery

    5.添加隐藏参数

    1. SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
    2. System altered.

    6.尝试使用控制文件恢复

    1. SQL> recover database using backup controlfile;
    2. ORA-00279: change 5453650 generated at 09/02/2019 21:34:57 needed for thread 1
    3. ORA-00289: suggestion :
    4. /opt/oracle/fast_recovery_area/ORCLCDB/archivelog/2019_09_02/o1_mf_1_114_%u_.arc
    5. ORA-00280: change 5453650 for thread 1 is in sequence #114
    6. Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    7. ORA-00308: cannot open archived log
    8. '/opt/oracle/fast_recovery_area/ORCLCDB/archivelog/2019_09_02/o1_mf_1_114_%u_.ar
    9. c'
    10. ORA-27037: unable to obtain file status
    11. Linux-x86_64 Error: 2: No such file or directory
    12. Additional information: 7

    7.一致性关闭,先启动mount,在使用resetlogs启动数据库。

    1. SQL> shutdown immediate;
    2. ORA-01109: database not open
    3. Database dismounted.
    4. ORACLE instance shut down.
    5. SQL> alter database open resetlogs;
    6. alter database open resetlogs
    7. *
    8. ERROR at line 1:
    9. ORA-01034: ORACLE not available
    10. Process ID: 0
    11. Session ID: 0 Serial number: 0
    12. SQL> startup mount;
    13. ORACLE instance started.
    14. Total System Global Area 838857584 bytes
    15. Fixed Size 8901488 bytes
    16. Variable Size 700448768 bytes
    17. Database Buffers 121634816 bytes
    18. Redo Buffers 7872512 bytes
    19. Database mounted.
    20. SQL> alter database open resetlogs;
    21. Database altered.

    8.取消隐藏参数,一致性关闭数据库,重新open打开。

    1. SQL> alter system set "_allow_resetlogs_corruption"=false scope=spfile;
    2. System altered.
    3. SQL> shutdown immediate;
    4. Database closed.
    5. Database dismounted.
    6. ORACLE instance shut down.
    7. SQL> startup
    8. ORACLE instance started.
    9. Total System Global Area 838857584 bytes
    10. Fixed Size 8901488 bytes
    11. Variable Size 700448768 bytes
    12. Database Buffers 121634816 bytes
    13. Redo Buffers 7872512 bytes
    14. Database mounted.
    15. Database opened.
    16. SQL>