当前位置:网站首页>Oracle:CDB限制PDB资源实战
Oracle:CDB限制PDB资源实战
2022-07-06 17:21:00 【微思xmws】
Oracle12.2新特性,在多租户数据库里,Resource Manager 可以在两个级别上管理资源。
CDB 级别的 Resource Plan
Resource Manager 可以管理争用系统和CDB资源的多个PDB的工作负载。您可以指定如何为PDB分配资源,还可以限制特定PDB的资源利用率。
PDB 级别的 Resource Plan
Resource Manager 可以管理每个PDB中的工作负载,类似于非CDB。即,资源分两步分配。资源管理器首先将系统资源的一部分分配给容器数据库中的每个PDB。然后,在特定PDB中,它将获得的系统资源的一部分(从前一步骤)分配给连接到PDB的每个会话。
从12.1开始,CDB级 resource plans 可用。使用CDB级 resource plans,我们可以限制特定PDB的资源使用,例如:
(1)限制特定PDB的CPU使用率。
(2)限制特定PDB可以使用的并行执行 Server 的个数。
(3)限制特定PDB的内存使用。
(4)限制连接到单个PDB的不同会话的资源使用情况。
(5)限制特定PDB生成的 I/O。
对于具有数千个可插拔数据库(PDB)的多租户容器数据库(CDB),为CDB级 resource plan 配置内存和其他Resource Manager 指标会变得非常麻烦。
12.2中引入的 Performance Profiles 和 Mandatory PDB Profiles 可以为一组PDB而不是单个PDB配置CDB resource plan 指标。您可以把使用类似的资源要求的PDB分为一组,并为它们创建 performance profile。CDB resource plan指标是针对这些 performance profile(或这一组PDB)创建的。可以使用 DB_PERFORMANCE_PROFILE 初始化参数指定每个PDB的 performance profile。
可以使用CREATE_CDB_PROFILE_DIRECTIVE过程为PDB performance profiles 设置shares,utilization_limit和parallel_server_limit等属性。
使用PDB Performance Profile 创建CDB Resource Plan 的步骤:
在这里,我假设为一个名为newcdb的CDB创建CDB resource plan 的场景。该计划包括一个名为 gold,silver,bronze的每个PDB performance profiles 的指标。然后将这些PDB performance profiles 分配给CDB中的PDB或将来插入的PDB。
1)使用CREATE_PENDING_AREA过程创建 pending area
cdb执行
exec DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
使用CREATE_CDB_PLAN过程创建CDB resource plan
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CDB_PLAN(
plan => 'newcdb_plan',
comment => 'CDB resource plan for newcdb');
END;
/
使用CREATE_CDB_PROFILE_DIRECTIVE过程为PDB performance profiles 创建指标
<PDB profile 的 plan指标,gold>
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CDB_PROFILE_DIRECTIVE(
plan => 'newcdb_plan',
profile => 'gold',
shares => 3,
utilization_limit => 100,
parallel_server_limit => 100);
END;
/
<PDB profile 的 plan指标,silver>
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CDB_PROFILE_DIRECTIVE(
plan => 'newcdb_plan',
profile => 'silver',
shares => 2,
utilization_limit => 40,
parallel_server_limit => 40);
END;
/
<PDB profile 的 plan指标, bronze>
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CDB_PROFILE_DIRECTIVE(
plan => 'newcdb_plan',
profile => 'bronze',
shares => 1,
utilization_limit => 20,
parallel_server_limit => 20);
END;
/
2)使用VALIDATE_PENDING_AREA过程验证 pending area
exec DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
3)使用SUBMIT_PENDING_AREA过程提交 pending area
exec DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
4)启用CDB Resource Plan
cdb执行
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'newcdb_plan' scope=both;
5)在PDB中指定 Performance Profiles
alter session set container=PDB1;
alter system set db_performance_profile=‘gold’ scope=spfile;
alter session set container=PDB2;
alter system set db_performance_profile=‘silver’ scope=spfile;
alter session set container=PDB3;
alter system set db_performance_profile=‘bronze’ scope=spfile;
重启PDB
conn /as sysdba
alter pluggable database all close immediate;
alter pluggable database all open;
查看 PDB Performance Profiles:
alter session set container=CDB$ROOT;
select inst_id, name, con_id, value, ispdb_modifiable from gv$system_parameter2 where name = 'db_performance_profile' order by 1,2,3,4;要查看不同PDB的指标的细节:
alter session set container=CDB$ROOT;
select p.name, shares, utilization_limit, profile from v$rsrc_plan r, v$pdbs p where r.con_id = p.con_id
边栏推荐
猜你喜欢

Zynq transplant ucosiii

Dr selection of OSPF configuration for Huawei devices

New feature of Oracle 19C: automatic DML redirection of ADG, enhanced read-write separation -- ADG_ REDIRECT_ DML

Chenglian premium products has completed the first step to enter the international capital market by taking shares in halber international
![[100 cases of JVM tuning practice] 04 - Method area tuning practice (Part 1)](/img/7a/bd03943c39d3f731afb51fe2e0f898.png)
[100 cases of JVM tuning practice] 04 - Method area tuning practice (Part 1)

Provincial and urban level three coordinate boundary data CSV to JSON

Stm32f407 ------- SPI communication

ESP Arduino (IV) PWM waveform control output

Part 7: STM32 serial communication programming

Anfulai embedded weekly report no. 272: 2022.06.27--2022.07.03
随机推荐
fastDFS数据迁移操作记录
How do novices get started and learn PostgreSQL?
windows安装mysql8(5分钟)
第七篇,STM32串口通信编程
SuperSocket 1.6 创建一个简易的报文长度在头部的Socket服务器
New feature of Oracle 19C: automatic DML redirection of ADG, enhanced read-write separation -- ADG_ REDIRECT_ DML
做微服务研发工程师的一年来的总结
C Primer Plus Chapter 14 (structure and other data forms)
ESP Arduino (IV) PWM waveform control output
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such
新手如何入门学习PostgreSQL?
[HFCTF2020]BabyUpload session解析引擎
A brief history of deep learning (II)
Dynamic planning idea "from getting started to giving up"
Js+svg love diffusion animation JS special effects
STM32开发资料链接分享
Summary of being a microservice R & D Engineer in the past year
接口(接口相关含义,区别抽象类,接口回调)
[Niuke classic question 01] bit operation
Data type of pytorch tensor