PDB Remote Clone: Step-by-Step Guide and Best Practices
Database administrators often encounter scenarios where the need arises to clone a Pluggable Database (PDB) from a source to a target environment, especially when dealing with non-CDB to CDB migrations. One powerful method is the PDB Remote Clone, allowing for the creation of a PDB on a target Container Database (CDB) from a source PDB located on a different database.
In this guide, we will walk you through the detailed steps involved in performing a PDB Remote Clone, utilizing Oracle Database technology. Our focus will be on a non-CDB source database and a CDB target Exadata Cloud at Customer (ExaCC) database. Additionally, we’ll cover some post-clone steps and considerations to ensure a successful and secure clone operation.
Step 1: Prepare the Non-CDB Source Database
Start by creating a user on the non-CDB source database that will be used for the clone operation.
-- on non-CDB source database
CREATE USER remote_clone_user IDENTIFIED BY xxxx;
GRANT CREATE SESSION, CREATE PLUGGABLE DATABASE TO remote_clone_user;
Step 2: Set Up Database Link on CDB Target
To enable communication between the source and target databases, create a database link on the CDB target.
-- on CDB target ExaCC database
ALTER SESSION SET GLOBAL_NAMES = FALSE;
CREATE DATABASE LINK sourcedb
CONNECT TO remote_clone_user IDENTIFIED BY xxxx
USING '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = sourcedb.yourdomain.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = SOURCEDB)))';
-- Test the database link
SELECT * FROM dual@sourcedb;
Step 3: Initiate PDB Remote Clone
Initiate the PDB clone process on the CDB target, leveraging the database link.
-- on CDB target ExaCC database
CREATE PLUGGABLE DATABASE sourcedb_clone FROM sourcedb@sourcedb KEYSTORE IDENTIFIED BY "DBADEEDS" PARALLEL 8;
Refer to Oracle’s documentation on OCI for detailed steps when performing a hot clone with TDE from one Database Service (DBS) to another DBS using a database link (Doc ID 2623702.1).
Note: If the source database is an Active Data Guard, disable redo apply before running the CREATE PLUGGABLE DATABASE statement to avoid errors (Doc ID 2072550.1).
Step 4: Post-Clone Steps
After the PDB hot clone is complete, perform the following steps:
a. Open the Cloned PDB
ALTER PLUGGABLE DATABASE sourcedb_clone OPEN;
b. Check for PDB Violations
SELECT name, cause, type, message, status FROM PDB_PLUG_IN_VIOLATIONS WHERE type = 'ERROR' AND status 'RESOLVED';
c. Resolve PDB Violations (if any)
Address any violations reported in the previous step.
d. Encryption and TDE (Transparent Data Encryption)
Check encryption status on the source and clone databases:
-- Source database
SELECT wrl_parameter, status, wallet_type FROM v$encryption_wallet;
-- Clone database
ALTER SESSION SET CONTAINER = sourcedb_clone;
SELECT wrl_parameter, status, wallet_type FROM v$encryption_wallet;
-- Force keystore and backup (if needed)
ADMINISTER KEY MANAGEMENT SET KEY FORCE KEYSTORE IDENTIFIED BY xxxx WITH BACKUP;
e. Encrypt Tablespaces (if TDE is not enabled on the source)
SELECT tablespace_name, encrypted FROM dba_tablespaces;
ALTER DATABASE DATAFILE 'datafile_path' ENCRYPT;
After completing these steps, the PDB Remote Clone process is successfully executed, and the cloned PDB is ready for use.
By following these comprehensive steps, database administrators can ensure a smooth and secure PDB Remote Clone operation, minimizing potential issues and ensuring data integrity throughout the process. Always refer to Oracle’s official documentation and support notes for the latest recommendations and best practices.
Leave a comment