Create a refreshable PDB clone and switchover

From Robs_Wiki
Revision as of 10:54, 18 October 2020 by Qadmin wiki (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


From Oracle Database 12.2 onward it is possible to refresh the contents of a remotely hot cloned PDB provided it is created as a refreshable PDB and has only ever been opened in read only mode. From 18c onwards it is also possible to switchover to the refreshable PDB, which basically means a role reversal between the source PDB and the refreshable PDB.

Create a Refreshable PDB

Step 1: In orcl: create a common user in the source database orcl with the required privileges:

SQL> create user c##refresh identified by refresh;

SQL> grant dba, create pluggable database to c##refresh container=all;

Step 2: create a database link in the container database which hosts the Source PDB:

SQL> create public database link link_orcl connect to c##refresh identified by refresh using 'orcl';

Database link created.

SQL> select * from dual@link_orcl;


Step 3: create pluggable database pdb2_refreshed

SQL> create pluggable database pdb2_ro from pdb2@link_orcl refresh mode every 5 minutes;

Pluggable database created.

SQL> select pdb_name, status from cdb_pdbs;

PDB_NAME             STATUS
-------------------- ----------
PDB$SEED             NORMAL
ROBPDB1              NEW
PDB2_RO              REFRESHING

Switchover to the refreshable PDB