Joy,
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
approach.
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.
duplicate target database to dev nofilenamecheck
pfile=/u01/app/oracle/product/11gR2/dbs/initdev.ora
until time="TO_DATE('09/24/11,06:58:59','MM/DD/YY,HH24:MI:SS')";
exit
EOT
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
repost.
Good luck with the active clone. I would kick it off during the lowest load time on your DB
Active Dup. might be a good idea when the prod is not constraint on batch processing.
1.
But I wonder, does RMAN dup. or backup use SQLNet? If so, there will be some bottleneck?
2.
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.
3.
11.2.0.2.3 PSU fixed the BCT bug for duplication.
11.2.0.3 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
Point 4)
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.
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.
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.
Keep in mind this is a manual process for me too so my suggestions will
require testing..
First post your backup and clone scripts.
On the backup script I would suggest the following:
1. After the backup completes, lets have the script sleep 5-10 seconds.
2. Pull the DB time at this point and print it as official backup end time
(under heavy load the OS time and DB time can be different)
3. Do a second log switch (this will make sure that the official backup end time is contained in the archive log)
Lastly play around with the times and columns to see, which is the correct
one. I would have thought it was select db_name, NEWEST_BACKUP_TIME from rman.RC_BACKUP_SET_SUMMARY where DB_NAME = '???????';
I went through all kinds of max time and still got the same issue.
I thought, rather than using unitl time, I could do the script in steps like this:
Although they are all DONE on the auxiliary host:
1. Do a backup archivelog all (of the target db arch logs)
2. Grep the max sequence# from rc_backup_archived_log_details
3. Print max sequence#+1 as the next_sequence (to be used in the duplicate unitl sequence ..... step)
4. drop auxiliary db
5. rm all files just in case they are lingering
6. startup w/ initaux.ora (only contains db_name)
7. run the duplicate command
8. set db to noarchivelog mode.
However, these are all done via code blocks in a shell scripts. I haven't figured out how to do a exception handler yet. Currently, I have a sleep 60 between each code block. Might not be a ideal way to script things.
I guess, the key point that I am not certain is, there is always many ways to skin a kitty, but is my way correct?
Bookmarks