SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 413372416 bytes
Fixed Size 2228904 bytes
Variable Size 360713560 bytes
Database Buffers 46137344 bytes
Redo Buffers 4292608 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open noresetlogs;
alter database open noresetlogs
*
ERROR at line 1:
ORA-01588: must use RESETLOGS option for database open
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: ‘/data/oracle/oradata/orcl/system01.dbf’
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 413372416 bytes
Fixed Size 2228904 bytes
Variable Size 360713560 bytes
Database Buffers 46137344 bytes
Redo Buffers 4292608 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: ‘/data/oracle/oradata/orcl/system01.dbf’
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 16139738 generated at 11/07/2018 23:31:11 needed for thread 1
ORA-00289: suggestion :
/data/oracle/fast_recovery_area/ORCL/archivelog/2018_12_22/o1_mf_1_758_%u_.arc
ORA-00280: change 16139738 for thread 1 is in sequence #758
Specify log: {=suggested | filename | AUTO | CANCEL}
AUTO
ORA-00308: cannot open archived log
'/data/oracle/fast_recovery_area/ORCL/archivelog/2018_12_22/o1_mf_1_758_%u_.arc'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
ORA-00308: cannot open archived log
'/data/oracle/fast_recovery_area/ORCL/archivelog/2018_12_22/o1_mf_1_758_%u_.arc'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
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: '/data/oracle/oradata/orcl/system01.dbf'
根据上面提示的内容,注意到 ‘change 16139738’ 和 ‘sequence #758’
查出redo logs ,注意要用sys:
SQL> conn sys/oracle as sysdba
Connected.
SQL> select v1.group#, member, sequence#, first_change# from v l o g v 1 , v log v1, v logv1,vlogfile v2 where v1.group# = v2.group#;
GROUP#
SEQUENCE# FIRST_CHANGE#
1
/data/oracle/oradata/orcl/redo01.log
757 16134156
3
/data/oracle/oradata/orcl/redo03.log
756 16068171
GROUP#
SEQUENCE# FIRST_CHANGE#
2
/data/oracle/oradata/orcl/redo02.log
758 16139738
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 16139738 generated at 11/07/2018 23:31:11 needed for thread 1
ORA-00289: suggestion :
/data/oracle/fast_recovery_area/ORCL/archivelog/2018_12_22/o1_mf_1_758_%u_.arc
ORA-00280: change 16139738 for thread 1 is in sequence #758
Specify log: {=suggested | filename | AUTO | CANCEL}
/data/oracle/oradata/orcl/redo02.log
Log applied.
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.
SQL>