maxyang2008

导航

dbms_stats VS analyze

analyze是执行”validate”验证功能的命令,主要内容包括:

  1. Analyze validate structure 验证表、簇、索引的结构的完整性,使用cascade选项可以交叉验证表和索引的数据完整,online选项可以做到在线验证
  2. Analyze list chained rows 收集表、簇上的Migrated and Chained Rows链式或迁移行信息
  3. Analyze table compute statistics 收集表上的 empty_blocks、avg_space 空间使用信息
  4. Analyze Cluster 收集簇的信息,其实cluster上唯一可统计的信息是DBA_CLUSTERS.AVG_BLOCKS_PER_KEY(Number of blocks in the table divided by number of cluster keys) , 所以收集cluster的statistics意义不大

DBMS_STATS包负责统计信息的管理,主要收集CBO相关的统计信息。

如果你只是想收集统计信息提高CBO准确性,就用dbms_stats吧,如果你是想验证一些东西,看analyze是否可以实现。

注:以上内容总结自maclean的文章http://www.askmaclean.com/archives/what-dbms_stats-can-not-but-analyze-can-do.html

posted on 2016-07-27 23:04  Maxwell_Yang  阅读(74)  评论(0编辑  收藏  举报