ORACLE DATABSE CLONING USING COLD BACKUP

DESCRIPTION:

The Cold database backup is, while taking backup or doing cloning, we need to shutdown the source database. This method is usually used for test server when database is in no archive log mode.

First we want to take a backup of control file, note down the data file location, and finally shut down the database in source database side.

Second. Transfer the data file, temp file to target database, create a pfile(init.ora) for target database.

Then start the target database in no mount stage, then in there recreate a control file, then open the database in reset logs.

Send the datafile,log files and control files to target destination:

[oracle@oracle trainee]$ scp -r *.log oracle@192.168.1.122:/u01/shan

The authenticity of host ‘192.168.1.122 (192.168.1.122)’ can’t be established.

RSA key fingerprint is 9b:35:ae:ab:bf:6b:33:b4:43:86:f5:98:8b:bb:11:1c.

Are you sure you want to continue connecting (yes/no)? oracle

Please type ‘yes’ or ‘no’: yes

oracle@192.168.1.122’s password:

redo01.log                     100%  200MB   3.1MB/s   01:05

redo02.log                     100%  200MB   4.0MB/s   00:50

redo03.log                     100%  200MB   3.5MB/s   00:58

[oracle@oracle trainee]$ scp -r users01.dbf oracle@192.168.1.122:/u01/shan

oracle@192.168.1.122’s password:

users01.dbf                  100% 5128KB   5.0MB/s   00:01

[oracle@oracle trainee]$ scp -r undotbs01.dbf oracle@192.168.1.122:/u01/shan

oracle@192.168.1.122’s password:

undotbs01.dbf               100%   70MB   3.7MB/s   00:19

[oracle@oracle trainee]$ scp -r temp01.dbf oracle@192.168.1.122:/u01/shan

oracle@192.168.1.122’s password:

temp01.dbf                100%   32MB   2.9MB/s   00:11

[oracle@oracle trainee]$ scp -r system01.dbf oracle@192.168.1.122:/u01/shan

oracle@192.168.1.122’s password:

system01.dbf             100%  810MB   3.0MB/s   04:31

[oracle@oracle trainee]$ scp -r sysaux01.dbf oracle@192.168.1.122:/u01/shan

oracle@192.168.1.122’s password:

sysaux01.dbf            100%  490MB   3.2MB/s   02:34

[oracle@oracle u01]$ scp -r ctrl.sql oracle@192.168.1.122:/u01/shan

oracle@192.168.1.122’s password:

ctrl.sql               100% 5865     5.7KB/s   00:00

Now all the files are in the target destination.

[oracle@oracle shan]$ ls

ctrl.sql         redo01.log  redo03.log    system01.dbf  undotbs01.dbf

initoracle.ora  redo02.log  sysaux01.dbf  temp01.dbf    users01.dbf

Edit the control file

[oracle@oracle shan]$ vi ctrl.sql

CREATE CONTROLFILE SET  DATABASE “trainee” RESETLOGS ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 ‘/u01/shan/redo01.log’  SIZE 200M BLOCKSIZE 512,

GROUP 2 ‘/u01/shan/redo02.log’  SIZE 200M BLOCKSIZE 512,

GROUP 3 ‘/u01/shan/redo03.log’  SIZE 200M BLOCKSIZE 512

DATAFILE

‘/u01/shan/system01.dbf’,

‘/u01/shan/sysaux01.dbf’,

‘/u01/ram/undotbs01.dbf’,

‘/u01/ram/users01.dbf’

CHARACTER SET AL32UTF8

Edit the PFILE

[oracle@oracle shan]$ vi initoracle.ora

db_name=trainee

control_files=’/u01/shan/ctrl.ctl’

Now open the database.

[oracle@oracle shan]$ export ORACLE_SID=trainee

[oracle@oracle shan]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Mon Nov 1501:20:35 2020

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup pfile=’/u01/shan/inittarinee.ora’ nomount

ORACLE instance started.

Total System Global Area  243269632 bytes

Fixed Size                  8619256 bytes

Variable Size             180357896 bytes

Database Buffers           50331648 bytes

Redo Buffers                3960832 bytes

SQL> @ctrl.sql

Control file created.

SQL> alter database open resetlogs;

Database altered.

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE

——    ————-

TRAINEE      READ WRITE

Recent Posts

Start typing and press Enter to search