0% found this document useful (0 votes)
21 views11 pages

Hot - Cloning - 19C (CDB) - 119

The document outlines the process of hot cloning an Oracle database, allowing the creation of a new database without shutting down the source database. It details prerequisites, server configurations, and step-by-step commands for preparing the source database, copying necessary files to the target server, and configuring the target database. The process concludes with opening the new database in resetlogs mode after recovery, marking the completion of hot cloning.

Uploaded by

shuvo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views11 pages

Hot - Cloning - 19C (CDB) - 119

The document outlines the process of hot cloning an Oracle database, allowing the creation of a new database without shutting down the source database. It details prerequisites, server configurations, and step-by-step commands for preparing the source database, copying necessary files to the target server, and configuring the target database. The process concludes with opening the new database in resetlogs mode after recovery, marking the completion of hot cloning.

Uploaded by

shuvo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Hot Cloning 19C (CDB)

What is Cloning?

In Oracle, cloning refers to the process of creating an identical copy of an


existing Oracle database or Oracle application environment. Cloning is widely used
for development, testing, backup, and disaster recovery purposes.

Hot Cloning:

Hot cloning enables the creation of a new database (PDB or non-CDB) from an
existing one without requiring the source database to be shut down or put into read-
only mode.

Prerequisites:

⚫ The Target server should have the oracle database installed (only software need
to be installed).
⚫ Make Database to archivelog mode.
⚫ Note the control file, logfile, datafile, pfile, archivelog location.
⚫ Take control file backup as trace file.

Server Details:

Required Source Server Target Server


IP 192.168.72.133 192.168.72.136
Username oracle oracle
SID PROD BKP

In Source database:

⚫ Check the database in archivelog mode:


If not in Archivelog mode,

⚫ Restart the database in mount mode and execute,

⚫ Check for the locations of

➢ Control file,

Select name from v$controlfile;

➢ Logfile,

Select member from v$logfile;


➢ Datafile,
Select file_name from dba_data_files;

➢ Archive log,

Select name from v$archived_log;


➢ Pfile,

cd $ORACLE_HOME/dbs/initPROD.ora

➢ Pfile is not available create a pfile,


⚫ Create Backup Control File,

alter database backup controlfile to trace as


'/u01/apps/oracle/server/19.3/oradata/PROD/BKP_controlfile.sql';

⚫ Archive the current log using,

alter system archive log current;


⚫ Enable the database in backup mode,

alter database begin backup;

➢ Check if the backup is enabled by,

select distinct STATUS from v$backup;

⚫ Copy the files from the source to the target server using scp command.

Datafile:

⚫ Now End the backup Mode in the source database,

Alter database end Backup;

➢ Check the backup is ended,

Select distinct STATUS from v$backup;


⚫ Again archive the current log, then take a note of old log sequence number,

Alter system archive log current;

Archive log list;

⚫ Steps followed above:

i. Check archivelog list


ii. Archive the current log file
iii. Then, the log sequence will be changed.
iv. Give Begin backup command
v. Copy the datafiles to the target system
vi. Then END backup
vii. Again Archive the current log file
viii.Now, the archive log generated between 2nd and 7th step to be copied to the
target system.(11th LOG for ME).

Logfile:

Archivelog:
Copy Pfile:

⚫ In Target Server:

⚫ Now open (In Target Server) the pfile and make changes. Also, create audit file
manually.

PROD.__data_transfer_cache_size=0
PROD.__db_cache_size=1828716544
PROD.__inmemory_ext_roarea=0
PROD.__inmemory_ext_rwarea=0
PROD.__java_pool_size=0
PROD.__large_pool_size=16777216
PROD.__oracle_base='/u01/apps/oracle/server/19c'#ORACLE_BASE set from
environment
PROD.__pga_aggregate_target=838860800
PROD.__sga_target=2516582400
PROD.__shared_io_pool_size=134217728
PROD.__shared_pool_size=520093696
PROD.__streams_pool_size=0
PROD.__unified_pga_pool_size=0
*.audit_file_dest='/u01/apps/oracle/server/19c/admin/BKP/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/u01/apps/oracle/server/19c/oradata/BKP/control01.ctl','/u01/apps/
oracle/server/19c/oradata/BKP/control02.ctl'
*.db_block_size=8192
*.db_name='BKP'
*.diagnostic_dest='/u01/apps/oracle/server/19c'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=PRODXDB)'
*.local_listener='LISTENER_PROD'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=797m
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2389m
*.undo_tablespace='UNDOTBS1'
➢ Create adump directory,

➢ Rename the pfile the pfile with source to target DB name,

⚫ Modify the Control File in the Target server by creating a .sql and giving the
required command,

[oracle@oracle BKP]$ cat control_file.sql


CREATE CONTROLFILE SET DATABASE "BKP" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/u01/apps/oracle/server/19c/oradata/BKP/redo01.log' SIZE 50M
BLOCKSIZE 512,
GROUP 2 '/u01/apps/oracle/server/19c/oradata/BKP/redo02.log' SIZE 50M
BLOCKSIZE 512,
GROUP 3 '/u01/apps/oracle/server/19c/oradata/BKP/redo03.log' SIZE 50M
BLOCKSIZE 512
DATAFILE
'/u01/apps/oracle/server/19c/oradata/BKP/system01.dbf',
'/u01/apps/oracle/server/19c/oradata/BKP/sysaux01.dbf',
'/u01/apps/oracle/server/19c/oradata/BKP/undotbs01.dbf',
'/u01/apps/oracle/server/19c/oradata/BKP/users01.dbf'
CHARACTER SET AL32UTF8
;
➢ Start the Database in NOMOUNT and run the .sql control file script to create
Control files.

⚫ After creating the Control file, Perform Recovery by,

Recover database using backup controlfile until cancel,


⚫ Now, Open the database in resetlogs mode,

Alter database open resetlogs;

⚫ Check the Database Status,

--------HOT CLONING COMPLETED--------

You might also like