当前位置:网站首页>Oracle: Practice of CDB restricting PDB resources

Oracle: Practice of CDB restricting PDB resources

2022-07-07 01:08:00 Weisi xmws

DBA Necessary certification for database management :ORACLE OCP 19C

Textbook download     ORACLE OCP 19C Official electronic textbook


Oracle12.2 New characteristics , In the multi tenant database ,Resource Manager  Resources can be managed at two levels .

CDB Grade Resource Plan

Resource Manager Can manage contention systems and CDB Multiple resources PDB Workload for . You can specify how to PDB Allocate resources , You can also limit specific PDB Resource utilization of .

PDB Grade Resource Plan

Resource Manager Can manage each PDB Workload in , It's similar to not CDB. namely , Resources are allocated in two steps . The resource manager first assigns a portion of the system resources to each in the container database PDB. then , In specific PDB in , It will get part of the system resources ( Previous step ) Assigned to connect to PDB Every session of .

from 12.1 Start ,CDB level resource plans You can use . Use CDB level resource plans, We can limit certain PDB The use of resources , for example :
(1) Limit specific PDB Of CPU Usage rate .
(2) Limit specific PDB Parallel execution that can be used Server The number of .
(3) Limit specific PDB Memory usage .
(4) Restrict connections to a single PDB Resource usage of different sessions .
(5) Limit specific PDB Generated I/O.


For databases with thousands of pluggable (PDB) Multi tenant container database (CDB), by CDB level resource plan Configure memory and others Resource Manager Indicators will become very troublesome .


 

12.2 Introduced in Performance Profiles and Mandatory PDB Profiles It can be a group PDB Rather than a single PDB To configure CDB resource plan indicators . You can use similar resource requirements PDB Divided into one group , And create... For them performance profile.CDB resource plan The indicators are aimed at these performance profile( Or this group PDB) Created . have access to DB_PERFORMANCE_PROFILE Initialization parameters specify each PDB Of performance profile.
 

have access to CREATE_CDB_PROFILE_DIRECTIVE The process is PDB performance profiles Set up shares,utilization_limit and parallel_server_limit Equal attribute .

Use PDB Performance Profile establish CDB Resource Plan Steps for :
ad locum , I assume that a person named newcdb Of CDB establish CDB resource plan Scene . The plan includes a project called gold,silver,bronze Each PDB performance profiles Indicators of . And then put these PDB performance profiles Assigned to CDB Medium PDB Or inserted in the future PDB.

1) Use CREATE_PENDING_AREA Process creation  pending area
cdb perform 
exec DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
 Use CREATE_CDB_PLAN Process creation CDB resource plan
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CDB_PLAN(
plan => 'newcdb_plan',
comment => 'CDB resource plan for newcdb');
END;
/
 Use CREATE_CDB_PROFILE_DIRECTIVE The process is PDB performance profiles  Create indicators 
<PDB profile  Of  plan indicators ,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  Of  plan indicators ,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  Of  plan indicators , 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) Use VALIDATE_PENDING_AREA Process validation  pending area
exec DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
3) Use SUBMIT_PENDING_AREA Process submission  pending area
exec DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
4) Enable CDB Resource Plan
cdb perform 
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = 'newcdb_plan' scope=both;
5) stay PDB It is specified in  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;
 restart PDB
conn /as sysdba
alter pluggable database all close immediate;
alter pluggable database all open;
 see  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;

To see the difference PDB Details of indicators :

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

原网站

版权声明
本文为[Weisi xmws]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207061721376134.html