我将 CDB Fleet转移为cdb舰队,LEAD_CDB转移带头大哥,应该是靠谱的,看完此文,但是有个疑问,不是pdbs都能满足我的设计了,为什么还要这么多cdbs干什么啊?必须这样么?难道有pdbs满足不了的设计么?
14 Administering a CDB Fleet
A CDB fleet 是可以作为逻辑CDB管理的CDBs和托管PDBs的集合。
This chapter contains the following topics:
- About CDB Fleets
A lead CDB is the central location for monitoring and managing the CDBs in the fleet. - Purpose of a CDB Fleet
A CDB fleet provides the database infrastructure for scalability and centralized management of many CDBs. - Setting the Lead CDB in a CDB Fleet
Set the lead CDB in a CDB fleet by setting theLEAD_CDB
database property totrue
. - Designating a CDB Fleet Member
Designate a fleet member by setting theLEAD_CDB_URI
database property to a database link that points to the lead CDB.
Parent topic: Administering a Multitenant Environment
14.1 About CDB Fleets
A 带头 CDB是舰队中监控和管理CDBs的中心位置。
通过将其LEAD_CDB数据库属性设置为TRUE,指定舰队中的一个CDB为带头CDB。舰队中的其他CDB通过设置LEAD_CDB_URI数据库属性指向带头的CDB。在配置CDB舰队之后,来自各个CDBs的PDB信息将与带头的CDB同步。CDBs中的所有PDBs现在在主导CDB中都是“可见的”,使您能够从主导CDB中作为单个逻辑CDB访问舰队中的PDBs。
下图显示了一个由CDB1、CDB2和CDB3组成的CDB机队。领先的CDB是CDB1。驻留在CDB2中的CDB2_hrpdb在CDB1中是可见的。驻留在CDB3中的CDB3_hrpdb在CDB1中也可见。
Figure 14-1 CDB Fleet
Description of "Figure 14-1 CDB Fleet"
所有Oracle数据库特性,如Oracle Real Application Cluster (Oracle RAC)、RMAN、时间点恢复和闪回特性,都支持集群中的CDBs。
您可以使用以下跨容器特性访问CDB机队中的CDBs和PDBs:
-
CDB
views -
GV$
views -
The
CONTAINERS
clause -
Container maps
如果使用应用程序容器配置了一个公共应用程序模式,那么这些跨容器特性将支持跨在舰队中管理的不同CDBs中的PDBs中的查询和数据聚合。
Note:
-
Each PDB name must be unique across all CDBs in a CDB fleet.
-
You can create a PDB in any CDB in the fleet, but you can only open a PDB in the CDB where it was created.
See Also:
Parent topic: Administering a CDB Fleet
14.2 Purpose of a CDB Fleet
A CDB fleet 为许多CDBs的可伸缩性和集中管理提供了数据库基础设施。
A CDB fleet适用于下列情况:
-
您必须为应用程序提供超过最大数量的PDBs(4096),这要求您创建多个CDBs。(这个是硬伤啊)
-
在一个配置中不同的pdb需要不同类型的服务器来优化其功能。
例如,一些pdb可能处理大量事务负载,而其他pdb主要用于监视,您需要这些pdb的适当服务器资源,例如CPU、内存、I/O速率和存储系统。 -
使用相同应用程序的不同pdb必须驻留在不同的位置。
跨CDBs的监测和诊断收集
带头的CDB可以运行跨舰队中CDBs执行的监视和报告应用程序。您可以在一个容器中安装监视应用程序,然后使用CDB视图和GV$视图来监视和处理整个CDB舰队的诊断数据。在主CDB中发出的跨容器查询可以在CDB舰队中的所有PDBs中自动执行。
软件即服务(SaaS)应用程序
使用跨CDB舰队的不同应用程序容器中的公共模式和公共应用程序对象,可以使用containers子句或容器映射跨CDB舰队中的所有PDBs运行查询。为了确保跨CDBs的通用应用程序模式,可以将应用程序安装在应用程序根目录中。
一个典型的用例涉及到在主CDB中安装主应用程序根。应用程序根克隆驻留在机队中的其他每个CDB中。应用程序根克隆的代理PDBs驻留在主应用程序根中。
数据库即服务(DBaaS)应用程序
带头的CDB可以作为一个中心位置,在这里您可以收集和查看CDB舰队中供应的所有或部分PDBs的使用指标和状态。
微服务
微服务是面向服务的体系结构的专门化,用于构建灵活的、独立部署的软件系统。使用microservices,每个团队都可以部署和管理具有定制伸缩和可用性sla的CDB舰队。CDBs可以使用不同的存储系统和配置设置,并满足不同类型的工作负载。带头CDB可以帮助中央DBA管理与每个微服务关联的CDBs集合。
See Also:
Parent topic: Administering a CDB Fleet
14.3 Setting the Lead CDB in a CDB Fleet
通过将LEAD_CDB数据库属性设置为true来设置CDB机队中的lead CDB。
To set the lead CDB in a CDB fleet:
-
In SQL*Plus, ensure that the current container is the root of the CDB that will be the lead CDB.
-
Optionally, check the current
LEAD_CDB
database property by running the following query:SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='LEAD_CDB';
-
Set the
LEAD_CDB
database property toTRUE
.
Example 14-1 Setting the Lead CDB Database Property to true
-
Access the CDB root:
ALTER SESSION SET CONTAINER = CDB$ROOT;
-
Run the following SQL statement:
ALTER DATABASE SET LEAD_CDB = TRUE;
See Also:
"About Container Access in a CDB"
Parent topic: Administering a CDB Fleet
14.4 Designating a CDB Fleet Member
通过将LEAD_CDB_URI数据库属性设置为指向领先CDB的数据库链接来指定车队成员.
Prerequisites
您必须使用具有固定用户语义的数据库链接,这意味着用户名和密码在链接定义中。链接不能使用连接的用户语义,在这种情况下,用户名和密码不在链接定义中。
To designate a CDB fleet member:
-
In SQL*Plus, ensure that the current container is the root of the CDB that you want to designate as a fleet member.
-
Optionally, check the current
LEAD_CDB_URI
database property by running the following query:SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME='LEAD_CDB_URI';
-
If a database link does not exist, then create a link to the root of the lead CDB in the fleet.
The database link must be a fixed common user database link.
-
Set the
LEAD_CDB_URI
database property to the name of the database link to the lead CDB.
Example 14-2 Designating a CDB Fleet Member
这个例子假设主导CDB是cdb1,并且到主导CDB的数据库链接不存在。它还假设网络配置为当前CDB可以使用lead_pod服务名连接到cdb1。
-
Access the root of the CDB that you want to designate as a fleet member:
ALTER SESSION SET CONTAINER = CDB$ROOT;
-
Create the database link to
cdb1
:CREATE PUBLIC DATABASE LINK lead_link CONNECT TO C##CF1 IDENTIFIED BY password USING 'lead_pod';
-
Set the
LEAD_CDB_URI
property to the name of the database link:ALTER DATABASE SET LEAD_CDB_URI = 'dblink:LEAD_LINK';
See Also:
-
Oracle Database Administrator’s Guide for information about fixed user database links
Parent topic: Administering a CDB Fleet