š Oracle RAC Multitenant Database Cloning in 19c is a game-changer for DBAs, enabling rapid provisioning of pluggable databases (PDBs) while maintaining high availability. Today, Iād like to share a step-by-step guide to achieve this efficiently. š”
š Use Case
Cloning a pluggable database (PDB) within an Oracle RAC environment is critical for creating development, testing, or troubleshooting copies of your production PDB.
š Prerequisites
1ļøā£ Oracle RAC setup with Oracle 19c multitenant architecture.
2ļøā£ Sufficient storage and permissions for the source and target databases.
3ļøā£ ARCHIVELOG mode enabled on the source container database (CDB).
4ļøā£ Source PDB in READ ONLY mode during cloning.
š ļø Step-by-Step Guide
Step 1: Connect to the Source CDB
Log in to the source CDB as a user with sufficient privileges.
sqlplus / as sysdba
Step 2: Put the Source PDB in Read-Only Mode
Before cloning, set the source PDB to READ ONLY mode to ensure consistency.
ALTER PLUGGABLE DATABASE source_pdb CLOSE IMMEDIATE;
ALTER PLUGGABLE DATABASE source_pdb OPEN READ ONLY;
Step 3: Initiate the Cloning Process
Run the following command to clone the PDB:
CREATE PLUGGABLE DATABASE clone_pdb FROM source_pdb
FILE_NAME_CONVERT = (‘/source/path/’, ‘/target/path/’);
š Use FILE_NAME_CONVERT to map the file paths for the source and target PDBs.
Step 4: Open the New PDB in Read/Write Mode
Once cloning is complete, open the new PDB in READ WRITE mode:
ALTER PLUGGABLE DATABASE clone_pdb OPEN READ WRITE;
Step 5: Update Services in Oracle RAC
Ensure the cloned PDB is registered with Oracle RAC services:
srvctl add service -d cdb_name -s service_name -pdb clone_pdb -preferred instance_name
srvctl start service -d cdb_name -s service_name
Step 6: Verify the Cloning
Log in to the cloned PDB and check its status:
SHOW PDBS;
SELECT NAME, OPEN_MODE FROM V$PDBS;
⨠Benefits of Multitenant Cloning
ā
Faster PDB provisioning.
ā
Ideal for test/dev environments.
ā
Reduced downtime with Oracle RAC high availability.