How To Recreate Control File
How To Recreate Control File
How To Recreate Control File
ON A RAC ENVIRONMENT
Alejandro Vargas
Oracle Support Israel
Principal Support Consultant
Table of Contents
Case Description.................................................................................................................................................................................................... 2
Recreate Controlfile on a RAC environment, list of steps ....................................................................................................................................2
Step by Step Execution ......................................................................................................................................................................................... 3
1. Generate a create controlfile script on the source database and edit it ........................................................................................................3
2. Generate a pfile from the source database and edit it ...................................................................................................................................4
3. Startup nomount the database with the pfile ................................................................................................................................................ 5
4. Execute the create controlfile script ............................................................................................................................................................ 6
5. Check the name of the new controlfile .........................................................................................................................................................7
6. Shutdown immediate ....................................................................................................................................................................................7
7. Edit the pfile with the new controlfile name enable cluster ........................................................................................................................ 7
8. Startup nomount with the pfile .....................................................................................................................................................................8
9. Create an spfile from the pfile and set a pfile on both servers pointing to it ............................................................................................... 8
10. Shutdown immediate ..................................................................................................................................................................................8
11. Register the database with CRS ................................................................................................................................................................. 9
12. Startup the Database Using srvctl .............................................................................................................................................................. 9
End of the procedure ...................................................................................................................................................................................... 10
Case Description
An ASM disk group containing a 10g R2 RAC database has been cloned using storage tools.
The cloned ASM disk group has been mounted on a 2 node cluster where there are located other clones of the same
source RAC database.
To be able to open the cloned database we need to rename it, we achieve this generating a new controlfile.
The create controlfile purpose will be to rename the database, so that several copies of the same database can coexist
on the same server.
'+DATADG/racdbtst/datafile/tbs_auto.272.621519707',
'+DATADG/racdbtst/datafile/on_asm.288.621519721'
CHARACTER SET AL32UTF8
;
On this file you will need to change the syntax to set the new name of the database.
If the clone was done using begin/end backup you will need to do recovery and resetlogs also:
Change from:
CREATE CONTROLFILE REUSE DATABASE "RACDBTST" NORESETLOGS ARCHIVELOG
to
CREATE CONTROLFILE REUSE SET DATABASE "RACDBNEW" RESETLOGS ARCHIVELOG
On the lines containing the old diskgroup name you will need to setup the new diskgroup name, ie: Change from:
'+DATADG/racdbtst/datafile/on_asm.288.621519721'
to
'+DATADGNEW/racdbtst/datafile/on_asm.288.621519721'
*.log_archive_dest_1='LOCATION=+ARCHDGNEW/RACDBTST/ARCHIVED_LOGS/'
*.audit_file_dest='/oradisk/app01/oracle/admin/racdbnew/adump'
*.background_dump_dest='/oradisk/app01/oracle/admin/racdbnew/bdump'
*.core_dump_dest='/oradisk/app01/oracle/admin/racdbnew/cdump'
*.user_dump_dest='/oradisk/app01/oracle/admin/racdbnew/udump'
*.db_recovery_file_dest='+ARCHDGNEW'
racdbtst1.instance_number=1
racdbtst2.instance_number=2
*.log_archive_dest_1='LOCATION=+ARCHDGNEW/RACDBTST/ARCHIVED_LOGS/'
*.remote_listener='LISTENERS_RACDBNEW'
racdbnew1.instance_number=1
racdbnew2.instance_number=2
racdbnew1.thread=1
racdbnew1.undo_tablespace='UNDOTBS1'
racdbnew2.undo_tablespace='UNDOTBS2'
cluster_interconnects string
SQL> show parameters control
NAME TYPE VALUE
------------------------------------ ----------- -----------------------------control_file_record_keep_time integer 7
control_files string +DATADG
22 '+DATADGNEW/racdbtst/datafile/tbs_manual.287.621519689',
23 '+DATADGNEW/racdbtst/datafile/tbs_auto.272.621519707',
24 '+DATADGNEW/racdbtst/datafile/on_asm.288.621519721'
25 CHARACTER SET AL32UTF8
26 ;
Control file created.
6. Shutdown immediate
Shutdown immediate, next you will need to edit the pfile with the new controlfile name
SQL> SHUTDOWN IMMEDIATE;
ORA-01109: database not open
Database dismounted.
7. Edit the pfile with the new controlfile name, enable cluster
Set the controlfile name and enable cluster
control_files='+DATADGNEW/racdbtst/controlfile/current.282.642363877'
cluster_database=TRUE
9. Create an spfile from the pfile and set a pfile on both servers pointing to it
Now we need to generate an spfile and the pfiles for both instances that will point to it.
SQL> create spfile='+DATADGNEW/spfileracdbnew.ora' from pfile='/tmp/initracdb.ora';
File created.
Go to $ORACLE_HOME/dbs on node 1 and setup an init.ora pointing to the new spfile
echo "SPFILE='+DATADGNEW/spfileracdbnew.ora'" >initracdbnew1.ora
Go to $ORACLE_HOME/dbs on node 2 and setup an init.ora pointing to the new spfile
echo "SPFILE='+DATADGNEW/spfileracdbnew.ora'" >initracdbnew2.ora
OFFLINE OFFLINE
OFFLINE OFFLINE
OFFLINE OFFLINE
OFFLINE OFFLINE
OFFLINE OFFLINE
OFFLINE OFFLINE
ONLINE ONLINE
ONLINE ONLINE
ONLINE ONLINE
ONLINE ONLINE
ONLINE ONLINE
ONLINE ONLINE