Re: Copy of an Oracle db

From: michael ngong <mngong_at_yahoo.com>
Date: 18 Feb 2002 05:01:46 -0800
Message-ID: <ecf365d5.0202180501.64476daa_at_posting.google.com>


edzard_at_volcanomail.com (Edzard) wrote in message news:<5d75e934.0202170825.53a9234_at_posting.google.com>...
> Forget to mention about the ntbox: you can choose to find all files
> modified since today. That will include all online Oracle database
> files.

The first thing you do when you are trying to clone/copy a database is to
backup controlfile to trace "alter database backup controlfile to trace resetlogs "

(Backup the database if it is possible just in case something goes the wrong way)

This will give you a file in your dump directory which you will use to recreate the controlfile for your new database(I will call it new.trc)

Now you need to copy all datafiles controlfiles and redolog files to a new location.using the operating system (unix cp)(nt drap and drop) command giving them a name you will want them to have in your new database.

This is the longest part of the cloning operation.

Do you know the names of the controlfiles ,redo log files and datafiles?

If not

1)select name from v$datafile for all the datafiles
2)select name from v$controlfile for all the controlfiles
3)select member from v$logfile  for all redologfiles.

After all this go to your trace file and rename all the datafiles and redolog files to reflect your new files you just made from the copies(new.trc)

Create a new startup file(init."newdatabasename".ora) with the SAME(it must be the same) block size specified as that of the database from which you want to copy.Change database name to be like the name of your new database .Change value of controlfiles to be the names of the controlfiles you just created.
Now you are ready to kick off

Go to new.trace(your trace file)

remove all lines before
create controlfile reuse database "old database name"..

change this line to
create controlfile reuse set database "new database name "resetlogs" edit to remove the recover database from the new.trc file till the end of the file

Go to the command line
set your oracle_sid export oracle_sid=.. or setenv oracle_sid .....

Now run your new.trc file and you should have a new database with the same
block size the same users ...etc

startup nomount pfile="your startup file" _at_new.trc

Hope this helps

Michael Tubuo Ngong (Sr DBA) Received on Mon Feb 18 2002 - 14:01:46 CET

Original text of this message