ibanes.com 
                        Home | DBA Tips | DBA Scripts | CV | Contact
News

Others

 

Clone a database

Procedure to copy or clone a database from one machine to another:
==================================================================

1. Make sure you have a backup (hot or cold) of your production database
and that the database is in ARCHIVE LOG mode. Also make sure all
archived logs are available since your last backup.

2. On your production database do an

SVRMGR> alter database backup controlfile to trace;

3. Edit the controlfile trace (in $ORACLE_BASE/admin/$ORACLE_SID>/udump)
and remove the lines until you get to the 'CREATE CONTROLFILE ..'
statement. Edit this stement to read:

CREATE CONTROLFILE SET DATABASE "new_db_name" RESETLOGS
ARCHIVELOG

4. Move this script to the new machine. Edit this script to
update the directories for the datafiles and redo log
files. Also comment out the lines for "RECOVER ..." and
"ALTER DATABASE OPEN ..."

5. Restore/ or copy the backup and the archived logs to the new
machine.

6. Copy your INIT.ORA file to the new machine. Ensure your controlfile and
archive destinations in ini$ORACLE_SID.ora (or config$ORACLE_SID.ora) are
set properly on the new machine.

7. Set your Oracle Environment by running ". oraenv" on Unix.

8. Start svrmgrl, run the create controlfile script.

9. Perform a database recovery using
SVRMGR> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;

You'll be prompted to supply an archived log file, Restore that file
to the archive log destination (if not already there) and continue.
Repeat for all archived files till you get to the last one. At that
point specify 'CANCEL'.

10. Issue the command
SVRMGR> ALTER DATABASE OPEN RESETLOGS;



Oracle Sites

» Oracle Base
» Ask Tom
» DBA Support
» DBA Click
» Dbazine
» SamOraTech
» OraFaq
» SearchDatabase
» Ixora
» DBA on Call
» VS Babu
» OraPub
» Oracle Advice
» Quest Pipelines
» Oracle Professionals
» Jeff Hunter's Site
Links
» The First Resource Repository

Hosted by www.Geocities.ws

1