资源管理介绍
Step 1: Create a pending area.
Step 2: Create, modify, or delete consumer groups.
Step 3: Create the resource plan.
Step 4: Create resource plan directives.
Step 5: Validate the pending area.
Step 6: Submit the pending area.
Step 7: assign user to consumer group
--创建临时区:
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PENDING_AREA();
END;
/
--创建消耗组:
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_CONSUMER_GROUP (
CONSUMER_GROUP => 'WOC',
COMMENT => 'WOC applications');
END;
/
--创建资源计划
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PLAN(
PLAN => 'WOC_PLAN',
COMMENT => 'More resources for WOC applications');
END;
/
--创建资源目录
BEGIN
DBMS_RESOURCE_MANAGER.CREATE_PLAN_DIRECTIVE (
PLAN => 'WOC_PLAN',
GROUP_OR_SUBPLAN => 'WOC',
COMMENT => 'WOC group',
ACTIVE_SESS_POOL_P1 => 50,
SWITCH_IO_MEGABYTES => 3,
MGMT_P1 => 5);
END;
/
--验证临时区
BEGIN
DBMS_RESOURCE_MANAGER.VALIDATE_PENDING_AREA();
END;
/
--提交临时区
BEGIN
DBMS_RESOURCE_MANAGER.SUBMIT_PENDING_AREA();
END;
/
--清楚临时区
BEGIN
DBMS_RESOURCE_MANAGER.CLEAR_PENDING_AREA();
END;
/
分配用户到某个资源组:
BEGIN
dbms_resource_manager.set_initial_consumer_group(
user =>'WOC',
consumer_group=>'WOC'
)
END;
/