Fixed Objects Statistics and why they are important
来源:互联网 发布:泽田慎 知乎 编辑:程序博客网 时间:2024/06/16 10:38
Fixed Object statistics must be manually gathered. They are not created or maintained by the automatic statistics gathering job. You can collect statistics on fixed objects using DBMS_STATS.GATHER_FIXED_OBJECTS_STATS.BEGIN
DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
END;
The DBMS_STATS.GATHER_FIXED_OBJECTS_STATS procedure gathers the same statistics asDBMS_STATS.GATHER_TABLE_STATS except for the number of blocks. Blocks is always set to 0 since the x$ tables are in memory structures only and are not stored on disk. You must have the ANALYZE ANY DICTIONARY or SYSDBAprivilege or the DBA role to update fixed object statistics.
Because of the transient nature of the x$ tables it is import that you gather fixed object statistics when there is a representative workload on the system. This may not always be feasible on large system due to additional resource need to gather the statistics. If you can’t do it during peak load you should do it after the system has warmed up and the three key types of fixed object tables have been populated:
Structural data - for example, views covering datafiles, controlfile contents, etcSession based data - for example, v$session, v$access, etc.
Workload data - for example, v$sql, v$sql_plan,etc
It is recommended that you re-gather fixed object statistics if you do a major database or application upgrade, implement a new module, or make changes to the database configuration. For example if you increase the SGA size then all of the x$ tables that contain information about the buffer cache and shared pool may change significantly, such as x$ tables used in v$buffer_pool or v$shared_pool_advice.
The following SQL*Plus script can be used to determine the status of these statistics. It does not check statistics for other internal schemas like for example SYSTEM as these are less critical. If needed, the WHERE-clause in the first query can to be modified accordingly.
alter session set nls_date_format='YYYY-Mon-DD';
col last_analyzed for a13
set termout off
set trimspool off
set feedback off
spool dictionary_statistics
prompt 'Statistics for SYS tables'
SELECT NVL(TO_CHAR(last_analyzed, 'YYYY-Mon-DD'), 'NO STATS') last_analyzed, COUNT(*) dictionary_tables
FROM dba_tables
WHERE owner = 'SYS'
GROUP BY TO_CHAR(last_analyzed, 'YYYY-Mon-DD')
ORDER BY 1 DESC;
prompt 'Statistics for Fixed Objects'
select NVL(TO_CHAR(last_analyzed, 'YYYY-Mon-DD'), 'NO STATS') last_analyzed, COUNT(*) fixed_objects
FROM dba_tab_statistics
WHERE object_type = 'FIXED TABLE'
GROUP BY TO_CHAR(last_analyzed, 'YYYY-Mon-DD')
ORDER BY 1 DESC;
参考文档:
Fixed Objects Statistics(GATHER_FIXED_OBJECTS_STATS) Considerations (Doc ID 798257.1)
- Fixed Objects Statistics and why they are important
- Fixed Objects Statistics and why they are important
- why software are important
- why-they-are-using-vi
- Why Prepared Statements are important and how to use them "properly"
- Why Coaching and Mentoring is Important?
- Windows CE: Prefetch Aborts, why they are difficult to locate
- Windows CE: Prefetch Aborts, why they are difficult to locate
- Humility and assertiveness.... are they mutually exclusive?
- English and Schedule are very important!
- Why are the letters in the English "alphabet" in the order that they are?
- Applications, Resumes and Interviews Why They Go Together
- Destructors That Throw and Why They're Evil
- Why Good Programmers Are Lazy and Dumb
- What Is UTF-8 And Why Is It Important?
- Hot reloading and time travel debugging: what are they?
- Item4: Make sure that objects are initialized before they're used
- Item 04 : Make sure that objects are initialized before they're used.
- C++代码检查
- 3DMAX导出插件编写(续)
- VS2010中“转到定义”提示“未能找到符号”的解决方法
- Button形状和背景色的设置
- Android类-ContentProvider
- Fixed Objects Statistics and why they are important
- PHP上传文件大小限制 (Nginx + PHP)
- UIButton的响应点击事件
- TIzstack中关于外部中断中采用轮询方式的bug
- 手把手将maven工程部署到Myeclipse
- 在vs2010中如何自动给函数或者类加上注释
- iOS 多线程之GCD使用
- Java中native关键字
- 从头认识java-1.5 继承(2)