Oracle分析表简介

数据库 Oracle
在Oracle数据库管理中,分析表的重要性不言而喻,下文对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几列你就会明白,这就是变化。
 

 

 

【编辑推荐】

oracle服务丢失的处理方法

Linux下Oracle数据库启动的方法

Oracle重做日志的实现方法

Oracle归档日志大小的修改方法

Oracle密码丢失的两种解决方法

责任编辑:段燃 来源: 互联网
相关推荐

2010-05-10 10:06:45

Oracle查询表名

2011-07-14 10:53:54

TKPROFOracle

2011-08-18 16:30:10

Oracle锁表查询kill进程

2009-11-18 16:43:59

2009-11-19 11:00:55

Oracle xmlt

2010-10-28 10:54:46

oracle对象权限

2009-11-16 11:03:44

Oracle INDE

2010-11-15 12:02:24

Oracle进程结构

2010-10-25 17:28:05

Oracle bita

2010-10-25 15:12:42

Oracle日期函数

2010-11-22 14:27:05

MySQL锁表

2011-04-12 13:27:09

Oracle日期函数

2010-10-25 17:39:24

Oracle单行日期函

2010-11-18 13:09:19

Oracle case

2023-10-11 06:50:32

Oracle数据库系统

2015-08-21 12:59:38

Oracle数据库

2010-10-26 17:41:05

Oracle索引

2010-10-26 11:39:51

Oracle EXPIMP备份

2010-10-25 14:47:49

Oracle系统变量函

2009-11-03 10:09:33

Oracle表空间
点赞
收藏

51CTO技术栈公众号