3 - 4 minutes readDuplicate a Controlfile when ASM is Involved

Reader Mode
Duplicating a control file into ASM when original control file is stored on ASM
If using spfile:
Step 1 Modify the spfile specifically the parameter control_files.
In this example, a second controlfile is going to be created on same diskgroup DB_DATA01

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

Duplicating a control file into ASM using a specific name

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 add directory ‘+DB_DATA02>/INDIAN/CONTROLFILE’;

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 ‘‘ from ‘‘;
RMAN> restore controlfile to ‘————-’ from ‘<.————’;

Step 6 Start the database:

SQL> alter database mount;
SQL> alter database open;

Duplicating a control file into ASM when original controlfile is stored on a file system

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 ‘‘ from ‘‘;

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.

Related Articles

Responses

Your email address will not be published. Required fields are marked *

Password Reset
Please enter your e-mail address. You will receive a new password via e-mail.