A lead CDB is the central location for monitoring and managing the CDBs in the fleet. A CDB fleet provides the database infrastructure for scalability and centralized management of many CDBs.

Designate one CDB in the fleet to be the lead CDB by setting its LEAD_CDB database property to TRUE. The other CDBs in the fleet point to the lead CDB by setting the LEAD_CDB_URI database property. After you configure the CDB fleet, PDB information from the various CDBs is synchronized with the lead CDB. All PDBs in the CDBs are now “visible” in the lead CDB, enabling you to access the PDBs in the fleet as a single, logical CDB from the lead CDB.

The following figure shows a CDB fleet consisting of CDB1, CDB2, and CDB3. The lead CDB is CDB1. CDB2_hrpdb, which resides in CDB2, is visible in CDB1. CDB3_hrpdb, which resides in CDB3, is also visible in CDB1.

 


Image Source

In this example, we are using 2 CDBs

CDB PDBs
CDB18C PDB$SEED
PDB18C1
PDB18C2
PDB18CSNAP
CDBNEW PDB$SEED
PDB18CFLEET

Setting the Lead CDB in a CDB Fleet

Login to CDB18C and make it as LEAD CDB.

SQL> select name from v$database;

NAME
---------
CDB18C

SQL> SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='LEAD_CDB';

no rows selected

SQL> ALTER SESSION SET CONTAINER = CDB$ROOT;

Session altered.

SQL> ALTER DATABASE SET LEAD_CDB = TRUE;

Database altered.

SQL> SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='LEAD_CDB';

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

SQL>

Let’s Check the count of PDBs in CDB18C till now.

SQL> select name from v$database;

NAME
---------
CDB18C

SQL> show pdbs

CON_ID     CON_NAME   OPEN MODE   RESTRICTED
---------- ---------- ----------- -----------
2          PDB$SEED   READ ONLY   NO
3          PDB18C1    MOUNTED
4          PDB18C2    READ WRITE  NO
7          PDB18CSNAP READ WRITE  NO

Now login to another CDB i.e NEWCDB and create a database link and also set the LEAD_CDB_URI.

SQL> select name from v$database;

NAME
---------
NEWCDB

SQL> SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='LEAD_CDB_URI';

no rows selected

SQL> CREATE PUBLIC DATABASE LINK lead_link CONNECT TO system IDENTIFIED BY sys USING 'CDB18C';

Database link created.

SQL> select name from v$database@lead_link;

NAME
---------
CDB18C

SQL> ALTER DATABASE SET LEAD_CDB_URI = 'dblink:LEAD_LINK';

Database altered.

SQL> SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='LEAD_CDB_URI';

PROPERTY_VALUE
--------------------------------------------------------------------------------
dblink:LEAD_LINK

SQL>

Let’s Check again the PDBs in CDB18C now.

SQL> select name from v$database;

NAME
---------
CDB18C

SQL> show pdbs

CON_ID     CON_NAME     OPEN MODE   RESTRICTED
---------- ----------   ----------  ---------- 
2          PDB$SEED     READ ONLY   NO
3          PDB18C1      MOUNTED
4          PDB18C2      READ WRITE  NO
6          PDB18CFLEET  MOUNTED
7          PDB18CSNAP   READ WRITE  NO

As we PDB18CFLEET from NEWCDB container is visible in LEAD CDB i.e CDB18C.

Stay tuned for more articles on Oracle 18c 

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.