Resource Group
BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
dbms_resource_manager.create_consumer_group(consumer_group => 'oltp', comment => 'oltp', cpu_mth => 'ROUND-ROBIN');
dbms_resource_manager.submit_pending_area();
END;

BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
dbms_resource_manager.create_consumer_group(consumer_group => 'batch', comment => 'batch', cpu_mth => 'ROUND-ROBIN');
dbms_resource_manager.submit_pending_area();
END;

BEGIN
dbms_resource_manager.clear_pending_area();
dbms_resource_manager.create_pending_area();
dbms_resource_manager.create_plan( 'CALL_PLAN', 'CALL_PLAN');
dbms_resource_manager.create_plan_directive(
    plan => 'CALL_PLAN',
    group_or_subplan => 'BATCH',
    comment => '',
    cpu_p1 => NULL, cpu_p2 => 100, cpu_p3 => NULL, cpu_p4 => NULL,
    cpu_p5 => NULL, cpu_p6 => NULL, cpu_p7 => NULL, cpu_p8 => NULL,
    parallel_degree_limit_p1 => 4,
    active_sess_pool_p1 => 5,
    queueing_p1 => 90,
    switch_group => NULL,
    switch_time => NULL,
    switch_estimate => false,
    max_est_exec_time => NULL,
    undo_pool => NULL,
    max_idle_time => NULL,
    max_idle_blocker_time => NULL,
    switch_time_in_call => NULL
);
dbms_resource_manager.create_plan_directive(
    plan => 'CALL_PLAN',
    group_or_subplan => 'OLTP',
    comment => '',
    cpu_p1 => 80, cpu_p2 => NULL, cpu_p3 => NULL, cpu_p4 => NULL,
    cpu_p5 => NULL, cpu_p6 => NULL, cpu_p7 => NULL, cpu_p8 => NULL,
    parallel_degree_limit_p1 => 1,
    active_sess_pool_p1 => NULL,
    queueing_p1 => NULL,
    switch_group => 'BATCH',
    switch_time => 120,
    switch_estimate => false,
    max_est_exec_time => 120,
    undo_pool => 10240,
    max_idle_time => 600,
    max_idle_blocker_time => NULL,
    switch_time_in_call => NULL
);
dbms_resource_manager.create_plan_directive(
    plan => 'CALL_PLAN',
    group_or_subplan => 'OTHER_GROUPS',
    comment => '',
    cpu_p1 => NULL, cpu_p2 => NULL, cpu_p3 => 100, cpu_p4 => NULL,
    cpu_p5 => NULL, cpu_p6 => NULL, cpu_p7 => NULL, cpu_p8 => NULL,
    parallel_degree_limit_p1 => 4,
    active_sess_pool_p1 => NULL,
    queueing_p1 => NULL,
    switch_group => NULL,
    switch_time => NULL,
    switch_estimate => false,
    max_est_exec_time => NULL,
    undo_pool => NULL,
    max_idle_time => NULL,
    max_idle_blocker_time => NULL,
    switch_time_in_call => NULL
);
dbms_resource_manager.submit_pending_area();
END;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License