Bo's Oracle Station

查看: 2606|回复: 0

第61次:2016-03-09星期三

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2016-3-11 10:06:26 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2016-3-11 10:13 编辑

2016-03-09a.sql:
  1. select  * from v$flashback_Database_log;
  2. --2033347
  3. select  bytes/1024/1024, file_name
  4. from dba_data_files  where tablespace_name='USERS';

  5. select  bytes/1024/1024
  6.   from dba_free_space where tablespace_name='USERS';
  7.   
  8.   alter database datafile '+DATA/orcl/datafile/users.259.816169553' resize 97M;
  9.   
  10.   --2056303
  11.   
  12.   select  * from v$restore_point;
  13.   
复制代码

2016-03-09b.sql:
  1. select  * from v$transaction;
  2. --00000001EAEAEE78



  3. ---
  4. select  s.USERNAME,

  5.    s.RESOURCE_CONSUMER_GROUP
  6.    
  7. from v_$session s
  8. where s.TERMINAL  ='pts/1';
  9. select  * from dba_rsrc_plan_directives  d where d.plan='PLAN1';
  10. ---

  11. select  bytes/1024/1024  from dba_segments s
  12.    where s.owner='HR' and s.segment_name ='T04209_UNAME';
  13.    ---
  14.    
  15.    alter tablespace users add datafile '/home/oracle/users02.dbf' size 1G autoextend on;
  16.    
  17.    ---
  18.    SELECT begin_time, consumer_group_name, cpu_consumed_time, cpu_wait_time
  19. FROM v$rsrcmgrmetric_history
  20. ORDER BY begin_time;

  21. ---
  22. SELECT name, consumed_cpu_time, cpu_wait_time
  23. FROM v$rsrc_consumer_group;

  24. ---

  25. select * from dba_rsrc_mapping_priority;

  26. begin
  27.    dbms_resource_manager.clear_pending_area;
  28.    dbms_resource_manager.create_pending_area();
  29.    dbms_resource_manager.set_consumer_group_mapping_pri(
  30.     client_os_user => 2,
  31.     explicit => 1,
  32.    oracle_user =>3 ,
  33.     service_name => 4,   
  34.     client_program =>5 ,
  35.    client_machine =>6 ,
  36.    module_name => 7,
  37.    module_name_action =>8 ,
  38.    service_module =>9 ,
  39.    service_module_action =>10
  40.   );
  41.   dbms_resource_manager.submit_pending_area();
  42. end;

  43. select  * from dba_rsrc_group_mappings;


  44. begin
  45.   dbms_resource_manager.create_simple_plan(simple_plan =>'PLAN4' ,
  46.                                      consumer_group1 =>'GROUP1' ,group1_cpu =>55 ,
  47.                                      consumer_group2 => 'GROUP2',group2_cpu => 45,
  48.                                      group1_percent => 70,group2_percent =>60 );
  49.       end;
  50. --
  51. alter user sh identified by sh account unlock;

  52. ---
  53. select  s.USERNAME,

  54.    s.RESOURCE_CONSUMER_GROUP
  55.    
  56. from v_$session s
  57. where s.TERMINAL  ='pts/7';
  58. grant execute on jobclass1 to hr;


复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

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

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