Re: Need help copying one oracle instance into another in Unix
Date: 21 Jun 2002 06:15:57 GMT
Message-ID: <3d12c49d$7_at_usenetgateway.com>
You can follow these steps to clone a database. This is much faster than dropping and recreating a database and doing a full import, but it is more restrictive. You cannot, for instance, clone a 7.3 database into an 8.1.5, or clone an intance onto another server running a different os, nor can you cahnge anything like the block size. If the clone is to reside on the same server, it should be given a different sid. The following steps were using to create a clone with a different sid ON THE SAME SERVER, and the target instance does not yet exist.
On the source database:
- Edit /etc/oratab and add a new entry for target sid.
- Alter database backup controlfile to trace. Find the output and rename the file to something meaningful with a .sql extension. The file will most likely be in $ORACLE_BASE/admin/<sid>/udump if the database follows OFA standards.
- Shutdown the source database and DO NOT BRING IT BACK UP UNTIL THE END.
- Copy all of the datafiles, the redo logs, and the trace file from step one to the target area.
- Edit the trace file. · Take out all of the garbage at the top · Change the ‘create controlfile reuse database’ to ‘create controlfile set database’ · Change sid from source sid name to target sid name · Change ‘noreset’ to ‘resetlogs’ · Change the path names of the data files to reflect the new location of the target instance’s data files. · Comment out the ‘recover database’ command at the bottom.
On the target database
6. Change to the new instance with . oraenv 7. Startup the new database in a nomount state with svrmgrl 8. In server manager, run the controlfile script. 9. Issue ‘alter database open resetlogs’; 10. Bounce the instance normally to ensure that everything is ok.
Once the copy of the database has been made - the following change needs
to be made to its identity:
SVRMGR> connect internal select * from global_name;
GLOBAL_NAME
OLD_DB_NAME.WORLD 1 row selected.
SVRMGR> alter database rename global_name to NEW_DB_NAME.WORLD;
SVRMGR> select * from global_name;
GLOBAL_NAME
NEW_DB_NAME.WORLD 1 row selected.
Then restarted the instance. The DBID cannot be changed except by recreating the database, but this is not an issue for database links.
-- Posted via dBforums http://dbforums.comReceived on Fri Jun 21 2002 - 08:15:57 CEST