ORACLE DRM
656500Oct 19 2008 — edited Oct 20 2008hi
i use Oracle data resource management for 1st time . and i create a test as follow :
first i create a plan like this :
begin
DBMS_RESOURCE_MANAGER.create_pending_area();
dbms_resource_manager.create_consumer_group(consumer_group => 'GROUP_1'
,comment => 'HAVING 80% CPU' ) ;
dbms_resource_manager.create_consumer_group(consumer_group => 'GROUP_2'
,comment => 'HAVING 20% CPU' ) ;
dbms_resource_manager.set_consumer_group_mapping(attribute => DBMS_RESOURCE_MANAGER.oracle_user,
VALUE => 'HESAMS',
CONSUMER_GROUP => 'GROUP_1');
dbms_resource_manager.set_consumer_group_mapping(ATTRIBUTE => DBMS_RESOURCE_MANAGER.oracle_user,
VALUE => 'HESAMS2',
CONSUMER_GROUP => 'GROUP_2');
dbms_resource_manager.create_plan(PLAN => 'PLAN_1',
COMMENT => 'FIRST PLAN');
dbms_resource_manager.create_plan(PLAN => 'PLAN_2',
COMMENT => 'SECOND PLAN',
CPU_MTH => 'RATIO');
dbms_resource_manager.create_plan_directive(PLAN => 'PLAN_1',
GROUP_OR_SUBPLAN => 'GROUP_1',
COMMENT => 'CPU ALLOCATION FOR GROUP_1 IN PLAN_1',
CPU_P1 => 70);
dbms_resource_manager.create_plan_directive(PLAN => 'PLAN_1',
GROUP_OR_SUBPLAN => 'GROUP_2',
COMMENT => 'CPU ALLOCATION FOR GROUP_2 IN PLAN_1',
CPU_P1 => 20);
dbms_resource_manager.create_plan_directive(PLAN => 'PLAN_1',
GROUP_OR_SUBPLAN => 'OTHER_GROUPS',
COMMENT => 'CPU ALLOCATION FOR OTHER_GROUPS IN PLAN_1',
CPU_P1 => 10);
dbms_resource_manager.create_plan_directive(PLAN => 'PLAN_2',
GROUP_OR_SUBPLAN => 'GROUP_1',
COMMENT => 'CPU ALLOCATION FOR GROUP_1 IN PLAN_2',
CPU_P1 => 1);
dbms_resource_manager.create_plan_directive(PLAN => 'PLAN_2',
GROUP_OR_SUBPLAN => 'GROUP_2',
COMMENT => 'CPU ALLOCATION FOR GROUP_2 IN PLAN_2',
CPU_P1 => 10);
dbms_resource_manager.create_plan_directive(PLAN => 'PLAN_2',
GROUP_OR_SUBPLAN => 'OTHER_GROUPS',
COMMENT => 'CPU ALLOCATION FOR OTHER_GROUPS IN PLAN_2',
CPU_P1 => 1);
DBMS_RESOURCE_MANAGER.submit_pending_area();
end;
________________________________
and then i enable the resource plan_1 by :
ALTER SYSTEM SET resource_manager_plan='PLAN_1' SCOPE=BOTH;
and i execute a heavy query in both two schemas that i use them above (hesams , hesams2 ) like :
BEGIN
DECLARE
m NUMBER;
BEGIN
FOR i IN 1..100000 LOOP
FOR j IN 1..100000 LOOP
select count(*) into m from v$sysstat, v$system_event;
END LOOP;
END LOOP;
END;
END;
/
but , when i select from v$session view , in resource consumer group field , oracle showed me "OTHERS_GROUPS" ! and i dont now why it does't asssign GROUP_1 and GROUP_2 to them ???
and the cpu participated equally on two schemas .
thx in adv