DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Clone database

  1. #1
    Join Date
    Aug 2001
    Posts
    390
    I have some problem with cloning the database, here is the step of how I do it: assume that I have database 1 called DB1 and database 2 called DB2( which I want to clone from DB!)

    1. copy and edit DB1's parameter file to DB2
    2. DB1 at svrmgrl: ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
    3. edit the trace file to

    startup nomount
    CREATE CONTROLFILE REUSE DATABASE "CLONE" RESETLOGS NOARCHIVELOG
    MAXLOGFILES 32
    MAXLOGMEMBERS 2
    MAXDATAFILES 32
    MAXINSTANCES 16
    MAXLOGHISTORY 1815
    LOGFILE
    GROUP 1 'C:\ORADATA\CLONE\LOG1CLONE.ORA' SIZE 1M,
    GROUP 2 'C:\ORADATA\CLONE\LOG2CLONE.ORA' SIZE 1M,
    GROUP 3 'D:\ORADATA\CLONE\LOG3CLONE.ORA' SIZE 1M
    DATAFILE
    'D:\ORADATA\CLONE\SYS1CLONE.ORA',
    'D:\ORADATA\CLONE\DATA1CLONE.ORA',
    'C:\ORADATA\CLONE\RBS1CLONE.ORA',
    'D:\ORADATA\CLONE\TMP1CLONE.ORA',
    'D:\ORADATA\CLONE\INDX1CLONE.ORA'
    CHARACTER SET WE8ISO8859P1
    ;
    ALTER DATABASE OPEN RESETLOGS;

    4. shutdown the DB1 and copy all of the datafiles and relo log files from DB1 to DB2 directory.
    5. set env
    6. connect internal
    7. startup nomount d:\oracle\ora81\admin\clone\pfile\initclone.ora
    8. @d:\oracle\ora81\admin\clone\create\create_clone.sql

    Everything work till number 7, my question is when I startup nomount to open the pfile so it can create the SGA, when I run the create scripts it's not working


    Can someone give me some detail step to step of how to make this work.

    Thanks in advance




  2. #2
    Join Date
    Nov 2000
    Posts
    344
    Instead of

    startup nomount d:\oracle\ora81\admin\clone\pfile\initclone.ora

    The command is

    startup nomount pfile=d:\oracle\ora81\admin\clone\pfile\initclone.ora

    John Dorlon
    www.ezsql.net
    john@ezsql.net

  3. #3
    Join Date
    Aug 2001
    Posts
    390
    john,

    thanks for the reply, I am sorry I mean startup nomount with the pfile, my instance is up and running ok except when I try to run the scripts above that's when I got into problem.

    Any idea of how it's not working

    Thanks

  4. #4
    Join Date
    Nov 2000
    Posts
    344
    What is the error message that it gives you?

    Another mistake I see is in the create controlfile command...

    you need the "set" keyword when renaming the database at
    the same time...

    CREATE CONTROLFILE REUSE set DATABASE "newdbname" RESETLOGS ...



    [Edited by jdorlon on 08-08-2001 at 03:57 PM]
    John Dorlon
    www.ezsql.net
    john@ezsql.net

  5. #5
    Join Date
    Aug 2001
    Posts
    390
    John,

    since we have the startup nomount to startup the instance, does it necessary to have NOMOUNT again in the scripts ???

    thanks for the info

  6. #6
    Join Date
    Nov 2000
    Posts
    344
    No, but it won't hurt anything if that command is in the script. It will just error on that command and then keep going.

    John Dorlon
    www.ezsql.net
    john@ezsql.net

  7. #7
    Join Date
    Aug 2001
    Posts
    390
    John,

    thanks so much for your reply, according to your advise, I changed and it goes a little further and it got errors, here is the error messages:

    1. SVRMGR> @d:\oracle\ora81\admin\clone\create\create_clone.sql


    LRM-00109: could not open parameter file 'd:\Oracle\Ora81\DATABASE\INITclone.ORA
    '
    ORA-01078: failure in processing system parameters
    Statement processed.
    Statement processed.

    It errors out and turn around process two statements, please let me know why it's doing that and how to fix it.

    Thanks



  8. #8
    Join Date
    Nov 2000
    Posts
    344
    Hi Mike,

    It sounds like this is what happened...

    1) You got the database up in nomount mode on your own.
    2) The script tried to open the database in nomount mode,
    but found a different init.ora file as a default and it didn't
    like it. No harm done here because you already had the db
    in nomount
    3) the script created your controlfiles as specified in
    d:\oracle\ora81\admin\clone\pfile\initclone.ora (if that is
    what you used to 'nomount' the database).
    4) the script opened your database

    So I think you are done!

    -John
    John Dorlon
    www.ezsql.net
    john@ezsql.net

  9. #9
    Join Date
    Aug 2001
    Posts
    390
    John,

    thanks so much and it works. Can you tell me what I need to revise my the script so that it won't error out before it process ???

    Thanks so much for your help

  10. #10
    Join Date
    Aug 2001
    Posts
    390
    John,

    sorry to bug you again, Now I should have two identical database. when I started the DB1, it works fine, but when I started DB2 even I set env to DB2 before I started I got some problem. The problem is instance is started but it has this error

    ORA-01102: cannot mount database in EXCLUSIVE mode.

    why it not mounted for the DB2 even we have two instance with 2 sid

    Thanks


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