BEGIN
--清除挂起内存区域
dbms_resource_manager.clear_pending_area();
--开辟挂起内存区域
dbms_resource_manager.create_pending_area();
--创建白天资源计划
dbms_resource_manager.create_plan('GISINFO_DAYTIME_PLAN','公司业务侧重图形');
--创建资源计划指令
dbms_resource_manager.create_plan_directive(
plan=>'GISINFO_DAYTIME_PLAN',
group_or_subplan=>'AUTH_GROUP',
comment=>'',
cpu_p1=>NULL,cpu_p2=>NULL,cpu_p3=>NULL,cpu_p4=>100,
cpu_p5=>NULL,cpu_p6=>NULL,cpu_p7=>NULL,cpu_p8=>NULL,--CPU资源限制
parallel_degree_limit_p1=>NULL,--并行度限制
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=>60,--最大空闲时间限制
max_idle_blocker_time=>NULL,
switch_time_in_call=>NULL
);
dbms_resource_manager.create_plan_directive(
plan=>'GISINFO_DAYTIME_PLAN',
group_or_subplan=>'DB_GROUP',
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=>NULL,
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=>600,
max_idle_blocker_time=>NULL,
switch_time_in_call=>NULL
);
dbms_resource_manager.create_plan_directive(
plan=>'GISINFO_DAYTIME_PLAN',
group_or_subplan=>'OTHER_GROUPS',
comment=>'',
cpu_p1=>NULL,cpu_p2=>NULL,cpu_p3=>NULL,cpu_p4=>NULL,
cpu_p5=>100,cpu_p6=>NULL,cpu_p7=>NULL,cpu_p8=>NULL,
parallel_degree_limit_p1=>NULL,
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=>600,
max_idle_blocker_time=>NULL,
switch_time_in_call=>NULL
);
dbms_resource_manager.create_plan_directive(
plan=>'GISINFO_DAYTIME_PLAN',
group_or_subplan=>'SDE_GROUP',
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=>NULL,
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=>600,
max_idle_blocker_time=>NULL,
switch_time_in_call=>NULL
);
dbms_resource_manager.create_plan_directive(
plan=>'GISINFO_DAYTIME_PLAN',
group_or_subplan=>'SYS_GROUP',
comment=>'',
cpu_p1=>100,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=>NULL,
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();
--激活资源计划
dbms_resource_manager.switch_plan(plan_name=>'GISINFO_DAYTIME_PLAN',sid=>'orcl');
END;
资源管理器之资源计划
最新推荐文章于 2021-04-05 13:42:53 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)