Friday, March 29, 2013

In the following scenario 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.

... 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:

When the instance is started in NOMOUNT mode I can remotely connect RMAN to PROD database at vsi08 as target connection and to the "next" PROD 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:

Hey There. I found your blog using msn. This is a very smartly written article.I'll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I will certainly comeback.

I'm really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you modify it yourself? Either way keep up the excellent quality writing, it is rare to see a nice blog like this one nowadays.

I like the valuable information you provide in your articles.I'll bookmark your weblog and check again here regularly. I'm quite certain I'll learn plenty of new stuff right here! Best of luck for the next!

If you want a Premium Minecraft Account check out this generator.With it you can generate a unique Minecraft Premium Account which no one else has!You can Download the Free Premium Minecraft Account Generator http://www.minecraftdownload2013.tk

Thanks in favor of sharing such a fastidious idea, article is nice, thats why i have read it fully

If you want a Premium Minecraft Account check out this generator.With it you can generate a unique Minecraft Premium Account which no one else has! You can Download the Free Premium Minecraft Account Generator http://www.free-minecraft-download.tk

I wanted to thank you for this excellent read!! I definitely loved every bit of it.I've got you bookmarked to look at new things you post…

Unlike the people who commented before me, this article has helped me a lot on how to tackle the replication of our reports database during month end. It will reduce time consuming data pump method that I have been doing for the past 2 years. Thank you very much and keep up the good work.