Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to clone/copy a database ?
In article <36AF71E6.F8BA5D3E_at_hotmail.com>, Peter Fullbright
<pfullbright_at_hotmail.com> writes
>Folks,
>
>I am trying to clone an existing database on another machine in an
>efficient and less time consuming path. Could someone help me with a
>list of steps I have to ollow in order to achieve my goal.
>
>Even though I could create a new database, on the new machine, create
>all necessary tablespaces, export the entire DB from the existing
>instance and import onto the new database, I am looking for a solution
>something similar to copying the datafiles, controlfiles, and
>activating the new database.
>
>Thanks very much.
>
>
>
>
Here goes - I'm assuming Oracle 8 or 7.3 versions
step 1 run server manager line mode (svrmgrl on Unix)
step 2 connect / as sysdba
step 3 alter database backup controlfile to trace; (this will create a
file in the udump directory called something.trc)
step 4 shutdown
step 5 exit server manager
step 6 copy every file related to that database from it's existing
location to the new location
Question - do you want to change the dbname too?
assuming yes
step 7 on the new server rename all the files in accordance with your
standards (if that includes the SID)
Step 8 on the new server (which I presume already has the correct
version of Oracle loaded) edit oratab to include the clone db name
step 9 on the new server edit the listener.ora and tnsnames.ora to
include the clone db
step 10 on the new server edit initSID.ora (aand configSID.ora if you
have one to have the correct loccations and db name)
step 11 on the new server That .trc file created in step 3 need to be
edited - remove all the lines before and after the create controlfile
sql statement. Edit the create controlfile statement to start create
controlfile reuse set "SID" resetlogs and so that all the file names are
correct for the clone save as createsid.sql.
step 12 on the new server set you oracle SId and environment variables
for the new SId and Oracle version
step 13 on the new server if your initSID.ora is not in ORACLE_HOME/bin
step up a link from there to its location
step 14 on the new server run servermanager line mode
step 15 on the new server connect / as sysdba
step 16 on the new server startup nomount
step 17 on the new server run createsid.sql
step 18 on the new server alter database resetlogs;
step 19 on the new server alter database open;
step 20 on the new server exit
you should now have a database up and running on the new server
so go back to the old server and start the original up again.
Good luck
There are other articles on the web about renaming databases - That's
how I found out how to do it.
Just one proviso - I'm writing this from memory at home having done this
three times on Monday at work - I hope I haven't missed anything out.
and it's worth checking all the syntax with a SQl manual 'cos my memory
is not infallible.
--
Diane
Received on Wed Jan 27 1999 - 15:21:25 CST