redo log 恢复
-
xychong123
2017-10-15 12:16:28
-
Oracle
-
原创
非归档模式relog日志,在关机模式被删除。
========================
检查日志状态:
select * from v$log;
重建日志文件:
alter database clear logfile group 1;
alter database clear unarchived logfile group 3;
使用recover database until cancel;
recover database until cancel;
alter database open resetlogs;
=============================
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- ------------
1 1 212092 104857600 2 NO CURRENT
1.4167E+13 15-OCT-17
3 1 212091 104857600 2 NO INACTIVE
1.4167E+13 15-OCT-17
2 1 212090 104857600 2 NO INACTIVE
1.4167E+13 15-OCT-17
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------ ---
1 ONLINE +DATA/plrsdb/onlinelog/group_1 NO
.270.724405851----
1 ONLINE +DATA/plrsdb/onlinelog/group_1 YES
.271.724405853 ---------
2 ONLINE +DATA/plrsdb/onlinelog/group_2 NO
.272.724405853
2 ONLINE +DATA/plrsdb/onlinelog/group_2 YES
.273.724405855
3 ONLINE +DATA/plrsdb/onlinelog/group_3 NO
.274.724405855
3 ONLINE +DATA/plrsdb/onlinelog/group_3 YES
.275.724405855
Errors in file /oracle/app/oracle/admin/PLRSDB/bdump/plrsdb_lgwr_15729.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '+DATA/plrsdb/onlinelog/group_1.271.724405853' -------------------------
ORA-17503: ksfdopn:2 Failed to open file +DATA/plrsdb/onlinelog/group_1.271.724405853
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.271.724405853' does not exist
ORA-00312: online log 1 thread 1: '+DATA/plrsdb/onlinelog/group_1.270.724405851'
ORA-17503: ksfdopn:2 Failed to open file +DATA/plrsdb/onlinelog/group_1.270.724405851
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.270.724405851' does not exist----
Sun Oct 15 10:25:38 2017
Errors in file /oracle/app/oracle/admin/PLRSDB/bdump/plrsdb_lgwr_15729.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '+DATA/plrsdb/onlinelog/group_1.271.724405853'
ORA-17503: ksfdopn:2 Failed to open file +DATA/plrsdb/onlinelog/group_1.271.724405853
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.271.724405853' does not exist
ORA-00312: online log 1 thread 1: '+DATA/plrsdb/onlinelog/group_1.270.724405851'
ORA-17503: ksfdopn:2 Failed to open file +DATA/plrsdb/onlinelog/group_1.270.724405851
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.270.724405851' does not exist
=============================
SQL> alter database clear unarchived logfile group 1;
alter database clear unarchived logfile group 1
*
ERROR at line 1:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1:
'+DATA/plrsdb/onlinelog/group_1.271.724405853'
ORA-17503: ksfdopn:2 Failed to open file
+DATA/plrsdb/onlinelog/group_1.271.724405853
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.271.724405853' does not
exist
ORA-00312: online log 1 thread 1:
'+DATA/plrsdb/onlinelog/group_1.270.724405851'
ORA-17503: ksfdopn:2 Failed to open file
+DATA/plrsdb/onlinelog/group_1.270.724405851
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.270.724405851' does not
exist
SQL> /
alter database clear unarchived logfile group 1
*
ERROR at line 1:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1:
'+DATA/plrsdb/onlinelog/group_1.271.724405853'
ORA-17503: ksfdopn:2 Failed to open file
+DATA/plrsdb/onlinelog/group_1.271.724405853
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.271.724405853' does not
exist
ORA-00312: online log 1 thread 1:
'+DATA/plrsdb/onlinelog/group_1.270.724405851'
ORA-17503: ksfdopn:2 Failed to open file
+DATA/plrsdb/onlinelog/group_1.270.724405851
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.270.724405851' does not
exist
SQL> alter database clear logfile group 2;
Database altered.
SQL> c/2/3/
1* alter database clear logfile group 3
SQL> /
Database altered.
Database altered.
SQL> SQL> SQL> SQL>
SQL> list
1* alter database clear logfile group 3
SQL> c/3/1/
1* alter database clear logfile group 1
SQL> /
alter database clear logfile group 1
*
ERROR at line 1:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1:
'+DATA/plrsdb/onlinelog/group_1.271.724405853'
ORA-17503: ksfdopn:2 Failed to open file
+DATA/plrsdb/onlinelog/group_1.271.724405853
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.271.724405853' does not
exist
ORA-00312: online log 1 thread 1:
'+DATA/plrsdb/onlinelog/group_1.270.724405851'
ORA-17503: ksfdopn:2 Failed to open file
+DATA/plrsdb/onlinelog/group_1.270.724405851
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.270.724405851' does not
exist
SQL>
SQL>
SQL>
SQL>
SQL> alter database clear unarchived logfile group 1;
alter database clear unarchived logfile group 1
*
ERROR at line 1:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1:
'+DATA/plrsdb/onlinelog/group_1.271.724405853'
ORA-17503: ksfdopn:2 Failed to open file
+DATA/plrsdb/onlinelog/group_1.271.724405853
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.271.724405853' does not
exist
ORA-00312: online log 1 thread 1:
'+DATA/plrsdb/onlinelog/group_1.270.724405851'
ORA-17503: ksfdopn:2 Failed to open file
+DATA/plrsdb/onlinelog/group_1.270.724405851
ORA-15012: ASM file '+DATA/plrsdb/onlinelog/group_1.270.724405851' does not
exist
SQL> shut immedaite
SP2-0717: illegal SHUTDOWN option
SQL> shut immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 4294967296 bytes
Fixed Size 2089432 bytes
Variable Size 838864424 bytes
Database Buffers 3439329280 bytes
Redo Buffers 14684160 bytes
Database mounted.
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination +DATA
Oldest online log sequence 0
Current log sequence 0
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS
---------- ---------- ---------- ---------- ---------- --- ----------------
FIRST_CHANGE# FIRST_TIME
------------- ------------
1 1 0 104857600 2 NO CLEARING_CURRENT
1.4167E+13 15-OCT-17
3 1 0 104857600 2 NO UNUSED
1.4167E+13 15-OCT-17
2 1 0 104857600 2 NO UNUSED
0 15-OCT-17
SQL> set linesize 1000;
SQL> /
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ------------
1 1 0 104857600 2 NO CLEARING_CURRENT 1.4167E+13 15-OCT-17
3 1 0 104857600 2 NO UNUSED 1.4167E+13 15-OCT-17
2 1 0 104857600 2 NO UNUSED 0 15-OCT-17
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@PLRSDB bin]$ ps -ef|grep pmon
oracle 5677 1 0 Mar09 ? 00:00:00 asm_pmon_+ASM
oracle 16941 16530 0 11:50 pts/6 00:00:00 grep pmon
[oracle@PLRSDB bin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Oct 15 11:51:03 2017
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL>
SQL>
SQL> startup mount
ORACLE instance started.
Total System Global Area 4294967296 bytes
Fixed Size 2089432 bytes
Variable Size 838864424 bytes
Database Buffers 3439329280 bytes
Redo Buffers 14684160 bytes
Database mounted.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
SQL> recover database until cancel;
Media recovery complete.
SQL> alter database open resetlogs;
Database altered.