Oracle: Duplicate Controlfile in ASM

Control file is one of the most critical components of Oracle Database. It is recommended to have multiple copies spread across different DISKGROUPS (in ASM) or different file system. If the control file is lost Database crashes.

Below are the steps for creating a duplicate control file in ASM with INIT file.

1. Shut down the database using Shutdown Immediate.

2. Edit the init.ora to include the second disk group.

Control_files=('+DISK1','+DISK2')

You can create directory within the DISKGROUP if needed. Below are the two ways to do that

a) Alter diskgroup DISK1 add directory '+DISK1/QA_DB/Control';

or

b)
ASMCMD> cd DISK1/QA_DB
ASMCMD> mkdir Control

3) Startup the database in NOMOUNT state.

4)
rman nocatalog
RMAN> Connect target
RMAN> Restore controlfile from '+DISK1/';

5) Mount the database followed by Open.

6) check the control file by
show parameter control.


Duplicate Control File in ASM with SPFILE

1) Modify the SPFile
Alter system set control_files='+Disk1/QA_DB/Control/current.xxx.yyyy','+DISK2' scope=spfile;

2) Start the instance in NOMOUNT state

3)
rman nocatalog
RMAN> connect target
RMAN> restore controlfile from '+Disk1/QA_DB/Control/current.xxx.yyyy';

4) Mount the database followed by brining to Open status.

5) Validate the controlfile
Select * from v$controlfile;

6) Edit the spfile and refer to the exact controlfile name

Alter system set control_files='+Disk1/QA_DB/Control/current.xxx.yyyy','+Disk2/QA_DB/Control/current.aaa.bbbbbbbb scope=spfile;


Thats it .. we are done.

No comments:

Post a Comment