You are on page 1of 5

Oracle 8i Cloning Page 1 of 5

CLONING Oracle 8i Database

CLONING ORACLE 8I DATABASE..............................................................................1


CLONING FROM COLD BACKUP...............................................................................2
STEPS.................................................................................................................................2
On Source...................................................................................................................2
On Destination............................................................................................................2
CLONING FROM HOT BACKUP.................................................................................4
STEPS.................................................................................................................................4
On Source...................................................................................................................4
On Destination............................................................................................................4

2459646.doc Created on 26/06/2001 16:47:00


Oracle 8i Cloning Page 2 of 5

Cloning from Cold Backup

Steps
On Source

1. $ sqlplus “/as sysdba”


2. SQL> alter database backup controlfile to trace;
3. Note: This command creates a script in udump
($ORACLE_BASE/admin/SID/udump) to recreate the control
file for source database. This script is the last file created in
udump (e.g. abc.trc)
4. $ mv abc.trc create_control.sql
5. SQL> shutdown immediate
6. Copy only the datafiles (or cold backup datafiles) to the new
location

On Destination

1. Create New Oracle User with dba group


2. Change/Create new .profile and run it
3. Create/change new initSID.ora file (under
$ORACLE_HOME/dbs) and make following changes:
a. db_name
b. control_files
c. cdump, bdump, udump
d. db_block_buffers/db_cache_size
4. Create all directories mentioned in initSID.ora
5. Delete all files from $ORACLE_HOME/admin/cdump bdump
and udump
6. Add an entry in /etc/oratab if the target is a new database.
7. Alter create_control.sql as follows:
e. Delete all components before “startup nomount”
f. Change “reuse” to “set”
g. Change source SID to destination SID
h. Change “noresetlogs” to “resetlogs”
i. Remove “recover database” command

2459646.doc Created on 26/06/2001 16:47:00


Oracle 8i Cloning Page 3 of 5

j. Change directories and names for redo logs and data


files
k. Change the last command to:
alter database open resetlogs
8. Make sure there are no log files and control files (delete if
exist)
9. sqlplus “/as sysdba”
10.SQL> @create_control
11.SQL> alter database rename global_name to <SID>;
12.Recreating Temporary Tablespace:
SQL> alter tablespace temp add tempfile
‘filename1’ reuse;
SQL> alter tablespace temp add tempfile
‘filename2’ reuse;
Or

SQL> drop tablespace temp;


SQL> create temporary tablespace temp
tempfile ‘filename1’ size 1800m
extent management local
uniform size 4m;
SQL> alter tablespace temp
add tempfile ‘filename2’ size 1800m;

2459646.doc Created on 26/06/2001 16:47:00


Oracle 8i Cloning Page 4 of 5

Cloning from Hot Backup

Steps
On Source

1. $ sqlplus “/as sysdba”


2. SQL> alter database backup controlfile to trace;
3. Note: This command creates a script in udump
($ORACLE_BASE/admin/SID/udump) to recreate the control
file for source database. This script is the last file created in
udump (e.g. abc.trc)
4. $ mv abc.trc create_control.sql
5. Copy Hotbackup files (datafiles and archive logs generated
during hot backup) to the new location

On Destination

1. Create New Oracle User with dba group


2. Change/Create new .profile and run it
3. Create/change new initSID.ora file (under
$ORACLE_HOME/dbs) and make following changes:
l. db_name
m. control_files
n. cdump, bdump, udump
o. db_block_buffers/db_cache_size
p. new destination of archive logs
4. Create all directories mentioned in initSID.ora
5. Delete all files from $ORACLE_HOME/admin/cdump, bdump
and udump
6. Add an entry in /etc/oratab if the target is a new database.
7. Alter create_control.sql as follows:
a. Delete all components before “startup nomount”
b. Change “reuse” to “set”
c. Change source SID to destination SID
d. Change “noresetlogs” to “resetlogs”
e. Keep archivelog option

2459646.doc Created on 26/06/2001 16:47:00


Oracle 8i Cloning Page 5 of 5

f. Change directories and names for redo logs and data files
g. Delete everything after line containing Character Set
7. Make sure there are no log files and control files (delete if
exist)
8. sqlplus “/as sysdba”
9. SQL> @create_control
10.SQL> recover database using backup controlfile until
cancel;
Type cancel when all available logs have been applied.
11.SQL> alter database open resetlogs;
12.SQL> alter database rename global_name to <SID>;
13.SQL> shutdown immediate
14.For switching off archiving:
a. SQL> startup mount
b. SQL> alter database noarchivelog;
c. SQL> alter database open;
d. Comment out following in initSID.ora file
i. log_archive_start
ii. log_archive_format
iii. log_archive_dest_1
15.Recreating Temporary Tablespace:
SQL> alter tablespace temp add tempfile
‘filename1’ reuse;
SQL> alter tablespace temp add tempfile
‘filename2’ reuse;
Or

SQL> drop tablespace temp;


SQL> create temporary tablespace temp
tempfile ‘filename1’ size 1800m
extent management local
uniform size 4m;
SQL> alter tablespace temp
add tempfile ‘filename2’ size 1800m;

2459646.doc Created on 26/06/2001 16:47:00

You might also like