Clone standby database without rman
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: Clone standby database without rman

  1. #1
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,480

    Talking Clone standby database without rman

    Hi guys!

    I need to clone a standby database without using rman (have no disk space).

    Here is the setup:
    OS: HPUX
    Oracle9i Enterprise Edition Release 9.2.0.6.0

    Server S has standby db
    Server C has mounted /oradata disk from standby

    What I intend to do (if it's possible) is kinda similar to "cloning" a database from an OS hot backup:

    1) QUIESCE the standby (can it be done?)
    2) Copy db files from /oradata/standby to /oradata/clone
    3) UNQUIESCE the standby
    4) Re-create clone control file + open reset logs


    Q1: Can I stop managed recovery and quiesce the standby? .. And then unquiesce and restart managed recovery?

    Q2: Will copying the files be enough to clone db or do I need something else like redo/archive logs?
    It's been a very looooooong time since I cloned a db from hot/cold backup.

    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  2. #2
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    You need to just copy the datafile from the standby database to the server where you want the clone to be.

    Just use the rman copy command to do this its very simple something like

    RMAN> run{
    backup as copy datafile 1 format 'D:\ORADATA\CLONEDB\SYSTEM01.DBF';
    .....
    }

    take a backup of the controlfile to trace edit and to change the paths and then use it to recreate the controlfile on the clone database.

    make sure you edit the first few lines to

    create controlfile set database 'dbname' resetlogs

    once the controlfile is created and the database mounted

    recover datbase using backupcontrolfile until cancel

    apply archivelogs if any to make it consistent and then open the database with alter database open resetlogs

    hope you get the idea

    regards
    Hrishy

  3. #3
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,480

    Talking Quiesce Restricted?

    Thanks hrishy,

    That is exactly what I thought, unfortunately for that to work I would need space on the standby server which then I could mount unto the clone server.

    That is why I thought of "quiesce" to avoid shutting down the standby during the copy and just mounting the disks unto the clone server.

    Also I tried the "quiesce", but first got:

    SQL> ALTER SYSTEM QUIESCE RESTRICTED
    *
    ERROR at line 1:
    ORA-25500: database is not open

    And then:

    SQL> ALTER DATABASE OPEN READ ONLY
    *
    ERROR at line 1:
    ORA-01092: ORACLE instance terminated. Disconnection forced

    This is caused because I need to activate the "Oracle Resource Manager" on both the Primary and Standby (which requires shutdown/startup).

    Your idea is very good, I will research how to configure the rman channels to write to remote location (vg: cloneserver:/oradata)

    Any other ideas are welcome...
    Last edited by LKBrwn_DBA; 10-08-2008 at 09:08 AM.
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  4. #4
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    There are no other ideas you need to NFS mount the clone server and copy the datafiles.

    If thats not possible then you need to copy over the files to temp location on the standby server on a file by file basis and scp teh files over to the clone server .

    Only in 11g you can clone from a live database and in all other versions you need to use the copy of the backup to clone and you need space for that.

    regards
    Hrishy

  5. #5
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,480

    Talking Hot

    If I just stop the managed recovery and copy the files, would this be equivalent to hot backup?
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  6. #6
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    Yes but you need to apply the archivelogs to make the datafiles consistent.

    But why would you go that route ? and disturb scheme of things RMAN copy command is simple and non-intrusive and most important standby database dont ahev to play catch up with primary

    regards
    Hrishy

  7. #7
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,480

    Talking The old, olD, oLD, OLD procedure to clone a database

    Quote Originally Posted by hrishy
    Hi

    Yes but you need to apply the archivelogs to make the datafiles consistent.

    But why would you go that route ? and disturb scheme of things RMAN copy command is simple and non-intrusive and most important standby database dont ahev to play catch up with primary

    regards
    Hrishy
    I know, every backup/clone/etc.. here I do with RMAN.

    Unfortunately on this particular server we have no space for an rman backup (1.2T) therefore I have mounted the data files (mp) unto the target server where I can copy to other locations, create the controlfile and start the clone (like the old, olD, oLD, OLD procedure to clone databases)...


    Thanks for your help!
    .
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  8. #8
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,480

    Talking Ta-ra-rara-tara!!! (trumpets blaring)

    And the solution is:

    1) Stop managed recovery on the standby:
    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

    2) Copy the files from standby mp to clone mp.

    3) Re-start managed recovery on the standby:
    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
    DISCONNECT FROM SESSION;

    4) Re-create the controlfile on the clone:
    STARTUP NOMOUNT
    CREATE CONTROLFILE SET DATABASE "CLONEDB" RESETLOGS FORCE LOGGING NOARCHIVELOG
    -- Etc --

    5) Open clone database with resetlogs

    And ALL is OK!
    .
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  9. #9
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    Congrajulations Dont just sit there its time you open a blog and blog about this :-) and tell the whole world ;-)

    regards
    Hrishy

  10. #10
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    Nicely done LKBrwn_DBA, congrats!
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

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