Oracle Database 18c memperkenalkan konsep armada CDB yang merupakan kumpulan dari berbagai CDB yang dapat dikelola sebagai satu CDB logis.
Fitur ini saat ini dibatasi untuk Enterprise Edition pada Engineered Systems, seperti Exadata, dan Enterprise Edition pada Oracle Database Cloud Services.
Ada dua kemungkinan peran dalam armada:LEAD_CDB dan MEMBER_CDB . LEAD_CDB dapat didefinisikan dengan menyetel properti LEAD_CDB sebagai “TRUE”. Semua CDB lain dalam armada akan bertindak sebagai MEMBER_CDB.
Pada contoh di bawah ini ada dua CDB dan PDB di dalamnya.
cdbvert011 :Basis data kontainer dengan basis data pluggable PDBDP, PDBDW, PDBMV, PDBSWD dan PDBADDADOS. Ini akan menjadi pemimpin armada.
cdbhor011 :Basis data kontainer dengan basis data pluggable PDBWEBDW1.
Database Pluggables di 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
Basis Data yang Dapat Dipasang di Basis Data Kontainer 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
Konfigurasi CDBVERT011 sebagai 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
Berikan hak istimewa yang sesuai kepada pengguna umum di lead CDB:
sql> grant sysoper to system CONTAINER=ALL; Grant succeeded.
Buat tautan basis data dan tetapkan sebagai anggota armada:
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
Hubungkan pada CDBVERT011 dan daftar semua PDB. Nilai STUB di kolom STATUS mendefinisikan CDB dan PDB-nya sebagai anggota dalam armada. Setelah Anda mengonfigurasi armada CDB, informasi PDB dari berbagai anggota CDB termasuk anggota CDB disinkronkan dengan CDB utama.
$ 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.
Nonaktifkan Prospek CDB:
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.
Nonaktifkan Anggota CDB:
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.
Referensi
Mengelola Armada CDB. Tersedia di https://docs.Oracle.com/en/database/Oracle/Oracle-database/18/multi/administering-cdb-fleet.html#GUID-0AA7FC65-F350-473B-96D2-976313514069