11g openresetlogs should be able to OPEN the database directly. After opening the database, a full backup should be made for the database. After 10g uses this implicit parameter to OPEN the database, OR
11G should be able to open the database directly through OPEN resetlogs. After opening the database, a full backup should be made for the database, and 10G will encounter OR
Today, we have conducted a recovery test on the destruction of online logs. There are three main scenarios:
Test 1: Normally shut down the database and delete non-current logs
Test 2: After the database is properly shut down, delete the online Log File
Test 3: Shut down the database abnormally and delete the current online Log File
My test environment is a 32-bit database of Oracle 10.2.0.1, And the OS version is Red Hat 5.3. The specific test is as follows:
Test 1: Normally shut down the database and delete non-current logs
[Oracle @ ora10g ~] $ Sqlplus/as sysdba
SQL * Plus: Release 10.2.0.1.0-Production on Wednesday June 24 10:34:53 2015
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connected:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options
SYS @ ora10g> select group #, thread #, status, archived from v $ log;
GROUP # THREAD # STATUS ARC
---------------------------------------
1 1 CURRENT NO
2 1 INACTIVE YES
3 1 ACTIVE YES
SYS @ ora10g> set line 130 pages 130
SYS @ ora10g> col member for a50
SYS @ ora10g> select * from v $ logfile;
GROUP # status type member is _
-----------------------------------------------------------------------------
3 ONLINE/u01/app/oracle/oradata/ora10g/redo03.log NO
2 ONLINE/u01/app/oracle/oradata/ora10g/redo02.log NO
1 ONLINE/u01/app/oracle/oradata/ora10g/redo01.log NO
SYS @ ora10g> conn zlm/zlm
Connected.
ZLM @ ora10g> create table t1 as select * from dba_objects where 1 = 2;
Table created.
ZLM @ ora10g> insert into t1 select * from dba_objects where rownum <11;
10 rows created.
ZLM @ ora10g> select count (*) from t1;
COUNT (*)
----------
10
ZLM @ ora10g> commit)
Commit complete.
ZLM @ ora10g> alter system archive log current;
System altered.
ZLM @ ora10g> select group #, thread #, status, archived from v $ log;
GROUP # THREAD # STATUS ARC
---------------------------------------
1 1 ACTIVE YES
2 1 CURRENT NO
3 1 INACTIVE YES
-- Delete non-current online log files (ACTIVE and INACTIVE)
[Oracle @ ora10g backupsets] $ cd/u01/app/oracle/oradata/ora10g/
[Oracle @ ora10g ora10g] $ pwd
/U01/app/oracle/oradata/ora10g
[Oracle @ ora10g ora10g] $ ls-l
Total 1461348
-Rw-r ----- 1 oracle oinstall 7520256 Jun 24 control01.ctl
-Rw-r ----- 1 oracle oinstall 7520256 Jun 24 control02.ctl
-Rw-r ----- 1 oracle oinstall 7520256 Jun 24 control03.ctl
-Rw-r ----- 1 oracle oinstall 104865792 Jun 24 example01.dbf
-Rw-r ----- 1 oracle oinstall 172032 Nov 29 2014 indx01.dbf
-Rw-r ----- 1 oracle oinstall 52429312 Jun 24 redo01.log
-Rw-r ----- 1 oracle oinstall 52429312 Jun 24 redo02.log
-Rw-r ----- 1 oracle oinstall 52429312 Jun 24 redo03.log
-Rw-r ----- 1 oracle oinstall 283123712 Jun 24 sysaux01.dbf
-Rw-r ----- 1 oracle oinstall 587210752 Jun 24 system01.dbf
-Rw-r ----- 1 oracle oinstall 52436992 Jun 23 temp01.dbf
-Rw-r ----- 1 oracle oinstall 173023232 Jun 24 undotbs01.dbf
-Rw-r ----- 1 oracle oinstall 41951232 Jun 24 users01.dbf
-Rw-r ----- 1 oracle oinstall 100671488 Jun 24 zlm01.dbf
[Oracle @ ora10g ora10g] $ rm-f redo01.log
[Oracle @ ora10g ora10g] $ rm-f redo03.log
[Oracle @ ora10g ora10g] $ ls-l redo *
-Rw-r ----- 1 oracle oinstall 52429312 Jun 24 redo02.log
[Oracle @ ora10g ora10g] $
Test 1: Normally shut down the database and delete non-current logs
-- Shut down the database and restart it normally
ZLM @ ora10g> shutdown immediate
ORA-01031: insufficient privileges
ZLM @ ora10g> conn/as sysdba
Connected.
SYS @ ora10g> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS @ ora10g> startup
ORACLE instance started.
Total System Global Area 524288000 bytes
Fixed Size 1220384 bytes
Variable Size 318767328 bytes
Database Buffers 201326592 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/ora10g/redo01.log'
The system prompts that the log file of log group 1 cannot be opened because it has been deleted at the OS level.
-- Observe alert logs
[Oracle @ ora10g ora10g] $ cd/u01/app/oracle/admin/ora10g/bdump/
[Oracle @ ora10g bdump] $ tail-50f alert_ora10g.log
MMON started with pid = 11, OS id = 2970
Wed Jun 24 10:45:54 2015
Starting up 1 dispatcher (s) for network address '(ADDRESS = (PARTIAL = YES) (PROTOCOL = TCP ))'...
Starting up 1 shared server (s )...
CJQ0 started with pid = 10, OS id = 2968
MMNL started with pid = 12, OS id = 2972
Wed Jun 24 10:45:55 2015
ALTER DATABASE MOUNT
Wed Jun 24 10:45:58 2015
Setting recovery target incarnation to 8
Wed Jun 24 10:45:58 2015
Successful mount of redo thread 1, with mount id 4202063779
Wed Jun 24 10:45:58 2015
Database mounted in Exclusive Mode
Completed: ALTER DATABASE MOUNT
Wed Jun 24 10:45:59 2015
ALTER DATABASE OPEN
Wed Jun 24 10:45:59 2015
LGWR: STARTING ARCH PROCESSES
ARC0 started with pid = 16, OS id = 2980
Wed Jun 24 10:45:59 2015
ARC0: Archival started
ARC1: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
Wed Jun 24 10:45:59 2015
Errors in file/u01/app/oracle/admin/ora10g/bdump/ora10g_lgwr_2960.trc:
ORA-00313: Message 313 not found; No message file for product = RDBMS, facility = ORA; arguments: [1] [1]
ORA-00312: Message 312 not found; No message file for product = RDBMS, facility = ORA; arguments: [1] [1] [/u01/app/oracle/oradata/ora10g/redo01.log]
ORA-27037: Message 27037 not found; No message file for product = RDBMS, facility = ORA
Linux Error: 2: No such file or directory
Additional information: 3
Wed Jun 24 10:45:59 2015
Errors in file/u01/app/oracle/admin/ora10g/bdump/ora10g_lgwr_2960.trc:
ORA-00313: Message 313 not found; No message file for product = RDBMS, facility = ORA; arguments: [1] [1]
ORA-00312: Message 312 not found; No message file for product = RDBMS, facility = ORA; arguments: [1] [1] [/u01/app/oracle/oradata/ora10g/redo01.log]
ORA-27037: Message 27037 not found; No message file for product = RDBMS, facility = ORA
Linux Error: 2: No such file or directory
Additional information: 3
Wed Jun 24 10:45:59 2015
ARC0: STARTING ARCH PROCESSES
ARC2: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
ARC0: Becoming the 'no fal' ARCH
ARC0: Becoming the 'no srl' ARCH
ARC1 started with pid = 17, OS id = 2982
Wed Jun 24 10:46:00 2015
ARC1: Becoming the heartbeat ARCH
ARC2 started with pid = 18, OS id = 2984
Wed Jun 24 10:46:00 2015
ORA-313 signalled during: alter database open...
It was found that the redo01.log file was read incorrectly and the database could not be opened. The database only stayed in the MOUNT status.
-- Clears the two deleted online log files (equivalent to rebuilding)
SYS @ ora10g> select open_mode from v $ database;
OPEN_MODE
----------
MOUNTED
SYS @ ora10g> alter database clear logfile group 1;
Database altered.