Duplicating a database has never been so easy! (11gR2 new feature)

When the DUPLICATE RMAN command was introduced back in 10g, one of the things that was freaking people out was that although you were able to make it from a backup, you had to have connection established to the main database (I won’t call it Primary so you don’t get confused with Data Guard concepts).

On Oracle 11g Release 1, the new feature went a step backwards in my opinion, launching a feature that would enable you to duplicate a runing database without the need of a backup. What was the matter with these people!? All we wanted was the exact opposite!!

So now in Oracle 11g Release 2 you can duplicate a database from a backup alone (without the need to connect to the source database), and even better: you can choose which backup you would want to duplicate from!

To explain you guys how this is done, I’ve decided to duplicate my RAC Database, from the most recent backupset, onto the same machine as a “Standalone” database. Pretty cool. I’ve managed to un-RAC it in minutes!

Take a look:


We are going to use Enterprise Manager, but this whole process can be done through RMAN and a coupple of other manual tweaks. You choose “CLONE DATABASE” from the “Data Movement” tab and the process starts.

Image2In this screen we selected “Existing Database Backup”, from a backup taken previously. Fill in the host credentials so the process can invoke the RMAN shell:



This is awsome! You might want to duplicate or clone from the latest backup taken or from a point somewhere in the past through a time reference or a SCN (System Change Number) reference.


You can choose the name of your duplicated database, whether that would go to a FS or ASM, and what will be the degree of parallelism, that will mean in practical terms, that RMAN will allocate more channels for the operation. If your fetching the backup from tape, you might want to raise the level to a comfortable level between getting performancewise stuck and taking too long.


We had problems using AMM’s new 11g feature, and so we decided to stick with the ASMM way:


Attention! You have to choose a different TNS Listener port if you are going to duplicate in the same host, or into a different one that has already a TNS Listener defined. In other words, there can’t be no colisions in the TNS Port you choose, otherwise you will be flagged:


If on the same server you can choose to put the files on the same place or choose another location:


Now it’s always better than “Later” ;-)


A brief review of you are about to launch. In our case it’s a simple database clone in the same server. The proceding for a different would be the same, except that in the case of tape backup the destination host would have to see the tape robot or drives. In case of disk backup, the destination host would have to have the backup copied over there (don’t tie yourself up with Unix NFS or Windows Network Drives if you can avoid it).

Image12Well at least the sumbition went well… let’s click on the job’s name and make a regular refresh to the page (or just check V$RMAN_OUTPUT):


Step 1 succeeded! Yes!! Let’s wait calmly because this is too much enthusiasm…


After 857 seconds the process ended just fine. Now let’s check out new database:


1) You have your “/etc/oratab” updated

2) You have the user HR unlocked and with the password HR, which was the change we’ve made on the source database so we could test it out here

Cloning and duplicating databases was never so easy.


About these ads

3 thoughts on “Duplicating a database has never been so easy! (11gR2 new feature)

  1. Thanks for your post;
    one question, when specifying the oracle host for the new database, how to register the host i want ( i use tcpip) ?. I have only one host (the source host), and I don’t see the one i want.


  2. Fantastic, Luis

    In the last weekend i been exactly trying test this feature on my Grid Control that on in my home.
    This feature is amazing, very very easy and go to help everybody.

    Great article Luis, congratulations.

    See you later

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s