cloning database using srdf copy
TRANSCRIPT
Cloning DATABASE using SRDF copy
Take the backup of all the parameters file and backup of listener which are running on the database to be cloned
Take the backup of all the user which are running on the Database to be cloned
Check and take backup of all the services which were running on the database to be cloned
Check on all the nodes whether disk are visible after confirmation from storage team and if not ask the server Team to check on each nodes after confirmation from storage team
Mount diskgroup
Alter diskgroup <Diskgroup Name> mount ; ( On each node using SYSASM)
Mount Database with temporary init file and Recover
Mount the database using the old init.ora file which have we have taken the backup
Change the name of the database like replace DRORBIP with ORBIP in the paramters in init.ora files
like change the name of the control files and redo logs
Also check the structure or directories when changing the name in the init.ora files are they Present in the database if not than create in the database to be cloned
like check whether cdump generation directories is there with the Production name as it will give error when mounting the database with init.ora file
Recover Database
SQL> recover database using backup controlfile until cancel ;
While recovering the database it might give error asking for missing archive logs so check in the production when the snap was taken or when the database is put under begin and end backup mode note the SCN and restore these archive logs using while connecting in the production database using below RMAN script for each thread (including FRA)
Example
RMAN_USER:RMAN_ORBIP1 RMAN_PASSWORD:ORBIP1
run { allocate channel T1 type 'SBT_TAPE'; allocate channel T2 type 'SBT_TAPE'; allocate channel T3 type 'SBT_TAPE'; allocate channel T4 type 'SBT_TAPE'; send 'NSR_ENV=( NSR_SERVER=vobkd7vr-eth1.819, NSR_CLIENT=uknp71sr-bkp )';
Page 2 of 6
restore archivelog from SEQUENCE 451920 UNTIL SEQUENCE 451924 thread 1; release channel T1; release channel T2; release channel T3; release channel T4; } exit;
Transfer these archive logs to the destination of the database to be cloned Provide each archive log while recovering the database and cancel the recovery after providing the sufficient Archive logs
Example:
ERROR at line 1:ORA-01113: file 1 needs media recoveryORA-01110: data file 1: '+ORBIP_DATA/orbipdub/system01.dbf'
SQL> recover database using backup controlfile until cancel ; ORA-00279: change 14683760751667 generated at 07/28/2016 17:44:00 needed forthread 1ORA-00289: suggestion : +ORBIP_FRAORA-00280: change 14683760751667 for thread 1 is in sequence #451925Specify log: {<RET>=suggested | filename | AUTO | CANCEL}CANCELMedia recovery cancelled.
Open Database & take controlfile trace
Page 3 of 6
SQL> alter database open resetlogs ;Database altered.
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
Database altered.
Before Shutting down the database create spfile from our old init.ora file for future purpose while making necessary changes in the spfile like changing the name of the database back to the name of the database to be cloned and name of the diskgroup that we renamed in above step
Create spfile from the old init.ora file
SQL> Shut immeadite
Rename diskgroup
Rename the diskgroup by the name of Database to be clonned
renamedg phase=both dgname=ORBIP_FRA newdgname=DRORBIP_FRA confirm=true config=/tmp/renamedg verbose=true asm_diskstring='/dev/mapper/asm-*p1'
renamedg phase=both dgname=ORBIP_REDO01 newdgname=DRORBIP_REDO01 confirm=true config=/tmp/renamedg_REDO01 verbose=true asm_diskstring='/dev/mapper/asm-*p1'
renamedg phase=both dgname=ORBIP_REDO02 newdgname=DRORBIP_REDO02 confirm=true config=/tmp/renamedg_REDO02 verbose=true asm_diskstring='/dev/mapper/asm-*p1'
Page 4 of 6
renamedg phase=both dgname=ORBIP_DATA newdgname=DRORBIP_DATA confirm=true config=/tmp/renamedg_DATA verbose=true asm_diskstring='/dev/mapper/asm-*p1'
startup nomount with original initfile (with Cluster_database=FALSE)
Startup no mount with the spfile that we created from init.ora
Create Controlfile
Create Control file from the trace file that we have taken backup
Before opening the database make sure the controlfile location in spfile is correctly mentioned and it has been copied in three location(Standard Procedure)
Like:-
*.control_files='+DRORBIP_DATA', '+DRORBIP_REDO01','+DRORBIP_FRA'
Open Database,add redologs,tempfile
Open the database
Add redo logs and Tempfile according the production database from which it has been cloned Set Cluster_database=TRUE
Restart DB using srvctl.
Page 5 of 6
While using srvctl we might get error that logs are not online check the database and add the redo logs or make the redo logs available in the database
Before handing out the database check the connectivity and all the listeners are up and running and all the services are correctly assign and all the users are there in database and in open state.
##########################################
Page 6 of 6