码迷,mamicode.com
首页 > 数据库 > 详细

oracle统计信息

时间:2014-10-23 10:50:33      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:application   database   oracle   数据库   dba   

手工刷ORACLE统计信息
 select count(1) from LOG_TRX_DETAIL;
 select * from user_tab_statistics where table_name = ‘LOG_TRX_DETAIL‘;
 exec dbms_stats.gather_table_stats(‘ARDB‘,‘ACCT_BALANCE‘,cascade => true);
 exec dbms_stats.gather_table_stats(‘ARDB‘,‘LOG_TRX‘,cascade => true);
 exec dbms_stats.gather_table_stats(OWNNAME=>‘ARDB‘,TABNAME=>‘LOG_TRX_DETAIL‘,GRANULARITY=>‘ALL‘,ESTIMATE_PERCENT=>5,DEGREE=>4,CASCADE=>TRUE);
 exec dbms_stats.gather_table_stats(OWNNAME=>‘ARDB‘,TABNAME=>‘ACCT_BALANCE‘,GRANULARITY=>‘ALL‘,ESTIMATE_PERCENT=>5,DEGREE=>4,CASCADE=>TRUE);
 execute dbms_stats.gather_table_stats(ownname => ‘ARDB‘,tabname => ‘TRANS_DETAIL‘, estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE ,method_opt => ‘FOR ALL COLUMNS SIZE 1‘,no_invalidate=>false, DEGREE=>8, cascade => true);
 exec dbms_stats.gather_table_stats(‘ARDB‘, ‘LOG_TRX‘, ‘P201301‘, granularity => ‘PARTITION‘, DEGREE=>4, cascade => true);
 exec dbms_stats.gather_table_stats(‘ARDB‘, ‘LOG_TRX_DETAIL‘, ‘P201301‘, granularity => ‘PARTITION‘, DEGREE=>4, cascade => true);
 alter system flush shared_pool;

 关闭统计信息更新
 begin
 DBMS_AUTO_TASK_ADMIN.DISABLE(client_name => ‘auto optimizer stats collection‘,
 operation => NULL,
 window_name => NULL);
 end;
 /
 
 通过视图DBA_AUTOTASK_WINDOW_CLIENTS可以查看他们一周七天的执行情况
 select * from DBA_AUTOTASK_WINDOW_CLIENTS;

oracle统计信息

标签:application   database   oracle   数据库   dba   

原文地址:http://blog.csdn.net/jenya007/article/details/40391437

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!