---系统中没有任何active的resource plan
show parameter resource_manager_plan
NAME TYPE VALUE
------------------------------------ -------------------------------- ------------------------------
resource_manager_plan string
---但是v$rsrc_plan里却显示存在名为INTERNAL_PLAN的资源计划,is_top_plan=TRUE
set linesize 150
select * from v$rsrc_plan
ID NAME IS_TO CPU INS PARALLEL_SERVERS_ACTIVE PARALLEL_SERVERS_TOTAL PARALLEL_EXECUTION_MANAGED
---------- -------------------------------- ----- --- --- ----------------------- ---------------------- --------------------------------
12546 INTERNAL_PLAN TRUE OFF OFF 0 256 FIFO
---internal_plan的说明可以看出禁用resource manager的情况下,会使用INTERNAL_PLAN
col comments format a60
select plan_id,plan,num_plan_directives,comments from dba_rsrc_plans where plan='INTERNAL_PLAN';
PLAN_ID PLAN NUM_PLAN_DIRECTIVES COMMENTS
---------- ------------------------------ ------------------- ------------------------------------------------------------
12546 INTERNAL_PLAN 1 Internally-used plan for disabling the resource manager.
---系统里除了SYS、SYSTEM外,其它用户都属于DEFAULT_CONSUMER_GROUP
set pagesize 100
select username,initial_rsrc_consumer_group from dba_users;
USERNAME INITIAL_RSRC_CONSUMER_GROUP
------------------------------ ------------------------------
LIVREORG DEFAULT_CONSUMER_GROUP
POWERQUERY DEFAULT_CONSUMER_GROUP
POWERUSER DEFAULT_CONSUMER_GROUP
SYSTEM SYS_GROUP
SYS SYS_GROUP
---DEFAULT_CONSUMER_GROUP是什么,看下说明就知道:给没有指定任何consumer group的用户分配的一个缺省的组
col consumer_group format a30
col category format a20
select consumer_group,comments,category,mandatory from dba_rsrc_consumer_groups where consumer_group='DEFAULT_CONSUMER_GROUP';
CONSUMER_GROUP COMMENTS CATEGORY MAN
------------------------------ ------------------------------------------------------------ -------------------- ---
DEFAULT_CONSUMER_GROUP Consumer group for users not assigned to any consumer group OTHER YES
---DEFAULT_CONSUMER_GROUP里有哪些资源?这下知道了这个组就是一个空壳,没有任何资源计划向导
SQL> select * from dba_rsrc_plan_directives where group_or_subplan='DEFAULT_CONSUMER_GROUP';
no rows selected
---INTERNAL_PLAN存在对于other_Groups的plan directive,虽然这个plan directive里没有任何实质性的定义
col comments format a50
select plan,group_or_subplan,type,mandatory,comments from dba_rsrc_plan_directives where plan='INTERNAL_PLAN';
PLAN GROUP_OR_SUBPLAN TYPE MAN COMMENTS
------------------------------ ------------------------------ -------------- --- --------------------------------------------------
INTERNAL_PLAN OTHER_GROUPS CONSUMER_GROUP YES Directive for all other operations
select * from dba_rsrc_plan_directives where GROUP_OR_SUBPLAN='OTHER_GROUPS' and plan='INTERNAL_PLAN';
PLAN GROUP_OR_SUBPLAN TYPE CPU_P1 CPU_P2 CPU_P3 CPU_P4 CPU_P5 CPU_P6
------------------------------ ------------------------------ -------------- ---------- ---------- ---------- ---------- ---------- ----------
CPU_P7 CPU_P8 MGMT_P1 MGMT_P2 MGMT_P3 MGMT_P4 MGMT_P5 MGMT_P6 MGMT_P7 MGMT_P8 ACTIVE_SESS_POOL_P1 QUEUEING_P1
---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------------------- -----------
PARALLEL_TARGET_PERCENTAGE PARALLEL_DEGREE_LIMIT_P1 SWITCH_GROUP SWITC SWITCH_TIME SWITCH_IO_MEGABYTES SWITCH_IO_REQS SWITC
-------------------------- ------------------------ ------------------------------ ----- ----------- ------------------- -------------- -----
MAX_EST_EXEC_TIME UNDO_POOL MAX_IDLE_TIME MAX_IDLE_BLOCKER_TIME MAX_UTILIZATION_LIMIT PARALLEL_QUEUE_TIMEOUT SWITCH_TIME_IN_CALL
----------------- ---------- ------------- --------------------- --------------------- ---------------------- -------------------
COMMENTS STATUS MAN
------------------------------------------------------------ ------------------------------ ---
INTERNAL_PLAN OTHER_GROUPS CONSUMER_GROUP 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
FALSE FALSE
Directive for all other operations YES
---看下other_groups的说明,知道它是没有被分配consumer group的用户都会被归到这个组,与DEFAULT_CONSUMER_GROUP的区别在于other_groups里包含计划向导
col consumer_group format a30
col category format a20
select consumer_group,comments,category,mandatory from dba_rsrc_consumer_groups where consumer_group='OTHER_GROUPS';
CONSUMER_GROUP COMMENTS CATEGORY MAN
------------------------------ ------------------------------------------------------------ -------------------- ---
OTHER_GROUPS Consumer group for users not included in any consumer group OTHER YES
with a directive in the currently active plan
---查看v$rsrc_session_info能看出当前session所属的consumer_group
select r.sid,g.consumer_group from V$RSRC_SESSION_INFO r,dba_rsrc_consumer_groups g where current_consumer_group_id=g.consumer_group_id
SID CONSUMER_GROUP
---------- ------------------------------
4 OTHER_GROUPS
6 OTHER_GROUPS
7 OTHER_GROUPS
9 OTHER_GROUPS
10 OTHER_GROUPS
12 OTHER_GROUPS
13 OTHER_GROUPS
17 OTHER_GROUPS
19 OTHER_GROUPS
476 OTHER_GROUPS
477 OTHER_GROUPS
480 OTHER_GROUPS
481 OTHER_GROUPS
484 OTHER_GROUPS
486 OTHER_GROUPS
487 OTHER_GROUPS
488 OTHER_GROUPS
491 OTHER_GROUPS
944 OTHER_GROUPS
945 OTHER_GROUPS
946 OTHER_GROUPS
947 OTHER_GROUPS
948 OTHER_GROUPS
955 OTHER_GROUPS
956 OTHER_GROUPS
958 OTHER_GROUPS
961 OTHER_GROUPS
---从v$session虽然也有一个RESOURCE_CONSUMER_GROUP字段,但却显示为空(因为other_groups是系统默认分配的关系)
SQL> select distinct RESOURCE_CONSUMER_GROUP from v$session;
RESOURCE_CONSUMER_GROUP
--------------------------------
上面的小测试得出,在resource manager没有被enable的情况下,其实系统中还是存在名为INTERNAL_PLAN的active resource plan,只不过里面没有指定任何有效的资源分配策略而已
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/53956/viewspace-1354050/
,如需转载,请注明出处,否则将追究法律责任。