The following describes how to reconstruct the control file in the RAC environment, including two examples. One is to rebuild the control file in the noresetlogs mode, and the other is to resetlogs mode.
The following describes how to reconstruct the control file in the RAC environment, including two examples. One is to rebuild the control file in the noresetlogs mode, and the other is to resetlogs mode.
In the following situations, you may need to recreate the control file:
O all control files are damaged or lost
O no backup for the control file or the backup is damaged
The following describes how to reconstruct the control file in the RAC environment, including two examples. One is to recreate the control file in the noresetlogs mode, and the other is to recreate the control file in the resetlogs mode. If all redo logs exist and are not damaged, you can use noresetlogs. Using resetlogs will clear all redo logs and reset log sequence to 1.
Rebuilding the control file on RAC is slightly different from that on a single instance: Before recreating the control file, you must set cluster_database to false and start only one instance for operations. Otherwise, an error is reported.
ORA-01503: create controlfile failed
ORA-12720: operation requires database is in EXCLUSIVE mode
After recreating the control file, set cluster_database to true.
TESTCASE1
---------------------------
Rebuilding the control file in noresetlog Mode
Process:
1. Generate a script to recreate the control file:
SQL> alter database backup controlfile to trace;
Database altered.
2. The generated control file script will be under udump:
SQL> show parameter user_dump_dest
NAME TYPE VALUE
-----------------------------------------------------------------------------
User_dump_dest string/u01/app/Oracle/diag/rdbms/racdb/RACDB1/trace
The path and name of the file are also output in the database's Alert log:
Alter database backup controlfile to trace
Backup controlfile written to trace file/u01/app/oracle/diag/rdbms/racdb/RACDB1/trace/RACDB1_ora_10076.trc
(Note: The specific scripts used in the example, for example, the commands for creating a control file and adding a temporary data file are all in the trace file generated above, other steps and commands are basically in this trace ).
3. Stop all database instances:
[Oracle @ rac1 trace] $ srvctl stop database-d RACDB
4. Use noresetlog to recreate the control file:
[Oracle @ rac1 trace] $ sqlplus/as sysdba
SQL * Plus: Release 11.2.0.3.0 Production on Tue Jan 8 11:23:44 2014
Copyright (c) 1982,201 1, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount; <== start an instance
ORACLE instance started.
Total System Global Area 739065856 bytes
Fixed Size 2232032 bytes
Variable Size 549454112 bytes
Database Buffers 184549376 bytes
Redo Buffers 2830336 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "RACDB" NORESETLOGS ARCHIVELOG
2 MAXLOGFILES 192
3 MAXLOGMEMBERS 3
4 MAXDATAFILES 1024
5 MAXINSTANCES 32
6 MAXLOGHISTORY 292
7. LOGFILE
8 GROUP 1 (
9 '+ DATA/racdb/onlinelog/group_1.261.783272805 ',
10' + RECO/racdb/onlinelog/group_1.257.783272807'
11) SIZE 50 mb blocksize 512,
12 GROUP 2 (
13 '+ DATA/racdb/onlinelog/group_2.262.783272807 ',
14' + RECO/racdb/onlinelog/group_2.258.783272809'
15) SIZE 50 mb blocksize 512,
16 GROUP 3 (
17 '+ DATA/racdb/onlinelog/group_3.269.804115405 ',
18' + RECO/racdb/onlinelog/group_3.261.804115405'
19) SIZE 50 m blocksize 512,
20 GROUP 4 (
21 '+ DATA/racdb/onlinelog/group_4.270.804115405 ',
22 '+ RECO/racdb/onlinelog/group_4.263.804115407'
23) SIZE 50 m blocksize 512
24 -- STANDBY LOGFILE
25 DATAFILE
26' + DATA/racdb/datafile/system.256.783272707 ',
27 '+ DATA/racdb/datafile/sysaux.257.783272707 ',
28' + DATA/racdb/datafile/undotbs1.258.783272707 ',
29' + DATA/racdb/datafile/users.259.783272707 ',
30' + DATA/racdb/datafile/example.264.783272831 ',
31 '+ DATA/racdb/datafile/undotbs2.265.783273081'
32 character set AL32UTF8
33;
Create controlfile reuse database "RACDB" NORESETLOGS ARCHIVELOG
*
ERROR at line 1:
ORA-01503: create controlfile failed
ORA-12720: operation requires database is in EXCLUSIVE mode <=========== because cluster_database = false is not set, an error is reported.
You need to set cluster_database = false:
SQL> alter system set cluster_database = false scope = spfile;
System altered.
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.