Clone an Oracle Database without RMAN

Convertir en PDF Version imprimable Suggérer par mail
Écrit par Sidibe   

Clone an Oracle Database

 

Description :

 

We need to duplicate a database on the same machine or our database is too big to use Export/Import !

 

We give here an easiest way to do it.

 

Assume the original database is called ORCL1 and we want to duplicate it as ORCL2.

 

How to :

 

- Find some disk space and create appropriate directories or file systems (conforming to the OFA guidelines) for the datafiles of your cloned database.

- Connect to the ORCL1 instance and dump the controlfile using the SQL command

·         ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

This will put a text copy of the controlfile in the USER_DUMP_DEST

- Shutdown Normal ORCL1 database

- Perform an operating system copy of ORCL1 to the new location where ORCL2 will reside. You can also use a hot backup method if you are in archivelog mode.

- Startup the ORCL1 instance

- Edit the controlfile you created and change all the path names of the database to the new location.

- Set your environment to the ORCL2 instance and run Server Manager (svrmgrl)

CONNECT / as sysdba  -- or internal for old Oracle version

STARTUP NOMOUNT

CREATE CONTROLFILE REUSE

SET  DATABASE "ORCL2" RESETLOGS NOARCHIVELOG

MAXLOGFILES 32

MAXLOGMEMBERS 2

MAXDATAFILES 64

MAXINSTANCES 8

MAXLOGHISTORY 800

LOGFILE

GROUP 1 '/oracle/data/ORCL2/redos/log1ORCL2.dbf' SIZE 512K,

GROUP 2 '/oracle/data/ORCL2/redos/log2ORCL2.dbf' SIZE 512K,

GROUP 3 '/oracle/data/ORCL2/redos/log3ORCL2.dbf' SIZE 512K,

GROUP 4 '/oracle/data/ORCL2/redos/log4ORCL2.dbf' SIZE 512K

 

DATAFILE

'/oracle/data/ORCL2/system_ts/systORCL2.dbf' SIZE 25M,

'/oracle/data/ORCL2/data_ts/data_ORCL2.dbf' SIZE 230M,

'/oracle/data/ORCL2/index_ts/index_ORCL2.dbf' SIZE 230M,

'/oracle/data/ORCL2/rbs_ts/rbs_ORCL2.dbf' SIZE 10M,

'/oracle/data/ORCL2/temp_ts/temp_ORCL2.dbf' SIZE 10M,

'/oracle/data/ORCL2/tools_ts/ts_tools_ORCL2_02.dbf' SIZE 15M,

'/oracle/data/ORCL2/users_ts/ts_users_ORCL2.dbf' SIZE 1M,

;

ALTER DATABASE OPEN RESETLOGS;

- That's it, an exact duplicate of ORCL1 and a painless procedure.