In the following scenario, We are going to learn about those steps which use to recover duplicate a production database on a different server maintaining the same SID and directory structures with ‘duplicateRMAN command I simply want to have a copy of my production database to a different server preserving the same database directory structures and even the same database name.

My production database is running on vsi08 server and its system id (ORACLE_SID) is PROD; the remote server is vsi10 and I want to duplicate here the PROD database currently available on vsi08.

Usually, when I install a new database I try to save all the related scripts to recreate it: it’s just another checkbox during a typical dbca installation.

On the local vsi08 server I can find those scripts located at $ORACLE_BASE/admin/’db_name’/scripts, that is:

If you look at the content of the unique sh file you can verify it creates few directories. I want to use the content of that file to create the same database directory structures on the remote server.

You should Add this entry in the /etc/oratab:

PROD:/opt/app/oracle/product/11.2.0/db_1:Y
/opt/app/oracle/product/11.2.0/db_1/bin/sqlplus /nolog

@/opt/app/oracle/admin/PROD/scripts/PROD.sql
So on remote vsi10 server I recreate the same directory structures of vsi08:

Next step is to create a pfile from the current PROD database located on vsi08 server and transfer that copy to vsi10 server:

Now it’s time to create a tns entry for vsi10 server referencing PROD database at vsi08 server. I first have a look at the current tns entry on the local vsi08 server…

… and then, using a simple copy-and-paste operation, I can create the new one on tnsnames.ora file of vsi10 server.
I modify only the reference of the tns entry from PROD to PROD_AT_VSI08 because I really want to remember I’m connecting to PROD database located at vsi08 server:

After the creation of PROD_AT_VSI08 tns entry I want to test it and try to connect from vsi10 server to PROD database on vsi08 server.
Before proceeding I have to successfully establish a connection otherwise my attempt to duplicate PROD database on vsi10 server won’t work.

Ok… I’m able to connect to PROD database at vsi08 server and now it’s time to have a complete backup of the database I want to duplicate. So from vsi08 server I set the following environment settings, backing up the database and its archivelogs. RMAN is configured using autobackup on so it will perform also a backup of the current control file and spfile:

The current backup pieces are located into two directories:

I need to create the same backup directories into vsi10 server:

From vsi08 server I copy the backup pieces to vsi10 server into the appropriate directories:

From the vsi10 machine I need to start the “nextduplicated PROD instance in NOMOUNT mode and with the previously copied pfile.

When the instance is started in NOMOUNT mode I can remotely connect RMAN to PROD database at vsi08 as target connection and to the “nextPROD database at the local server (vsi10) as auxiliary connection:

With the following duplicate command I want to restore all the datafiles located into the backup pieces and automatically start the new database on vsi10 server. At the end of the duplicate process I will have a complete copy of my production database with the same directory structures and even the same SID:

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

Source

For More Detail , You can join us follow:

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Leave a Reply