Cloning Database
Cloning Database
Cloning Database
CLONING DATABASE...................................................................................................I
Pre clone steps.....................................................................................................................II
Think of Database name......................................................................................................II
Create respective filesystem as same as previous one........................................................II
Copy all dbf files to cloned location..................................................................................III
Create initialization parameter file.....................................................................................III
Create Environmental file..................................................................................................III
Run Clonedb.sql script ......................................................................................................III
Obervations after installation..............................................................................................V
Problems faced....................................................................................................................V
I
Pre clone steps
Log in to database to which you need to clone and startup the database.
Command:
Sqlplus ‘/as sysdba’
Startup
Command:
Alter database backup controlfile to trace;
Cd /u01/oracle9i/admin/db01/
Cp db01_ora_24633.trc /u01/oracle9i/clonedb.sql
Edit clonedb.sql with option RESETLOGS as cloned database name is different from
original one.
Oracle_Sid = clonedb
Oracle9i
Admin Oradata
Command:
Mkdir clonedb
Mkdir bdump
Mkdir cdump
Mkdir udump
II
Copy all dbf files to cloned location
Command:
Cd /u01/oracle9i/oradata/db01/
Cp *.dbf /u01/oracle9i/oradata/clonedb/
See that all destinations of database files are changes in clonedb.sql script.
Command:
Cp initdb01.ora initclonedb.ora
Vi initclonedb.ora
%s/db01/clonedb/g
Su – oracle9i
Vi clonedb.env
export ORACLE_BASE=/u01/oracle9i
export ORACLE_HOME=$ORACLE_BASE/product
export ORACLE_SID=clonedb
export LD_ASSUME_KERNEL=2.4.19
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
export
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
umask 022
III
MAXLOGFILES 50
MAXLOGMEMBERS 5
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 226
LOGFILE
GROUP 1 '/u01/oracle9i/oradata/clonedb/redo01.log' SIZE
100M,
GROUP 2 '/u01/oracle9i/oradata/clonedb/redo02.log' SIZE
100M,
GROUP 3 '/u01/oracle9i/oradata/clonedb/redo03.log' SIZE
100M
-- STANDBY LOGFILE
DATAFILE
'/u01/oracle9i/oradata/clonedb/system01.dbf',
'/u01/oracle9i/oradata/clonedb/undotbs01.dbf',
'/u01/oracle9i/oradata/clonedb/cwmlite01.dbf',
'/u01/oracle9i/oradata/clonedb/drsys01.dbf',
'/u01/oracle9i/oradata/clonedb/example01.dbf',
'/u01/oracle9i/oradata/clonedb/indx01.dbf',
'/u01/oracle9i/oradata/clonedb/odm01.dbf',
'/u01/oracle9i/oradata/clonedb/tools01.dbf',
'/u01/oracle9i/oradata/clonedb/users01.dbf',
'/u01/oracle9i/oradata/clonedb/xdb01.dbf'
CHARACTER SET WE8ISO8859P1
;
Login as SYSDBA
Command:
Sqlplus ‘/as sysdba’
Command:
Startup nomount
Command:
@Clonedb.sql
Controlfile created.
IV
'/u01/oracle9i/oradata/clonedb/temp01.dbf' SIZE
41943040 REUSE AUTOEXTEND ON NEXT 655360
MAXSIZE 32767M;
Tablespace altered.
Problems faced
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: controlfile could not be created
ORA-00202: controlfile: '/u01/oracle9i/oradata/clonedb/control01.ctl'
ORA-27038: skgfrcre: file exists
SQL> @clonedb01.sql
SP2-0734: unknown command beginning "need to re..." - rest of line ignored.
SP2-0158: unknown SET option "#1."
SP2-0734: unknown command beginning "The follow..." - rest of line ignored.
SP2-0734: unknown command beginning "to open th..." - rest of line ignored.
SP2-0734: unknown command beginning "Data used ..." - rest of line ignored.
SP2-0734: unknown command beginning "be require..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
SP2-0734: unknown command beginning "only if th..." - rest of line ignored.
V
CREATE CONTROLFILE SET DATABASE "CLONEDB" NORESETLOGS
NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-01223: RESETLOGS must be specified to set a new database name
VI