{"id":223,"date":"2016-12-22T17:12:18","date_gmt":"2016-12-22T09:12:18","guid":{"rendered":"http:\/\/www.lisq.net.cn\/?p=223"},"modified":"2016-12-22T17:12:18","modified_gmt":"2016-12-22T09:12:18","slug":"11g-auto-optimizer-stats-determining-stale-statistics","status":"publish","type":"post","link":"https:\/\/www.lisq.net\/?p=223","title":{"rendered":"11g auto optimizer stats-Determining Stale Statistics"},"content":{"rendered":"<p>\u53c2\u8003\u8d44\u6599 http:\/\/docs.oracle.com\/cd\/E11882_01\/server.112\/e41573\/stats.htm#PFGRF95153<\/p>\n<p>You must regularly gather statistics on database objects as these database objects are modified over time. To determine whether a given database object needs new database statistics, Oracle Database provides a table monitoring facility. This monitoring is enabled by default when <code>STATISTICS_LEVEL<\/code> is set to <code>TYPICAL<\/code> or <code>ALL<\/code>.<\/p>\n<p>Monitoring tracks the approximate number of <code>INSERT<\/code>s, <code>UPDATE<\/code>s, and <code>DELETE<\/code>s 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 <code>USER_TAB_MODIFICATIONS<\/code> view. Following a data-modification, there may be a few minutes delay while Oracle Database propagates the information to this view. Use the <code>DBMS_STATS.FLUSH_DATABASE_MONITORING_INFO<\/code> procedure to immediately reflect the outstanding monitored information kept in the memory.<\/p>\n<p>The <code>GATHER_DATABASE_STATS<\/code> or <code>GATHER_SCHEMA_STATS<\/code> procedures gather new statistics for tables with stale statistics when the <code>OPTIONS<\/code> parameter is set to <code>GATHER<\/code> <code>STALE<\/code> or <code>GATHER<\/code> <code>AUTO<\/code>. <a id=\"sthref1152\"><\/a>If a monitored table has been modified more than 10%, then these statistics are considered stale and gathered again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u8d44\u6599 http:\/\/docs.oracle.com\/cd &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[4],"tags":[],"class_list":["post-223","post","type-post","status-publish","format-standard","hentry","category-4"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7zRbQ-3B","_links":{"self":[{"href":"https:\/\/www.lisq.net\/index.php?rest_route=\/wp\/v2\/posts\/223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lisq.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lisq.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lisq.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lisq.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=223"}],"version-history":[{"count":2,"href":"https:\/\/www.lisq.net\/index.php?rest_route=\/wp\/v2\/posts\/223\/revisions"}],"predecessor-version":[{"id":225,"href":"https:\/\/www.lisq.net\/index.php?rest_route=\/wp\/v2\/posts\/223\/revisions\/225"}],"wp:attachment":[{"href":"https:\/\/www.lisq.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lisq.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lisq.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}