Managing CDB Fleet in Oracle Database 18c

Managing CDB Fleet in Oracle Database 18c

Oracle Database 18c introduces the CDB fleet concept which is a collection of different CDBs that can be managed as one logical CDB.

This feature is currently restricted to Enterprise Edition on Engineered Systems, like Exadata, and Enterprise Edition on Oracle Database Cloud Services.

There are two possible roles in a fleet: LEAD_CDB and MEMBER_CDB. The LEAD_CDB can be defined by setting the LEAD_CDB property as “TRUE”. All other CDBs in the fleet would act as MEMBER_CDBs.

In the example below have two CDBs and PDBs in it.

cdbvert011: Container database with pluggables databases PDBDP, PDBDW, PDBMV, PDBSWD and PDBADDADOS. This will be the fleet lead.
cdbhor011: Container database with pluggable database PDBWEBDW1.

 

Pluggables Databases in Container Database cdbvert011 :


$ export ORACLE_SID=cdbvert011
$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Wed May 27 08:36:16 2020
Version 18.2.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.2.0.0.0

sql> show pdbs;

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBDP READ WRITE NO
4 PDBDW READ WRITE NO
5 PDBMV READ WRITE NO
6 PDBSWD READ WRITE NO
7 PDBADDADOS READ WRITE NO

 

Pluggable Database in Container Database cdbhor011:


$ export ORACLE_SID=cdbhor011
$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Wed May 27 08:36:16 2020
Version 18.2.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.2.0.0.0

sql> show pdbs;

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBWEBDW1 READ WRITE NO


 

Configure CDBVERT011 as LEAD CDB:


sql> select property_value from database_properties where property_name='LEAD_CDB';

no rows selected

sql> alter database set lead_cdb=TRUE;

Database altered.

sql> select property_value from database_properties where property_name='LEAD_CDB';

PROPERTY_VALUE
------------------------------
TRUE

 

Grant the appropriate privileges to the common user in the CDB lead:


sql> grant sysoper to system CONTAINER=ALL;

Grant succeeded.

 

Create the database link and set as member of the fleet:


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.2.0.0.0

sql> select property_value from database_properties where property_name='LEAD_CDB_URI';

no rows selected

sql> create database link dblink_lead connect to system identified by password using 'CDBVERT011';

Database link created.

sql> alter database set LEAD_CDB_URI='dblink:dblink_lead';

Database altered.

sql> select property_value from database_properties where property_name='LEAD_CDB_URI';

PROPERTY_VALUE
--------------------------------------------------------------------------------
dblink:dblink_lead


 

Connect on CDBVERT011 and list all PDBs. The STUB value in the STATUS column defines the CDB and its PDBs as members in the fleet. After you configure the CDB fleet, PDB information from the various CDB members including the CDB member is synchronized with the lead CDB.


$ export ORACLE_SID=cdbvert011
$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Wed May 27 08:36:16 2020
Version 18.2.0.0.0

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.2.0.0.0

sql> show pdbs;

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBDP READ WRITE NO
4 PDBDW READ WRITE NO
5 PDBMV READ WRITE NO
6 PDBSWD READ WRITE NO
7 PDBADDADOS READ WRITE NO
9 PDBWEBDW1 MOUNTED

sql> select pdb_id, pdb_name, status, is_proxy_pdb from dba_pdbs;

PDB_ID PDB_NAME STATUS IS_PROXY_
------- -------- ------ ----------
3 PDBDP NORMAL NO
2 PDB$SEED NORMAL NO
4 PDBDW NORMAL NO
5 PDBMV NORMAL NO
6 PDBSWD NORMAL NO
7 PDBADDADOS NORMAL NO
8 CDBHOR011 STUB YES
9 PDBWEBDW1 STUB YES

8 rows selected.

Disable the CDB Lead:


sql> ALTER DATABASE SET LEAD_CDB = false;
Database altered. 

sql> select pdb_id, pdb_name, status, is_proxy_pdb from dba_pdbs;

PDB_ID PDB_NAME STATUS IS_PROXY_
------- -------- ------ ----------
3 PDBDP NORMAL NO
2 PDB$SEED NORMAL NO
4 PDBDW NORMAL NO
5 PDBMV NORMAL NO
6 PDBSWD NORMAL NO
7 PDBADDADOS NORMAL NO

6 rows selected.

Disable the CDB Member:


sql> alter database set lead_cdb_uri='';

Database altered.

sql> select pdb_id, pdb_name, status, is_proxy_pdb from dba_pdbs;

PDB_ID PDB_NAME STATUS IS_PROXY_
------- -------- ------ ----------
3 PDBWEBDW1 NORMAL NO
2 PDB$SEED NORMAL NO

sql> drop database link dblink_lead;

Database link dropped.

 

References

Administering a CDB Fleet. Available at https://docs.oracle.com/en/database/oracle/oracle-database/18/multi/administering-cdb-fleet.html#GUID-0AA7FC65-F350-473B-96D2-976313514069