微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

11g 自动收集统计信息

13Automatic Optimizer Statistics Collection

打开:

BEGIN
  DBMS_AUTO_TASK_ADMIN.ENABLE(
     client_name => 'auto optimizer stats collection' 
,    operation   => NULL
,    window_name => NULL
);
END;
/

关闭

BEGIN
  DBMS_AUTO_TASK_ADMIN.disABLE(
     client_name => 'auto optimizer stats collection'
,    operation   => NULL 
,    window_name => NULL
);
END;
/

数据库监视这每个表的变化信息,当变化超过10%就自动收集统计信息:

查询统计信息是否过期?DBA_TAB_STATISTICS)

Monitoring tracks the approximate number of INSERTs, UPDATEs, and DELETEs for that table and whether the table has been truncated since the last time statistics were gathered. You can access information about changes of tables in the USER_TAB_MODIFICATIONS view. Following a data-modification, there may be a few minutes delay while Oracle Database propagates the information to this view. Use the DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO procedure to immediately reflect the outstanding monitored information kept in the memory.

The GATHER_DATABASE_STATS or GATHER_SCHEMA_STATS procedures gather new statistics for tables with stale statistics when the OPTIONS parameter is set to GATHER STALE orGATHER AUTO. If a monitored table has been modified more than 10%, then these statistics are considered stale and gathered again.

When to Use Manual Statistics?
  • Volatile tables that are deleted or truncated and rebuilt during the course of the day.

  • Objects that are the target of large bulk loads which add 10% or more to the object's total size.

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐