Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Duplicating a Database and Changig SID
This
is not real pretty as text, if you want a MS Word copy, send me your e-mail. <A
href="mailto:ronwy_at_swbell.net">ronwy_at_swbell.net
<FONT face=Arial color=#0000ff
size=2>
The purpose of this document is to define the process and commands necessary to duplicate (clone) an existing database and alter its Database Identifier (DBID). There are two separate approaches, one with standard file systems and the other utilizing a BCV split.
Standard File System Procedures
1. Connect to the database as "internal"
2. Issue "alter database backup controlfile to trace resetlogs". (This file will be
located in the user_dump_dest defined in the init<sid>.ora file and will be called
"ora_nnnn.trc".)
3. sql> select name, dbid from v$database; (Use this for later reference). 4. Shutdown the database using "shutdown normal" 5. Copy the database (dbf) files to the file system(s) for the new database. (for alist of all the files, look at the trace file generated in step 2) 6. Copy the redo log files to the file system(s) for the new database. 7. Copy and rename the init<sid> file to init<newsid> to the new database file structure.
a. Update SERVICE_NAMES, DB_NAME, and INSTANCE_NAME to the new SID. b. Change the CONTROL_FILES to point to the correct path. c. Change the USER_DUMP_DEST, LOG_ARCHIVE_DEST, CORE_DUMP_DEST, andBACKGROUND_DUMP_DEST, UTL_FILE_DIR to the new file system paths. 12. Create a password file for the new database with the "orapwd" command. 13. Create a link from $ORACLE_HOME/dbs/init<newsid>.ora to $ORACLE_BASE/admin/<newsid>/pfile/init<newsid>.ora using "ln -s <src> <link> syntax.
14. Change to the directory where the control file script from step (10-d) is located. 15. export ORACLE_SID=<new sid> 16. Use sqlplus to connect internal a. sql> startup nomount
d. sql> shutdown normal e. sql> startup mount; f. sql> exec dbms_backup_restore.zeroDbid(0); g. sql> shutdown normal;
a. sql> startup nomount; b. sql> @cr_cfile.sql c. sql> select name, dbid from v$database. (There should be the new name, and newdbid)
18. Add an entry in tnsnames.ora for the new database. 19. Register the new database with RMAN and request a full backup (level 0). 20. Add an appropriate entry in the "oratab" file.Received on Fri Nov 30 2001 - 11:16:48 CST
![]() |
![]() |