Duplicate a Controlfile when ASM is Involved
Know current control file
SQL> show parameter control_files
NAME TYPE VALUE
—————— ———– ——————————
control_files string +DB_DATA01/indian/controlfile/current.269.746249877
Add second file in Same Disk Group
SQL> alter system set control_files=’+DB_DATA01/indian/controlfile/ current.269.746249877′,’+DB_DATA01′ scope=spfile;
Step 2 Start the instance in NOMOUNT mode.
Step 3 From rman, duplicate the controlfile
$ rman target /
RMAN> restore controlfile from ‘+DB_DATA01/indian/controlfile/current.269.746249877’;
Step 4 Mount and Open the database
RMAN> sql ‘alter database mount’;
RMAN> sql ‘alter database open’;
Step 5 Validate both controlfiles are present
SQL> select name from v$controlfile;
Step 6 Modify the control_file parameter with the complete path of the new file:
SQL> alter system set control_files=’+ DB_DATA01/indian/controlfile/current.269.746249877′,’+ DB_DATA01/indian/controlfile/backup.275.746250653′ scope=spfile;
When using init.ora file:
Step 1 Edit init.ora and add new disk group name or same disk group name for mirroring controlfiles.
Example:
control_files=(‘+GROUP1′,’+GROUP2’)
Step 2 Start the instance in NOMOUNT mode.
Step 3 Execute restore command, to duplicate the controlfile using the original location.
Example:
RMAN> restore controlfile from ‘+DB_DATA01/indian/controlfile/current.269.746249877’;
Step 4 Mount and open the database
RMAN> alter database mount;
RMAN> alter database open;
Step 5 Verify new mirrored controlfiles
SQL> show parameter control_files
It is also possible to duplicate the controlfile using a specific name for the new controlfile.
On the ASM instance:
Step 1 Create the directory to store the new controlfile.
SQL> alter diskgroup
On the database instance:
Step 2 Edit init.ora or spifile and modify parameter control_file:
control_files=’+DB_DATA01/INDIAN/CONTROLFILE/control01.ctl’,’/+DB_DATA/INDIAN/CONTROLFILE/control01.ctl’
Step 3 Identify the location of the current controlfile:
SQL> select name from v$controfile;
Step 4 Shutdown the database and start the instance:
SQL> shutdown normal
SQL> startup nomount
Step 5 Use RMAN to duplicate the controlfile:
$ rman target /
RMAN>restore controlfile to ‘
RMAN> restore controlfile to ‘————-ïƒ ’ from ‘<.————ïƒ ’;
Step 6 Start the database:
SQL> alter database mount;
SQL> alter database open;
On the database instance:
Step 1 Identify the location of the current controlfile:
SQL> select name from v$controlfile;
Step 2 Shutdown the database and start the instance:
SQL> shutdown normal
SQL> startup nomount
Step 3 Use RMAN to duplicate the controlfile:
$ rman target /
RMAN>restore controlfile to ‘
We are only specifying the name of the diskgroup, so Oracle will create an OMF (Oracle Managed File). Use ASMCMD or sqlplus to identify the name assigned to the controlfile
Step 4 On the ASM instance, identify the name of the controlfile:
Using ASMCMD:
$ asmcmd
ASMCMD> cd
ASMCMD> find -t controlfile . *
On the database side:
• Modify init.ora or spfile, adding the new path to parameter control_files.
• if using init.ora, just modify the control_files parameter and restart the database.
• If using spfile,
1) startup nomount the database instance
2) alter system set control_files=’+DG1/P10R2/CONTROLFILE/backup.308.577785757′,’/oradata2/102b/oradata/P10R2/control01.ctl’ scope=spfile;
shutdown immediate
start the instance.
Verify that new control file has been recognized. If the new controlfile was not used, the complete procedure needs to be repeated.
Responses