资源分配方法
创建两个计划指导,以便将75%的CPU资源分配给ONLINE_DEVELOPERS组,25%的CPU资源分配给BATCH_DEVELOPERS组。
另外,将ONLINE_DEVELOPERS组并行性限制为12,将BATCH_DEVELOPERS组的并行性限制为6。
ONLINE_DEVELOPERS资源分配
SQL> exec dbms_resource_manager.create_plan_directive -
> (Plan => 'DEVELOPERS', -
> Group_or_subplan => 'ONLINE_DEVELOPERS', -
> Comment => 'Online developers', -
> Cpu_p1 => 75, -
> Cpu_p2 => 0, -
> Parallel_degree_limit_p1 => 12);
PL/SQL procedure successfully completed.
BATCH_DEVELOPERS资源分配
SQL> exec dbms_resource_manager.create_plan_directive -
> (Plan => 'DEVELOPERS', -
> Group_or_subplan => 'BATCH_DEVELOPERS', -
> Comment => 'Batch developers', -
> Cpu_p1 => 25, -
> Cpu_p2 => 0, -
> Parallel_degree_limit_p1 => 6);
PL/SQL procedure successfully completed.
OTHER_GROUPS(计划中必须包含此组)
SQL> exec dbms_resource_manager.create_plan_directive -
> (Plan => 'DEVELOPERS', -
> Group_or_subplan => 'OTHER_GROUPS', -
> Comment => 'Everyone else', -
> Cpu_p1 => 0, -
> Cpu_p2 => 100, -
> Parallel_degree_limit_p1 => 6);
PL/SQL procedure successfully completed.
验证是否有效
SQL> exec DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA()
PL/SQL procedure successfully completed.
提交更改
SQL> exec DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
PL/SQL procedure successfully completed.
清除更改
exec DBMS_RESOURCE_MANAGER.CLEAR_PENDING_AREA();