Total Pageviews

MOVE CONTROLFILE: from NON ASM to ASM


Purpose:
This SOP is defining the method to move the controlfile form NON-ASM to ASM.



Drawback;
  • Need complete database shutdown as its an offline activity.  
  • No rolling restart of instance possible in case of RAC.
High Level step:

  • Set database environment.
  • Shutdown database.
  • Start database in nomount state.
  • login to RMAN to backup the controlfile as copy at ASM diskgroup. Can make multiple copies.
  • Collect controlfile copy location and path at ASM level.
  • Modify control_files paramter at database level to refer new controlfile at ASM.
  • Shutdown database.
  • Startup database.


Detailed Level step:

Set Database environment:
$ORACLE_HOME, $ORACLE_SID, $PATH , $TNS_ADMIN etc.

Shutdown the database and restart in nomount state:
$sqlplus "/ as sysdba"
SQL> shutdown immediate;

In case it is RAC, then shutdown all instances either SQLplus as above or srvctl as below mentioend:
srvctl stop database -d neerajDB

Start database in NOMOUNT state:
In case of RAC start any one instance in NOMOUNT state:

$sqlplus " / as sysdba"
SQL > startup nomount;
SQL >

Connect to RMAN 
$ rman target /
RMAN> backup as copy current controlfile  format '+DATA';
RMAN> backup as copy current controlfile  format '+REDO';

NOTE: Oracle database used the OMF to create the file in ASM hence the controlfile copy are made in the below generic path:  <DISKGoup_NAME>/<DB_UNIQE_NAME>/controlfile/

Login the ASM owner:
$ su - grid 

Find the the control file location and name at ASM where copy has been created.
$ asmcmd -p
$ ls -l DATA/<DB_UNIQE_NAME>/controlfile/

For example 
+DATA/neerajDB/controlfile/neerajDB_control0bkp.334.12
+REDO/neerajDB/controlfile/neerajDB_controlbkp.333.12

Update Controlfile location: Assumption is made here that DB is started with SPFLIE
SQL> alter system set control_files='+DATA/neerajDB/controlfile/neerajDB_control0bkp.334.12,+REDO/neerajDB/controlfile/neerajDB_controlbkp.333.12' scope=both sid='*';
SQL> shut immediate;

SQL> startup nomunt;
SQL> show parameter control;
SQL> alter database mount;
SQL> alter database open;

start other instances. 

ORACLE recommends to start the database srvctl in case of RAC
srvctl start database -f neerajDB




No comments:

Post a Comment