Bo's Oracle Station

查看: 2106|回复: 0

第59次:2015-09-09星期三

[复制链接]

75

主题

115

帖子

2772

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2772
发表于 2015-9-11 00:14:11 | 显示全部楼层 |阅读模式
  1. select  * from dba_rsrc_plans;

  2. select  * from dba_rsrc_plan_directives d where d.plan='PLAN1';

  3. select  * from dba_rsrc_consumer_groups;

  4. select  * from dba_rsrc_group_mappings;

  5. ---
  6. select  * from dba_rsrc_plans  where plan  like 'PLAN%';


  7. BEGIN
  8. dbms_resource_manager.clear_pending_area();
  9. dbms_resource_manager.create_pending_area();
  10. dbms_resource_manager.create_plan( plan => 'PLAN2', comment => 'PLAN2',CPU_MTH=>'RATIO' );
  11. dbms_resource_manager.create_plan_directive(
  12.     plan => 'PLAN2',
  13.     group_or_subplan => 'SYS_GROUP',
  14.     comment => 'SYS_GROUP',
  15.     mgmt_p1 => 5);
  16. dbms_resource_manager.create_plan_directive(
  17.     plan => 'PLAN2',
  18.     group_or_subplan => 'GROUP1',
  19.     comment => 'GROUP1',
  20.     mgmt_p1 => 3);
  21. dbms_resource_manager.create_plan_directive(
  22.     plan => 'PLAN2',
  23.     group_or_subplan => 'GROUP2',
  24.     comment => 'GROUP2',
  25.     mgmt_p1 => 2);
  26. dbms_resource_manager.create_plan_directive(
  27.     plan => 'PLAN2',
  28.     group_or_subplan => 'OTHER_GROUPS',
  29.     comment => 'OTHER_GROUPS',
  30.     mgmt_p1 => 1
  31. );
  32. dbms_resource_manager.submit_pending_area();
  33. END;

  34. select  s.USERNAME, s.RESOURCE_CONSUMER_GROUP
  35. from v_$session s where s.TERMINAL='pts/5';


  36. select  * from dba_users u where u.username='SH';

  37. alter user sh identified by oracle_4U account unlock;


  38. select  * from dba_rsrc_plans  where plan  like 'PLAN%';

  39. select  * from dba_rsrc_plan_directives d where d.plan='PLAN1';



  40. BEGIN
  41. dbms_resource_manager.clear_pending_area();
  42. dbms_resource_manager.create_pending_area();
  43. dbms_resource_manager.create_plan( plan => 'PLAN2', comment => 'PLAN2',CPU_MTH=>'RATIO' );
  44. dbms_resource_manager.create_plan_directive(
  45.     plan => 'PLAN2',
  46.     group_or_subplan => 'SYS_GROUP',
  47.     comment => 'SYS_GROUP',
  48.     mgmt_p1 => 5);
  49. dbms_resource_manager.create_plan_directive(
  50.     plan => 'PLAN2',
  51.     group_or_subplan => 'GROUP1',
  52.     comment => 'GROUP1',
  53.     mgmt_p1 => 3);
  54. dbms_resource_manager.create_plan_directive(
  55.     plan => 'PLAN2',
  56.     group_or_subplan => 'GROUP2',
  57.     comment => 'GROUP2',
  58.     mgmt_p1 => 2);
  59. dbms_resource_manager.create_plan_directive(
  60.     plan => 'PLAN2',
  61.     group_or_subplan => 'OTHER_GROUPS',
  62.     comment => 'OTHER_GROUPS',
  63.     mgmt_p1 => 1
  64. );
  65. dbms_resource_manager.submit_pending_area();
  66. END;

  67. select  s.USERNAME, s.RESOURCE_CONSUMER_GROUP, s.status ,s.TERMINAL
  68. from v_$session s where s.TERMINAL in ('pts/2');


  69. select  * from dba_users u where u.username='SH';

  70. alter user sh identified by oracle_4U account unlock;

  71. BEGIN
  72. dbms_resource_manager.clear_pending_area();
  73. dbms_resource_manager.create_pending_area();
  74. dbms_resource_manager.update_plan_directive(
  75.     plan => 'PLAN1',
  76.     group_or_subplan => 'GROUP1',
  77.    new_max_idle_blocker_time =>-1
  78. );
  79. dbms_resource_manager.submit_pending_area();
  80. END;

  81. ----

  82. select  * from dba_rsrc_plan_directives d where d.plan='PLAN1';

  83. ---

  84. select  * from resource_cost;

  85. alter resource cost  CPU_PER_SESSION 10  LOGICAL_READS_PER_SESSION 5  ;



复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-22 00:50 , Processed in 0.043063 second(s), 25 queries .

快速回复 返回顶部 返回列表