Bo's Oracle Station

查看: 1194|回复: 0

2014-0-09-2.sql

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2014-8-9 20:40:28 | 显示全部楼层 |阅读模式
  1. select  e.employee_id, d.department_name
  2. from hr.employees e, hr.departments d
  3. where e.department_id=d.department_id;

  4. select  t.table_name , t.owner  , t.num_rows
  5.    from dba_tables t  where t.table_name='T04209_UNAME';
  6.    
  7.    select    i.index_name, i.owner  , i.blevel , i.leaf_blocks
  8.        from dba_indexes i where i.owner='HR' and i.table_name='T04209_UNAME';
  9. select  * from dba_tab_col_statistics  tcs where tcs.table_name='T04209_UNAME';



  10. select *  from  dict where  table_name like '%HISTOG%';           


  11. select  *  from DBA_TAB_HISTOGRAMS  th where th.table_name='T04209_UNAME';


  12. begin
  13.    dbms_stats.gather_database_stats;
  14. end;

  15. select  * from  DBA_TAB_STAT_PREFS ;

  16. begin
  17. dbms_stats.set_table_prefs(ownname => 'HR',
  18. tabname => 'T04209_UNAME',pname => 'METHOD_OPT',     pvalue=> 'for columns   uvalue  size 100') ;
  19. end;

  20. begin
  21.     dbms_stats.gather_table_stats('HR','T04209_UNAME');
  22. end;
  23. select  * from dba_tab_col_statistics  tcs where tcs.table_name='T04209_UNAME';


  24. begin
  25. DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE (
  26.         start_snap_id =>30,
  27.         end_snap_id  =>31,
  28.         baseline_name =>'MYBASELINE2');
  29.         
  30.         end;
复制代码


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-29 04:27 , Processed in 0.038713 second(s), 24 queries .

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