Overview
Relocating a Pluggable Database (PDB) allows database administrators to migrate databases across different availability domains (ADs), regions, or container databases (CDBs) while ensuring minimal downtime. This guide explains the process using the dbaascli utility in Oracle Cloud Infrastructure (OCI).
Use Cases for PDB Relocation
- Migrating across ADs or Regions: Enhance fault tolerance or optimize performance.
- Transitioning to a Different Cluster or CDB: Consolidation, scaling, or maintenance.
- Maintaining High Availability: Redirect connections with minimal disruption.
How PDB Relocation Works
- The target PDB sets an implicit end SCN marker and completes media recovery.
- Active session draining occurs on the source PDB.
- PDB services register with the listener on the target CDB.
- The source PDB is closed.
- The target PDB opens in read/write mode.
- Connections point to the target CDB, with application connection strings updated if required.
Steps to Relocate a PDB Using dbaascli
Step 1: Check Connectivity
Verify connectivity from the target host to the source using the following command:
sqlplus sys@10.10.10.10:1521/cdb_database_servicename as sysdba
Step 2: Run the Relocation Command
Execute the following command on the target server for non-production databases:
dbaascli pdb relocate --pdbName P_BMCPLC_DV1 \
--dbname aeac003n \
--sourceDBConnectionString 10.10.10.10:1521/cdb_database_servicename \
--waitForCompletion false
Step 3: Generate Standby Files
Generate a blob file for standby database creation:
dbaascli pdb relocate --pdbName P_DEEDS_1 \
--dbname new_cdbname \
--sourceDBConnectionString 10.10.10.10:1521/cdb_database_servicename \
--blobLocation /tmp/P_DEEDS_1 \
--waitForCompletion false
Step 4: Relocate to Standby Host
Transfer the blob file and run this command on the standby host:
dbaascli pdb relocate --pdbName P_DEEDS_1 \
--dbname new_cdbname \
--sourceDBConnectionString 10.10.10.10:1521/cdb_database_servicename \
--standbyBlobFromPrimary /tmp/P_DEEDS_1/xxx.tar \
--waitForCompletion false
Post-Relocation Steps
- Update application connection strings if necessary.
- Verify the database state on the target CDB.
- Test application connectivity to the relocated PDB.
Leave a comment