Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: control files and datafiles
This procedure is not for the faint of heart....understand every step in
here is written from memory, and the syntax and steps are logically complete
if not syntactically correct.
This can really screw up database A if you do anything wrong.
Be sure to get a good backup of database A before doing any of this.
From within database A:
alter database backup controlfile to trace;
This generates a .trc file in the user_dump_dest. (lets use xxx.trc for this example)
Shutdown database A and do a cold backup (Hot backup will do, but on Solaris you will not be able to bring B up w/o shutting A down first) of all the files to a new location. I will use /u01/oradata/a/data/system01.dbf to /u01/oradata/b/data/system01.dbf as an example.
Once all the files are (backedup) copied to the new locations, create a new
parameter file for database B. (make sure db_name=B and that the
control_files point to the coptrol files you just created by copying
database A's controlfiles.
Now remove the controlfiles that the initB.ora points to.
Edit the xxx.trc file and change all the filenames from the old to the
new. i.e. where /u01/oradata/a/data/system01.dbf is referenced to
/u01/oradata/b/data/system01.dbf.
Delete all the lines up until the 'startup nomount' stmnt.
Change:
Create controlfile use database "A"
To
Create controlfile set databse "B"
From within svrmgrl:
svrmgrl> connect / as sysdba
svrmgrl> @xxx.trc
This will create the control file and record all the 'new file names' for
the 'new database'.
Some recovery is done after the 'create controlfile' stmnt. review the
script carefully before running.
Good luck. This is a fairly simple procedure once you have become comfortable with it.
Carlo Di Mascio wrote in message <770k94$f7r$1_at_news.interlog.com>...
>Hi folks!
>
>I would like to copy database A to database B without doing an
>import/export. The import takes 36 hours. Is there a better way? As someone
>managed to re-create the control files and modify the header in the dbf
>files to use a different database name? There must be a way.
>
>
>Carlo Di Mascio
>dimasc_at_sprint.ca
>
>
>
Received on Thu Jan 07 1999 - 21:17:48 CST