I want to make a copy of an Oracle 8i (8.1.6 Release 2) database named ORCL on another PC with the same name (ORCL). Both PCs are running Windows NT.
This is my logic: Install the Oracle 8i software on the target PC. Then create an instance on the target PC using oradim with the new option. Next, create the same directory (folder) structure on the target PC as on the source PC. Then shutdown the ORCL database on the source PC and take an offline (cold) backup of all datafiles, control files, redo log, archived logs, initialization and password files. Then copy the files from the cold backup to the target PC in the same directories as the source PC. Then start up the new instance on the target PC using oradim with the startup option. Next, set the variable ORALCE_SID = ORCL. Then connect as SQL*PLUS.
Is this the correct process? Am I missing any steps? I am a new DBA so I thought I would ask you some questions before I try this. Thanks.
You've got the basic idea but here's what you should do specifically. Since you want a duplicate of your original database, you will be copying the data and log files from the primary db to new location (make sure your primary db is shutdown at the time in order to insure consistency). But before you can do the copy, you need to create a backup control file of your primary db.
- Use the alter database backup controlfile to trace command on the primary database to create a create controlfile script.
- Shutdown the primary database.
- Copy the data and log files over the secondary database. Then you could restart the primary if you wanted.
- Next, edit the create control file statement generated prior (in step 1). You'll change the paths to the data and log files.
- Use sqlplus or svrmgrl to run that create control file script to recreate the control files for this "copied" instance.
Note that you could use export/import as well. Particularly the transportable tablespace option. To read more about this, see the Oracle Administrator's guide and the Oracle Utilites guide.
For More Information
- Dozens more answers to tough Oracle questions from Karen Morton are available.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.
Dig Deeper on Oracle database export, import and migration
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.