Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I clone a twins DataBase.

Re: How can I clone a twins DataBase.

From: Robert Prendin <rprendin_at_magi.com>
Date: Fri, 29 May 1998 16:24:36 GMT
Message-ID: <356ee2ff.172137991@news.istar.ca>


Here's is one method I use to clone databases... you could also create a database from scratch and do an import of the full database export from the existing DB..

Here it is..
1.) From your source database issue the command 'alter database backup controlfile to trace' , this will create a .trc file which you will modify and rename to a .sql file. You will use this file for two things: first, to create a copy script to copy all the files listed in it to a new location where you would like them to be for your second instance. Secondly, you will then use it to create your control file for your second instance.. remove any comments, modify the locations of all the files and change the following <create control file reuse database "dbname" noresetlogs> to <create control file set database "newdbname" resetlogs>. and make sure the last line reads alter database open resetlogs

3.) shutdown the source database

2.) set ORACLE_SID to the new value for your second instance.

3.) create new initsid.ora and configsid.ora files for your second instance(I copy them from the other instance), modify them to reflect the new sid and file locations of the second instance.

4.) run the script that will copy all your data files

5.) svrmgrl       

6.) run your create control file .sql file and BE SURE all references to files are actually pointing the NEW locations and not those belonging to the other instance.

Don't forget to have complete backups before doing all this and you will have to add this instance to any sqlnet related .ora files,oratab etc.......

Good Luck

Robert Prendin
Email if you have any questions....
YATFG ]"Luca Minudel" <luca.minudel_at_nline.it> wrote:

>I need to have a clone copy of an existing Oracle Db, this twin Db =
>should
>run in a second Oracle instance.
>The twin copy of the db should be different only for DB_NAME and for =
>files
>location (datafiles, log files, control files etc.).
>At any time I should be able to copy original datafiles over the twin Db
>datafiles.
>
>This is because I'm going to have comparative tests and I need to =
>restore initial conditions after each test execution.
>
>Thanks!
>___________________________________________________
> Luca Minudel software designer
> Italy Conegliano (TV)
> voice & fax +39 (0)438 412280
> e-mail luca.minudel_at_nline.it
> WWW (italian language used)
> http://www.geocities.com/SiliconValley/Vista/4041
>
Received on Fri May 29 1998 - 11:24:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US