Bo's Oracle Station

查看: 2227|回复: 0

第61和62次,2014-11-08, 053第13章和第16章

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2014-11-10 11:32:48 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2014-11-27 11:29 编辑

2014-11-08-A.txt:
  1. select * from V$MEMORY_DYNAMIC_COMPONENTS
  2. minus
  3. select  * from v$sga_dynamic_components;



  4. select  * from  V$MEMORY_RESIZE_OPS ;


  5. select  * from  V$MEMORY_TARGET_ADVICE ;

  6. select  * from v$sql  where sql_id='dh73w3ss300hp';

  7. select  * from v$sqlarea  where sql_id='dh73w3ss300hp'  ;

  8. select  * from v$session  where  terminal='pts/4';

  9. select  * from dba_objects o where o.owner='HR' and o.object_type='PROCEDURE';

  10. select  * from  v$db_object_cache where name ='SECURE_DML';

  11. begin
  12.    dbms_shared_pool.keep('HR.SECURE_DML');
  13. end;

复制代码

2014-11-08-B.txt:

  1. select  * from dba_rsrc_consumer_groups  order by 2;

  2. select * from dba_rsrc_consumer_group_privs;

  3. select * from dba_rsrc_group_mappings;

  4. select    s.TERMINAL,  s.RESOURCE_CONSUMER_GROUP
  5.   from v_$session s where s.TERMINAL in ('pts/4','pts/13');
  6.   
  7.   
  8.   
  9.   
  10. select  * from dba_rsrc_plans;

  11. select  * from dba_rsrc_plan_directives  pd where pd.plan='PLAN1';
复制代码

2014-11-08-C.txt:
  1. select  * from dba_rsrc_plan_directives  pd where pd.plan='PLAN1'  and pd.group_or_subplan='GROUP1';

  2. select   terminal,  status ,  s.RESOURCE_CONSUMER_GROUP  from v_$session   s  where s.RESOURCE_CONSUMER_GROUP='GROUP1'  ;

  3. select  * from v$transaction;


  4. BEGIN
  5. dbms_resource_manager.clear_pending_area();
  6. dbms_resource_manager.create_pending_area();
  7. dbms_resource_manager.update_plan_directive(
  8.     plan => 'PLAN1',
  9.     group_or_subplan => 'GROUP1',new_undo_pool => -1
  10.    
  11.    
  12.    
  13. );
  14. dbms_resource_manager.submit_pending_area();
  15. END;
复制代码

2014-11-08-D.txt:
  1. select bytes/1024/1024 from dba_segments s where s.owner='HR' and s.segment_name='TBIG';


  2. select  * from dba_rsrc_plan_directives  pd where pd.plan='PLAN1'  and pd.group_or_subplan='GROUP1';

  3. select   terminal,  status ,  s.RESOURCE_CONSUMER_GROUP  from v_$session   s  where s.RESOURCE_CONSUMER_GROUP='GROUP1'  ;

  4. select  * from v$transaction;


  5. BEGIN
  6. dbms_resource_manager.clear_pending_area();
  7. dbms_resource_manager.create_pending_area();
  8. dbms_resource_manager.update_plan_directive(
  9.     plan => 'PLAN1',
  10.     group_or_subplan => 'GROUP1',new_switch_time => -1,new_switch_group => ''
  11.    
  12.    
  13.    
  14. );
  15. dbms_resource_manager.submit_pending_area();
  16. END;


  17. select   username, terminal,  status ,  s.RESOURCE_CONSUMER_GROUP  from v_$session   s  where s.TERMINAL='pts/3';

  18. alter user sh identified by oracle_4U account unlock;

  19. select  username,  terminal,  status ,  s.RESOURCE_CONSUMER_GROUP  from v_$session   s  where s.TERMINAL='pts/1';

复制代码

2014-11-08-E.txt:
  1. select * from dba_rsrc_plans;

  2. select  * from dba_rsrc_plan_directives pd where pd.plan = 'PLAN2';

  3. BEGIN
  4. dbms_resource_manager.clear_pending_area();
  5. dbms_resource_manager.create_pending_area();
  6. dbms_resource_manager.create_plan( plan => 'PLAN2', comment => 'PLAN2',cpu_mth => 'ratio');
  7. dbms_resource_manager.create_plan_directive(
  8.     plan => 'PLAN2',group_or_subplan => 'SYS_GROUP',comment => '',
  9.    
  10.    
  11.     mgmt_p1 =>7
  12.   
  13. );
  14. dbms_resource_manager.create_plan_directive(
  15.     plan => 'PLAN2',
  16.     group_or_subplan => 'OTHER_GROUPS',comment => '',
  17.    
  18.     mgmt_p1 =>3
  19.    
  20.    

  21. );
  22. dbms_resource_manager.submit_pending_area();
  23. END;



  24. BEGIN
  25. dbms_resource_manager.clear_pending_area();
  26. dbms_resource_manager.create_pending_area();
  27. dbms_resource_manager.update_plan_directive(
  28.     plan => 'PLAN1',
  29.     group_or_subplan => 'SYS_GROUP',
  30.     new_mgmt_p4 => 60
  31. );
  32. dbms_resource_manager.update_plan_directive(
  33.     plan => 'PLAN1',
  34.     group_or_subplan => 'OTHER_GROUPS',
  35.     new_mgmt_p4 => 41
  36. );
  37. dbms_resource_manager.submit_pending_area();
  38. END;



  39. begin
  40.    dbms_resource_manager.create_simple_plan(simple_plan => 'PLAN3',consumer_group1 => 'GROUP1',
  41.    group1_cpu => 75,consumer_group2 => 'GROUP2',group2_cpu => 25);
  42.    end;



  43. select   pd.group_or_subplan,  pd.max_utilization_limit , pd.mgmt_p1   , pd.mgmt_p2, pd.mgmt_p3,pd.mgmt_p4   
  44. from dba_rsrc_plan_directives pd where pd.plan = 'PLAN1';




  45. BEGIN
  46. dbms_resource_manager.clear_pending_area();
  47. dbms_resource_manager.create_pending_area();
  48. dbms_resource_manager.update_plan_directive(
  49.     plan => 'PLAN1',
  50.     group_or_subplan => 'SYS_GROUP',new_max_utilization_limit => 99);
  51.   dbms_resource_manager.submit_pending_area();
  52. END;
  53.    
  54. select   pd.group_or_subplan,  pd.max_utilization_limit , pd.mgmt_p1   , pd.mgmt_p2, pd.mgmt_p3,pd.mgmt_p4   
  55. from dba_rsrc_plan_directives pd where pd.plan = 'PLAN1';



  56. SELECT name FROM v$rsrc_plan
  57. WHERE is_top_plan = 'TRUE' AND cpu_managed = 'ON';


  58. select  * from dba_rsrc_mapping_priority;

  59. select  * from DBA_RSRC_GROUP_MAPPINGS;
  60. select    s.TERMINAL,  s.RESOURCE_CONSUMER_GROUP
  61.   from v_$session s where s.TERMINAL in ('pts/9');
复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-5 03:12 , Processed in 0.031465 second(s), 24 queries .

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