Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: duplicating database
I just needed to do the same thing, and got a good procedure from someone
else out here.
In a nutshell, what you can do is generate a sql script that will recreate
your control files by running a trace on the instance you are copying, then
you copy all the data files for that instance to the new location, then
edit that script to reflect the new location/name and run it to rebuild the
files.
Here is a copy of one of the instruction sets that I was given:
Steps
Replace the paths names of all the datafiles & logfiles with the new path names if needed.
CREATE CONTROLFILE reuse set DATABASE "FINP" resetlogs ARCHIVELOG
MAXLOGFILES 64
MAXLOGMEMBERS 5
MAXDATAFILES 1022
MAXINSTANCES 10
MAXLOGHISTORY 1000
LOGFILE
5. Restore the datafiles from tape or from the database shutdown or in
hot backup mode with the database in archiving mode.
6. If you are cloning from production in hot backup mode. After you have moved the lasted datafiles and taking the database out of hot backup up do the following.
******Rememeber to setup the environment of the database**********
7. Create Control file
commands:
A. svrmgrl B. startup nomount; C. @control.sql D. alter database open resetlogs;
alter all the archived logs have been applied.
F. alter database open resetlogs.
This process worked well for me. The only thing you have to watch out for is to make sure all the references to your old database (the one you are copying from) are removed from the control file build script, or you run the trashing the old stuff.
Also, if you use a pfile other than the default one you will have to add the pfile to the STARTUP NOMOUNT statement that you'll find in the control file trace script. All our instances are different names so we always use the pfile= in every startup.
In addition, after the "alter database open resetlogs" I took the instance down clean, then brought it up normally. Call me supersitious, but it seemed cleaner that way!
Someone else out here also mentioned you might need to do an
alter database set global_name something-or-other (I don't remember exact
syntax) but
I didn't do that and it seems ok right now....
Good luck... Received on Sun Sep 19 1999 - 10:53:15 CDT
![]() |
![]() |