Académique Documents
Professionnel Documents
Culture Documents
Resource
Manager
Kamus@ACOUG
About ACOUG
• ACOUG: All China Oracle User Group
• http://acoug.org
•
About Me
• 张乐奕 Kamus
• http://www.dbform.com
USERS
DBA_USERS.
INITIAL_RSRC_CONSUMER_GROUP
Simple Plan Example
Sub Plan Example
Consumer Group Mappings
TYPE
Service
Module Spec
ific V
Action alue Consumer
Oracle User Group A
Client Program
Priorities
a l u e DEFAULT_CO
f ic V NSUMER_GR
pe c i
S OUP
Resource Allocation Methods
Methods Columns Comments
CPU MGMT_Pn (CPU_Pn) Up to 8 levels
Max Utilization Limit MAX_UTILIZATION_LIMIT Up to 8 levels
Active Session Pool ACTIVE_SESS_POOL_P1 Parallel count as
with
DegreeQueuing
of Parallelism PARALLEL_DEGREE_LIMIT_P1 one
applies to one
Limit
Execution Time Limit MAX_EST_EXEC_TIME operation
in CPU seconds
Undo Pool UNDO_POOL Kilobytes (K)
Idle Time Limit MAX_IDLE_TIME in seconds
DBA_RSRC_PLAN_DIRECTIVES
Notes
• The currently active resource plan does not enforce allocation
limits until CPU usage is at 100%.
• When limits are enforced, unused allocation by any consumer
group can be used by other consumer groups
• It is possible for a subplan or consumer group to have more
than one parent.
• No more than 31 resource consumer groups in any active
plan
• At most, a plan can have 31 children
• Plans and resource consumer groups cannot have the same
name.
•
How to Manage
Use DBMS_RESOURCE_MANAGER
Use EM GUI
Resource Manager in EM
/
BEGIN
DBMS_RESOURCE_MANAGER_PRIVS.REVOKE_SWITCH_CONSUM
ER_GROUP (
REVOKEE_NAME => 'KAMUS',
CONSUMER_GROUP => 'SYS_GROUP');
END;
/
How to Enable/Disiable
Manually
By default the Resource Manager is not enabled
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN =
'mydb_plan';
DBMS_RESOURCE_MANAGER.SWITCH_PLAN
By using Scheduler Windows
Enable: By Oracle Scheduler
Disable: ALTER SYSTEM SET
RESOURCE_MANAGER_PLAN = 'FORCE:mydb_plan';
Switch Consumer Group
Method Program Comments
DBMS_RESOURCE_MANAGER.SWIT Switching a Single
CH_CONSUMER_GROUP_FOR_SESS Switching
Manually DBMS_SESSION.SWITCH_CURRENT Session a Single
_CONSUMER_GROUP
DBMS_RESOURCE_MANAGER.SWIT Switching
Session All Sessions
CH_CONSUMER_GROUP_FOR_USER
Automatic Switching with Mapping Session attribute
for a User
Automatic Automatic
Rules Switching by Setting Defined in resource
changes while the
Resource Limits plan directive
session is running
Views about RSRC
• DBA_RSRC_CONSUMER_GROUP_PRIVS
• DBA_RSRC_PLANS
• V$RSRC_PLAN
• V$RSRC_CONSUMER_GROUP
• V$SESSION. RESOURCE_CONSUMER_GROUP
• V$RSRC_SESSION_INFO
• DBA_HIST_RSRC_*
Oracle Schedule
Kamus@ACOUG
Automated Maintenance Tasks
Scheduler Windows
DBMS_SCHEDULER.C
REATE_WINDOW
Resource Plan
DEFAULT_MAINTENANCE_PLA