设为首页 加入收藏

TOP

Oracle分析表简介
2014-11-24 08:16:37 来源: 作者: 【 】 浏览:1
Tags:Oracle 分析 简介
Oracle分析表是Oracle 数据库管理的重要部分,下面就为您详细介绍 Oracle分析表方面的知识,希望对您学习Oracle分析表方
面能有所帮助。
1、分析SQL:
analyze table tablename compute statistics
等同于 analyze table tablename compute statistics for table for all indexes for all columns
for table的统计信息存在于视图:user_tables 、all_tables、dba_tables
for all indexes的统计信息存在于视图: user_indexes 、all_indexes、dba_indexes
for all columns的统计信息存在于试图:user_tab_columns、all_tab_columns、dba_tab_columns
删除分析SQL:
analyze table tablename delete statistics 会删除所有的statistics
2、Oracle分析表的作用:为了使基于CBO的执行计划更加准确
DBA_tables的数据有变化,可做对比。详见官方文档:
Use the ANALYZE statement to collect non-optimizer statistics, for example, to:
Collect or delete statistics about an index or index partition, table or table partition, index-organized
table, cluster, or scalar object attribute.
Validate the structure of an index or index partition, table or table partition, index-organized table,
cluster, or object reference (REF)。
Identify migrated and chained rows of a table or cluster.
dbms_stats的作用主要是替代analyze的收集统计信息这一块的功能,且在这一方面做了相当大程度上的增强。
以analyze table table_name compute statistics;这条为例,生成的统计信息会存在于user_tables这个视图,查看一下
select * from user_tables where table_name=table_name;
观察一下NUM_ROWS,BLOCKS,AVG_SPACE,AVG_ROW_LEN几列你就会明白,这就是变化。
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇11GConcept第四章翻译Partitions,.. 下一篇oracle禁用操作系统认证方式登陆..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Java 集合框架 - 菜 (2025-12-27 02:19:36)
·Java集合框架最全详 (2025-12-27 02:19:33)
·为什么安卓开发要用J (2025-12-27 02:19:30)
·C/C++ 类模板与模板 (2025-12-27 01:49:52)
·C语言 模板化<templ (2025-12-27 01:49:49)