Being an Oracle DBA we know that what is cloning? This technical definition gives you a correct idea of the cloning. RMAN has the ability to duplicate, or clone, a database from a backup or from an active database. It is possible to create a duplicate database on a remote server with the same file structure, a remote server will a different file structure or the local server with a different file structure.

 

 

Below are the steps for doing RMAN from RAC to RAC. Steps will be same from NON RAC TO RAC .

Detail Source Destination
Node 1 prodb1-host clonedb1-host
Node 2 prodb2-host clonedb2-host
Version 12.1.0.2 12.1.0.2
Database Name PRODB CLONEDB
Instance Name 1 PRODB1 CLONEDB1
Instance Name 2 PRODB2 CLONEDB2

First we will restore the database to only one node1 and later we will convert to RAC.

All the activities need to be done target database only.

1. Create a static listener on the target host(NODE1)( From ORACLE_HOME)

2. Add tns entry of both source and target db in tnsnames.ora file(TARGET_HOST NODE 1 )

3. Copy the pfile from source db and update the below parameters.

SOURCE PFILE LOOKS LIKE

Now change the db name to CLONEDB and instance names to CLONEDB1, CLONEDB2 in the pfile.
Apart from this, we need to do the few other changes. and save it as initCLONEDB1.ora in $ORACLE_HOME/dbs location.

Now the target db pfile will look as below.
Now change the db name to CLONEDB and instance names to CLONEDB1, CLONEDB2 in the pfile.
Apart from this, we need to do the few other changes. and save it as initCLONEDB1.ora in $ORACLE_HOME/dbs location.

Now the target db pfile will look as below.

cat initCLONEDB1.ora

4. Create password file on source and target db:(password should be same)

Now create password file on source and target db with same sys password.

5. Now start the target database in nomount stage:

6. Test the connectivity to target and auxiliary:[ TARGET HOST]

For big databases, it is recommended to create a shell script and run in background as below.

7 . Prepare the rman run script:[TARGET HOST]

8. Prepare the shell script.[TARGET HOST]

9. Now run the script with nohup mode:[TARGET DB]

10. Monitor the log

— FEW PART OF THE LOG

Complete log:

Now the database is up and available but only on one node. We need to register the database and convert it into a RAC database.

11. Make cluster parameter to true:

12. Create spfile in asm disk

— Now create the spfile in ASM dis

Go to $ORACLE_HOME/dbs

Update initCLONEDB1.ora as below

Same thing do it on node 2:(upgrade initCLONEDB2.ora)

13. Register the database and modify the configuration

14. Now shutdown the database on node 1 and restart using srvctl.

— Check crs status

Now RAC database is ready for use.

RESTORE FAILED RMAN ACTIVE CLONE:

While restoring a big database, cloning might fail in the mid due to a network issue. In that case, no need to start from the beginning.
Follow below steps to resume the restore.It will skip the copied files,

1. Shutdown the database
2. Remove the spfile, which rman has created during the duplication
3. Start the database with nomount stage(using the original init file, which you have used , which starting the database initially)
4. Run the same exact rman duplication script.
5. Rman will detect the files which were copied during the previous cloning process and those will be skipped.It will only restore the new datafile which was not copied previously.

It will show the warning like below:
Using previous duplicated file +DATA/CLONEDB/DATAFILE/undotbs2.628.936641735 for datafile 78 with checkpoint SCN of 11712137096850. You can ignore.

NOTE :

If the database version is 11g, then use the below rman run block:(in step 7 )

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: www.linkedin.com/in/SirDBaaSJoelPerez

Anuradha’s LinkedIn: https://www.linkedin.com/in/dbaanuradhamudgal/

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Comments

Leave a Reply