CLONING A DATABASE USING COLD BACKUP

ClONING A DATABASE USING COLD BACKUP IN SOLARIS AND LINUX ENVIRONMENT:

 

STEPS FOR COLD BACKUP:

Let’s consider running database name: COBRA
And New database name(clone of COBRA): COBRA_CLONE

1. Create a backup directory to store all database backup at OS level.
#mkdir -p /u01/oradata/cobra_clone
2. Export ORACLE_SID=COBRA
3. Sqlplus “/as sysdba”
4. Get datafile location using below query:

    Sql> select file_name from dba_data_files;
5. Sql>shu immediate;
6. Sql>exit

7. Now copy all datafiles and redo logs from oradata location(like:/u02/oradata/cobra) to backup location(like /u01/oradata/cobra_clone) at OS level.
8. After completion of copy startup the cobra database.

STEPS FOR CLONING  DATABASE:

8. Now create pfile for cobra_clone as ‘initcobra_clone.dbs’ using cobra pfile, making appropriate changes as required.

9. #Export ORACLE_SID=cobra_clone
10. # Sqlplus “/as sysdba” (it will connect to the idle instance cobra_clone).
11. sql>startup nomount pfile=’/export/home/oracle/product/10.2.0/db_1/dbs/initcobra_clone.ora’ ;

12. Below mentioned script will create the control file for the cobra_cold database.

Sql>CREATE CONTROLFILE REUSE SET DATABASE " cobra_cold " RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/oradata/ cobra_cold /redo01.log' SIZE 50M,
GROUP 2 '/u01/oradata/ cobra_cold /redo02.log' SIZE 50M,
GROUP 3 '/u01/oradata/ cobra_cold /redo03.log' SIZE 50M
— STANDBY LOGFILE
DATAFILE
'/u01/oradata/ cobra_cold /system01.dbf',
'/u01/oradata/ cobra_cold /undotbs01.dbf',
'/u01/oradata/ cobra_cold /sysaux01.dbf',
'/u01/oradata/ cobra_cold /users01.dbf'
CHARACTER SET WE8ISO8859P1
;

13. sql>alter database open resetlogs;
14. sql>alter tablespace temp add tempfile /u01/oradata/ cobra_cold /temp01.dbf size 200m reuse;
15. sql>alter user system identified by test123;
16. sql>alter user sys identified by test123;
 

 

You can skip to the end and leave a response. Pinging is currently not allowed.

Leave a Reply