How to automate 11.2 RMAN duplicate process
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: How to automate 11.2 RMAN duplicate process

Hybrid View

  1. #1
    Join Date
    Sep 2011
    Posts
    12

    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!!!!

    Joy

  2. #2
    Join Date
    Jul 2006
    Posts
    195
    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.

    Below is my code for active clone.

    script on target system
    ==================


    cat active_clone.ksh
    ===============

    sqlplus ' / as sysdba ' < shutdown abort
    startup nomount
    exit
    EOT

    rman catalog=rman/rman@prod1 target=sys/sys@prod << EOT
    connect auxiliary sys/isys1@dev
    duplicate target database to dev from active database nofilenamecheck
    pfile=/u01/app/oracle/product/11gR2/dbs/initdev.ora ;
    exit
    EOT

    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
    exit
    EOT

    rman catalog=rman/rman@prod target=sys/sys@prod < connect auxiliary sys/sys

    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
    Last edited by BeefStu; 10-05-2011 at 02:57 PM.

  3. #3
    Join Date
    Sep 2011
    Posts
    12

    :-d

    Beefstu,

    Thank you for the insight!

    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?

    Joy

  4. #4
    Join Date
    Jul 2006
    Posts
    195
    Joy,

    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.

    Good luck

  5. #5
    Join Date
    Sep 2011
    Posts
    12

    Lightbulb A new link I found

    Hi Beefstu,

    I found a link that details how to automate duplication (backup-based):

    http://oratux.com/?p=36

    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!!!

    Joy

  6. #6
    Join Date
    Jul 2006
    Posts
    195
    Joy,

    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 08:54 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width