Bo's Oracle Station

查看: 2487|回复: 0

第56次:2016-02-26星期五

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2016-2-29 10:12:41 | 显示全部楼层 |阅读模式
select  * from v$sysstat;

select t.num_rows, t.last_analyzed
  from dba_tables t
where t.owner = 'HR'
   and t.table_name = 'T04209_UNAME';
   
select  * from dba_tab_col_statistics tcs
  where tcs.owner='HR' and tcs.table_name='T04209_UNAME';
  
  begin
     dbms_stats.gather_table_stats(ownname => 'HR',
                                                         tabname =>'EMPLOYEES',
                                                         estimate_percent => 100,
                                                         method_opt =>'for  columns  salary  size 254'  );
   end;                                                      
                 
   select t.num_rows, t.last_analyzed
  from dba_tables t
where t.owner = 'HR'
   and t.table_name = 'T04209_UNAME';
   
select  * from dba_tab_col_statistics tcs
  where tcs.owner='HR' and tcs.table_name='T04209_UNAME';
     
  
   select  * from dba_tab_col_statistics tcs
  where tcs.owner='HR' and tcs.table_name='EMPLOYEES';


select  * from dba_tab_pending_stats;
select  * from dba_tab_histgrm_pending_stats;



begin
dbms_stats.gather_table_stats('HR','EMPLOYEES');

end;

select t.last_analyzed
  from dba_tables t
where t.owner = 'HR'
   and t.table_name = 'EMPLOYEES';

begin
   dbms_stats.publish_pending_stats('HR','EMPLOYEES');
end;


begin
   dbms_workload_repository.create_baseline(start_snap_id => 13,
                                                        end_snap_id => 14,
                                                        baseline_name => 'PRESERVE1314');
   end;
   


回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-3-28 17:32 , Processed in 0.049170 second(s), 24 queries .

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