Home > dbms_stats, oracle > exec FLUSH DATABASE MONITORING INFO;

exec FLUSH DATABASE MONITORING INFO;

使用命令:
exec dbms_stats.FLUSH_DATABASE_MONITORING_INFO;

For performance reasons, the Oracle Database does not populate these views immediately when the actual modifications occur.
Run the FLUSH_DATABASE_MONITORING_INFO procedure in the DIMS_STATS PL/SQL package to populate these views with the latest information.

每15分钟,smon会刷新统计结果到数据字典中,oracle使用这些表的数据去判断表的统计数据是否过期,
如果当表的数据改变超过10%,oracle就认为该表的统计数据已经过期.
Oracle 10g默认表是 monitoring,即使表在建立的时候指定是nomonitoring也是会被忽忽略的
这是由参数:statistics_level决定的, 默认值=TYPICAL
如果设置为BASIC将disable monitoring

系统将自动收集表的统计信息(由GATHER_STATS_JOB完成,
可以通过 EXEC DBMS_SCHEDULER.DISABLE(‘GATHER_SCHEDULER_JOB’)来取消系统自动收集),
且每3个小时由SMON写入到数据字典(USER_TABLES.NUM_ROWS)里。

经过更深入的研究,发现8i之前,数据库是每3小时自动将SGA的信息FLUSH到DBA_TAB_MODIFICATIONS中,而9i将这个时间改成每15分钟.
在10.2.0.3中测试发现,这个视图并不会自动刷新,且通过exec dbms_stats.FLUSH_DATABASE_MONITORING_INFO手动刷新时也存在一个bug,即timestamp 栏位的内容不会改变.在10.2.0.4中已修复了此bug.

Categories: dbms_stats, oracle Tags:
  1. No comments yet.
  1. No trackbacks yet.

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin