How to automate 11.2 RMAN duplicate process
I am able to use a shell script to duplicate target (host 1) to auxiliary (host 2) from target backup done via TDPO channel.
In my shop, currently, there are automated cloneing process done via recreating control file and restore/clone from user managed TSM backup.
The dev db cloneing process happens every morning to clone from latest Prod backup.
How do I specify in the RMAN duplicate run block so that the duplicate process automatically picks up the latest TARGET database RMAN backup?
Welcome to any advise!!!!
I had much success using the active clone feature, which was introduced. What this does is allow you clone your DB when it's in use instead of copying
it from a backup..
There are a few things you need to watch out for before you take this
1) Ensure you have all your objects in logging mode (nothing should be in
NO LOGGING). If transaction are applied against an object during the cloning
and the object is in NO LOGGING mode there will be no records of these
transactions in the .arc logs. Once the clone is complete, it will probably
be invalid because it was missing those transactions.
2) As mentioned above, the active clone uses .arc logs to apply against
your cloned DB to bring it up to date. If the the .arc logs are backed up and
removed than you will need to do a manual recovery on your DB.
Below is my code for active clone.
script on target system
sqlplus ' / as sysdba ' <
rman catalog=rman/rman@prod1 target=sys/sys@prod << EOT
connect auxiliary sys/isys1@dev
duplicate target database to dev from active database nofilenamecheck
re-create temporary tablespace....
Do any post refresh steps
About how to automate the clone I typically use point in time recovery
for my larger DB's
sqlplus ' / as sysdba ' <
startup nomount pfile=/u01/app/oracle/product/11gR2/dbs/initdev.ora
rman catalog=rman/rman@prod target=sys/sys@prod <
connect auxiliary sys/sys
duplicate target database to dev nofilenamecheck
But I too am trying to find out what .arc files are needed so they can be
applied. I guess I can leave all the .arc files around to after the clone but
I do risk filling up my file system.. If you figure out how to do this please
Good luck with the active clone. I would kick it off during the lowest load time on your DB
Last edited by BeefStu; 10-05-2011 at 03:57 PM.
Thank you for the insight!
Active Dup. might be a good idea when the prod is not constraint on batch processing.
But I wonder, does RMAN dup. or backup use SQLNet? If so, there will be some bottleneck?
As far as arc logs, if you are using SAN/DAD for backup storage, perhaps a NFS mount be helpful to all arch. logs that is needed for active dup.
220.127.116.11.3 PSU fixed the BCT bug for duplication.
18.104.22.168 for AIX will be out this month.
4. If I have to use backup based duplication, if on day 1 at 3am Prod rman backup completes, at 7am an automated backup-based duplication to dev is to happen, how would I automate the until time instead of hard-code to_date in it?
Point 1) yes we schedule our active clone at the slowest time
Point 2) yes, it has to use the network to transfer the files
Point 3) Still waiting on the bug fix for my version
SQL for Last backup time:
# From DB that is being backed up
Using controlfile - select newest_backup_time from v$BACKUP_SET_SUMMARY
# From DB that contains your catalog
Using catalog - select db_name, NEWEST_BACKUP_TIME from rman.RC_BACKUP_SET_SUMMARY where DB_NAME = '???????';
BTW, I am trying to automate the same exact process but I keep getting
side-tracked. Ugggg If I get it done before you I will be more than
happy to share my solution. Hopefully, you can do the same.
A new link I found
I found a link that details how to automate duplication (backup-based):
It might now be helpful if you still have to dup. from active db.
Another "bad" idea, what if you mirror the Prod archive log to 2 locations:
arch_dest_1 is on your prod host and can be backed up and deleted,
arch_dest_2 is on a UNC drive -- that do not get deleted?
I am still fishing around and will let u know if I find a nut or two.
Thanks a LOT for your HELP!!!
Thanks for link!! Great find.
At first glance I see the user is setting
the variable NOW to before the backup and than using it in the until time
clause for the restore. I am thinking the NOW variable should be set after the backup is complete?
Secondly, the backup should contain something like this:
sql "alter system archive log current";
As it will force the system to write out all the dirty blocks into the datafiles.
Last edited by BeefStu; 10-07-2011 at 09:54 AM.
Click Here to Expand Forum to Full Width