ITPub博客

首页 > 数据库 > Oracle > oracle统计信息收集

oracle统计信息收集

Oracle 作者:yangmm 时间:2020-08-10 10:07:17 0 删除 编辑
查看统计信息收集时间:
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  );


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69963160/viewspace-2710380/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: ORACLE 体系结构
下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2020-02-21

  • 博文量
    9
  • 访问量
    10147