Oracle Database 18c introduceert het CDB-vlootconcept, een verzameling van verschillende CDB's die als één logische CDB kunnen worden beheerd.
Deze functie is momenteel beperkt tot Enterprise Edition op Engineered Systems, zoals Exadata, en Enterprise Edition op Oracle Database Cloud Services.
Er zijn twee mogelijke rollen in een vloot:LEAD_CDB en MEMBER_CDB . De LEAD_CDB kan worden gedefinieerd door de eigenschap LEAD_CDB in te stellen op "TRUE". Alle andere CDB's in de vloot zouden fungeren als MEMBER_CDB's.
In het onderstaande voorbeeld zijn er twee CDB's en PDB's.
cdbvert011 :Containerdatabase met pluggable-databases PDBDP, PDBDW, PDBMV, PDBSWD en PDBADDADOS. Dit wordt de leider van de vloot.
cdbhor011 :Containerdatabase met inplugbare database PDBWEBDW1.
Pluggables-databases in containerdatabase 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
Inplugbare database in containerdatabase 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
Configureer CDBVERT011 als 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
Verleen de juiste rechten aan de gewone gebruiker in de CDB-lead:
sql> grant sysoper to system CONTAINER=ALL; Grant succeeded.
Maak de databaselink en stel in als lid van de vloot:
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
Maak verbinding op CDBVERT011 en vermeld alle PDB's. De STUB-waarde in de STATUS-kolom definieert de CDB en zijn PDB's als leden van de vloot. Nadat u de CDB-vloot hebt geconfigureerd, wordt de PDB-informatie van de verschillende CDB-leden, inclusief het CDB-lid, gesynchroniseerd met de hoofd-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.
Schakel de CDB-lead uit:
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.
Schakel het CDB-lid uit:
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.
Referenties
Beheer van een CDB-vloot. Beschikbaar op https://docs.oracle.com/en/database/oracle/oracle-database/18/multi/administering-cdb-fleet.html#GUID-0AA7FC65-F350-473B-96D2-976313514069