0% found this document useful (0 votes)
12 views2 pages

Oracle Cloning Concepts Guide

Uploaded by

kaleem.prodba
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)
12 views2 pages

Oracle Cloning Concepts Guide

Uploaded by

kaleem.prodba
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

Oracle Database 19c Cloning Concepts – Complete

Theoretical and Practical Guide

■ 1. Overview of Database Cloning


Database cloning is the process of creating an exact copy of a source database. It is widely used
for testing, development, UAT, patch testing, and troubleshooting environments. A clone can be
created using RMAN, Active Duplicate, Backup-based Duplicate, or by using Data Guard snapshot
standby or manual methods (cold or hot cloning).
■ 2. Types of Cloning
1 RMAN Active Database Duplicate (No Backup Required)
2 RMAN Backup-Based Duplicate (Uses Existing Backup)
3 Manual Cold Backup Clone (Database Shutdown, File Copy)
4 Manual Hot Backup Clone (Using BEGIN/END BACKUP Mode)
5 Datapump Export/Import Clone (Logical Copy)
6 Snapshot Standby Clone (Temporary Writable Standby)
■ 3. RMAN Active Database Duplicate (Without Backup)
Active duplicate uses network connectivity to copy datafiles directly from the source (primary) to the
target (clone). No backup is required. Ideal for creating test/UAT environments quickly.
■ Example – Active Duplicate Database
-- On Target (Clone) Server rman target sys/@source auxiliary sys/@clone RMAN>
DUPLICATE TARGET DATABASE TO CLONE_DB FROM ACTIVE DATABASE SPFILE
PARAMETER_VALUE_CONVERT ('SOURCE','CLONE') SET DB_FILE_NAME_CONVERT
('/u01/app/oracle/oradata/SOURCE','/u01/app/oracle/oradata/CLONE') SET
LOG_FILE_NAME_CONVERT
('/u01/app/oracle/oradata/SOURCE','/u01/app/oracle/oradata/CLONE')
NOFILENAMECHECK;
■ 4. RMAN Backup-Based Duplicate
This method uses pre-existing RMAN backups of the source database to create the clone. Backup
pieces can be local or restored from catalog.
■ Example – Backup-Based Duplicate
-- On Target Server rman target sys/@source auxiliary sys/@clone RMAN> DUPLICATE
TARGET DATABASE TO CLONE_DB BACKUP LOCATION '/rman_backup/SOURCE' SPFILE
NOFILENAMECHECK;
■ 5. Manual Cold Backup Clone
Involves shutting down the source database and copying its physical files to the target.
Recommended for non-critical databases.
■ Example Steps:
SQL> SHUTDOWN IMMEDIATE; -- Copy datafiles, control files, redo logs to clone
server -- Modify init.ora and create a new control file if required SQL> STARTUP
NOMOUNT PFILE='/tmp/initclone.ora'; SQL> CREATE CONTROLFILE SET DATABASE 'CLONE'
RESETLOGS FROM BACKUP CONTROLFILE; SQL> RECOVER DATABASE USING BACKUP CONTROLFILE
UNTIL CANCEL; SQL> ALTER DATABASE OPEN RESETLOGS;
■ 6. Manual Hot Backup Clone
Used when the source database must remain online. Datafiles are copied while in BEGIN/END
BACKUP mode, followed by archivelog recovery.
■ Example Steps:
SQL> ALTER DATABASE BEGIN BACKUP; -- Copy all datafiles to target location SQL>
ALTER DATABASE END BACKUP; -- Copy archive logs and control file SQL> ALTER
DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/control.sql'; -- On target,
recreate controlfile and recover
■ 7. Logical Clone using Datapump
Datapump clone is a logical copy of schema or full database. It’s platform-independent and ideal for
cross-version migrations.
■ Example:
expdp system/ FULL=Y DIRECTORY=dpump_dir DUMPFILE=fullclone.dmp
LOGFILE=exp_fullclone.log impdp system/ FULL=Y DIRECTORY=dpump_dir
DUMPFILE=fullclone.dmp LOGFILE=imp_fullclone.log REMAP_SCHEMA=PROD:DEV
REMAP_TABLESPACE=USERS:DEV_TS
■ 8. Snapshot Standby Clone
A physical standby can be temporarily converted to a snapshot standby for testing, then reverted to
physical standby for redo apply.
■ Example:
DGMGRL> CONVERT DATABASE 'STANDBY' TO SNAPSHOT STANDBY; -- Perform testing on
snapshot standby DGMGRL> CONVERT DATABASE 'STANDBY' TO PHYSICAL STANDBY;
■ 9. Real-Time Project Practical Considerations
1 Always ensure archive log shipping is paused or disabled during clone.
2 Rename directories, control files, and redo logs appropriately.
3 Register cloned DB in OEM or RMAN catalog separately.
4 Use parameter DB_NAME, DB_UNIQUE_NAME carefully in init.ora/spfile.
5 Change GLOBAL_NAME and recreate password file after clone.
■ 10. Important RMAN and SQL Keywords
DUPLICATE, FROM ACTIVE DATABASE, BACKUP LOCATION, NOFILENAMECHECK,
PARAMETER_VALUE_CONVERT, DB_FILE_NAME_CONVERT, SPFILE, RESETLOGS, NOMOUNT,
STARTUP, RECOVER, RESTORE CONTROLFILE, CREATE CONTROLFILE, UNTIL
TIME/SCN/SEQUENCE

■ End of Guide – Oracle Database 19c Cloning Concepts with


Practical Examples

You might also like