当前位置:网站首页>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
边栏推荐
- Dell笔记本周期性闪屏故障
- 接口(接口相关含义,区别抽象类,接口回调)
- [牛客] B-完全平方数
- Eventbus source code analysis
- Explain in detail the matrix normalization function normalize() of OpenCV [norm or value range of the scoped matrix (normalization)], and attach norm_ Example code in the case of minmax
- Openjudge noi 1.7 08: character substitution
- 「笔记」折半搜索(Meet in the Middle)
- Deep learning environment configuration jupyter notebook
- 在jupyter中实现实时协同是一种什么体验
- Equals() and hashcode()
猜你喜欢
Linear algebra of deep learning
[batch dos-cmd command - summary and summary] - jump, cycle, condition commands (goto, errorlevel, if, for [read, segment, extract string]), CMD command error summary, CMD error
[batch dos-cmd command - summary and summary] - string search, search, and filter commands (find, findstr), and the difference and discrimination between find and findstr
windows安装mysql8(5分钟)
View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
Maidong Internet won the bid of Beijing life insurance to boost customers' brand value
5种不同的代码相似性检测,以及代码相似性检测的发展趋势
随时随地查看远程试验数据与记录——IPEhub2与IPEmotion APP
Stm32f407 ------- SPI communication
[software reverse automation] complete collection of reverse tools
随机推荐
【JVM调优实战100例】04——方法区调优实战(上)
Chapter 5 DML data operation
Part VI, STM32 pulse width modulation (PWM) programming
pytorch之数据类型tensor
The printf function is realized through the serial port, and the serial port data reception is realized by interrupt
Rainstorm effect in levels - ue5
Lombok makes ⽤ @data and @builder's pit at the same time. Are you hit?
深度学习简史(二)
【JVM调优实战100例】05——方法区调优实战(下)
. Bytecode structure of class file
What is time
Advantages and disadvantages of code cloning
ESP Arduino (IV) PWM waveform control output
第六篇,STM32脉冲宽度调制(PWM)编程
Linear algebra of deep learning
[batch dos-cmd command - summary and summary] - jump, cycle, condition commands (goto, errorlevel, if, for [read, segment, extract string]), CMD command error summary, CMD error
BFS realizes breadth first traversal of adjacency matrix (with examples)
Five different code similarity detection and the development trend of code similarity detection
[hfctf2020]babyupload session parsing engine
接口(接口相关含义,区别抽象类,接口回调)