本篇内容主要讲解“如何查看oracle统计信息收集”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“如何查看oracle统计信息收集”吧!
查看统计信息收集时间:
alter session set NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
select t.TABLE_NAME,t.NUM_ROWS,t.BLOCKS,t.LAST_ANALYZED from dba_tables t where owner='SAPSR3' and table_name in ('ZWD_JDMSG_GD','ZB2C_KUCUN_LOG');
刷新数据库监控信息:
exec dbms_stats.flush_database_monitoring_info;
查看统计信息是否过期(stats为yes为过期)
select owner,table_name,object_type,stale_stats,last_analyzed from dba_tab_statistics where owner='SAPSR3' and table_name in ('ZHLES_LOG_JPD','ZJHT0005_LOG');
查看过期原因:
select table_owner,table_name,inserts,updates,deletes,timestamp from all_tab_modifications where table_owner='SAPSR3' and table_name in ('ZHLES_LOG_JPD','ZJHT0005_LOG');
统计信息收集:
exec DBMS_STATS.GATHER_TABLE_STATS(ownname => 'SAPSR3',tabname => 'ZWD_JDMSG_GD',estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'for all columns size repeat',degree => DBMS_STATS.AUTO_DEGREE,cascade=>TRUE );
到此,相信大家对“如何查看oracle统计信息收集”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!