You are on page 1of 2

Clone database from one machine to another - Oracle FAQ Page 1 of 2

BigOWLIM 3.4: fast & rich Oracle Tutorials Online


Geo-spatial index, OWL 2 RL and QL Jena Learn More about Oracle Today. Database
integration, FTS and RDF Rank News and Tips from SSWUG.
ontotext.com/owlim/change_log.html www.SSWUG.org

Clone database from one machine to another


From Oracle FAQ

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

s
■ If your database is not in ARCHIVE LOG mode, take an off-line database backup. If in
ARCHIVELOG MODE, you can either take an on-line or off-line database backup.

iri
■ On your production database, start SQL*Plus and connect to "SYS AS SYSDBA" (internal) and do a:

w
SQL> alter database backup controlfile to trace;

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

CREATE CONTROLFILE SET DATABASE "new_db_name" RESETLOGS


ARCHIVELOG
h

■ 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 ..."
ep

■ Restore/ or copy the backup and the archived logs (if any) to the new machine.

■ Copy your INIT.ORA file to the new machine. Ensure your controlfile and archive destinations in your
SPFILE/ ini$ORACLE_SID.ora are properly set on the new machine.
s

■ Set your Oracle Environment by running ". oraenv" on Unix or Linux.


Jo

■ Start sqlplus, connect SYS AS SYSDBA (internal) and run the create controlfile script.

■ Perform a database recovery using

SQL> 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'.

■ Issue the command:

SQL> ALTER DATABASE OPEN RESETLOGS;

http://www.orafaq.com/wiki/Clone_database_from_one_machine_to_another 31/01/2011
PDF created with pdfFactory Pro trial version www.pdffactory.com
Clone database from one machine to another - Oracle FAQ Page 2 of 2

■ Change the global name of the new database to avoid problems with networked applicationa and
replication:

SQL> ALTER DATABASE RENAME GLOBAL_NAME = new_db_name;

■ Include the new database into your backup strategy.

You're all done.

Retrieved from "http://www.orafaq.com/wiki/Clone_database_from_one_machine_to_another"


Category: Database administration

■ This page was last modified on 25 December 2007, at 19:19.

s
.:: Wiki Home :: Blogger Home :: Forum Home :: Contact :: Privacy ::.

iri
w
Sa
h
s ep
Jo

http://www.orafaq.com/wiki/Clone_database_from_one_machine_to_another 31/01/2011
PDF created with pdfFactory Pro trial version www.pdffactory.com

You might also like