首页 > 代码库 > oracle统计信息
oracle统计信息
手工刷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统计信息