ORA-01113,01110,00322,00312
在測試環境中(非歸檔模式),將所有資料檔案移動另一個資料夾下,然後關閉資料庫,再將所有資料檔案移回來,啟動資料庫:
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_369.trc:
ORA-01113: file 1 needs media recoveryORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
ORA-1113 signalled during: ALTER DATABASE OPEN...
Mon Aug 10 19:40:12 2015
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_m000_371.trc:
ORA-00322: log 1 of thread 1 is not current copy
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log'
Checker run found 7 new persistent data failures
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 271400960 bytes
Fixed Size 2252424 bytes
Variable Size 184549752 bytes
Database Buffers 79691776 bytes
Redo Buffers 4907008 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
SQL> recover
;
ORA-00283: recovery session canceled due to errors
ORA-00322: log 1 of thread 1 is not current copy
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log'
SQL> SP2-0223: No lines in SQL buffer.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 172 52428800 512 1 NO
CURRENT 4391058 10-AUG-15 2.8147E+14
3 1 171 52428800 512 1 NO
INACTIVE 4390931 10-AUG-15 4391058 10-AUG-15
2 1 170 52428800 512 1 NO
INACTIVE 4390869 10-AUG-15 4390931 10-AUG-15
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 271400960 bytes
Fixed Size 2252424 bytes
Variable Size 184549752 bytes
Database Buffers 79691776 bytes
Redo Buffers 4907008 bytes
Database mounted.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 172 52428800 512 1 NO
CURRENT 4391058 10-AUG-15 2.8147E+14
3 1 171 52428800 512 1 NO
INACTIVE 4390931 10-AUG-15 4391058 10-AUG-15
2 1 170 52428800 512 1 NO
INACTIVE 4390869 10-AUG-15 4390931 10-AUG-15
SQL> alter database clear logfile '/u01/app/oracle/oradata/orcl/redo01.log';
Database altered.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 0 52428800 512 1 NO
UNUSED 4391058 10-AUG-15 4391059 10-AUG-15
3 1 171 52428800 512 1 NO
INACTIVE 4390931 10-AUG-15 4391058 10-AUG-15
2 1 173 52428800 512 1 NO
CURRENT 4391059 10-AUG-15 2.8147E+14
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
SQL> recover;
Media recovery complete.
SQL> alter database open;
Database altered.
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC
---------- ---------- ---------- ---------- ---------- ---------- ---
STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------------- ------------- ------------ ------------ ------------
1 1 0 52428800 512 1 NO
UNUSED 4391058 10-AUG-15 4391059 10-AUG-15
2 1 173 52428800 512 1 NO
CURRENT 4391059 10-AUG-15 2.8147E+14
3 1 171 52428800 512 1 NO
INACTIVE 4390931 10-AUG-15 4391058 10-AUG-15
SQL>