Database Cloning
- First of all I created the file hierarchy for datafiles and logfiles.
- Created a pfile of Old Database (Test).
CREATE PFILE=’C:\Init{NEW DATABASE}.ORA’ FROM SPFILE;
- Spool a datafile copy command from directory structure of Old Database to directory structure of New database.
- Generate trace file for creation of control files.
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
- Modify controlfilecreation script.
- Change REUSE with SET.
- Remove all lines above ‘Startup mount’.
- Remove all lines starting with ‘- -‘.
- Remove RECOVER DATABASE and ALTER SYSTEM ARCHIVE LOG ALL;
- Save script like C:\CreateDB.SQL.
- Modified the init{New Database}.ora with the new datafile,logfile, dumpfile flash recovery area destinations and new SID.
- Shutdown DB immediately.
- Copy data & redo files to new location. Don’t copy Temp.DBF and .CTL files
- Create service as:
oradim -NEW -SID NEWNAME -SRVC OracleServiceNEWNAME -STARTMODE manual -PFILE D:\oracle\product\10.2.0\db_1\database\initNEW DATABASE.ora.
- Register newly created service with LISTENER.
- Set servive varriable & connect to new database as SQLPLUS /nolog.
- Startup nomount;
Error: ORA-01081: cannot start already-running ORACLE – shut it down first.
Solution: Shutdown other oracle services.
- @CreateDB.sql;
- ALTER DATABASE OPEN RESETLOGS;
Leave a Comment