Wednesday, April 28, 2021

Multitenant Part 4 : PDB Relocation

Multitenant Part 4 : PDB Relocation

Online PDB relocation,

PDB Relocation is the fastest way to move a PDB with minimal or nearer to no down time. Otherwise, plugging and unplugging PDBs require outage means downtime is required.








Target Database Server
  • Add tns entry of source database and create database link to connect to source database.
  • There should be a common user in Source Database
  • Grant privileges to common user i.e. create session and create pluggable database to all.
CREATE DATABASE LINK prod_link CONNECT TO c##clone_user IDENTIFIED BY  clone_user USING 'PROPDB1';

Once we are done with these prerequisites, only few commands need to run after that to complete the task.

On target database server run following command,

CREATE PLUGGABLE DATABASE PROPDB1 FROM PROPDB1@prod_link RELOCATE;

When you run this command, it executes a hot clone of source PDB from its original location to its target location. The source PDB copies data files, undo blocks, and redo blocks to the target PDB upto the SCN marked for it.

When this step completes, two transactional consistent copies of this PDB exist: one in the source CDB and one in the target CDB . during this operation, transaction continues uninterrupted on the source PDB. Users or applications connected to the source PDB are unaware that a relocation is happening behind the scene.

All existing application connections, and new connections created during this step, continue to connect to the source PDB.

When you issues ALTER PLUGGABLE DATABASE OPEN command
  • The target PDB implicitly sets the end SCN marker, and applies any redo or undo required to complete media recovery to satisfy the implicit end SCN marker.
  • When media recovery occurs on the target PDB, Oracle Database initiates active session draining on the source PDB.
  • PDB services are registered with the listener and are available on the target CDB.
  • The source PDB is closed.
  • The target PDB opens in read/write mode.
Relocation in Different Listener Networks

AVAILABILITY MAX
Here, at additional step, you need to reconfigure the original listener.
If a local listener redirects to a Single Client Access Name (SCAN) listener in an Oracle RAC configuration, thn you need to add parameter in each node listener file.
And parameter name is,
ALLOW_MULTIPLE_REDIRECTS_LISTENER_SCAN1=YES


I hope, this helps you to perform PDB relocation in very simple steps.




Thanks & Regards,
Chandan Tanwani
Oracle Performance Tuning Certified Expert

No comments: