Home > Database > Mysql Tutorial > body text

dbms_stats包的使用说明书

WBOY
Release: 2016-06-07 17:18:14
Original
1329 people have browsed it

dbms_stats包下面一共有40多个存储过程. 对执行计划的生成非常重要。常见的有:分析数据库(包括所有的用户对象和系统对象):ga

dbms_stats包下面一共有40多个存储过程. 对执行计划的生成非常重要。常见的有:
分析数据库(包括所有的用户对象和系统对象):gather_database_stats
分析用户所有的对象(包括表、索引、簇):gather_schema_stats
分析表:gather_table_stats
分析索引:gather_index_stats
删除数据库统计信息:delete_database_stats
删除用户方案统计信息:delete_schema_stats
删除表统计信息:delete_table_stats
删除索引统计信息:delete_index_stats
删除列统计信息:delete_column_stats
设置表统计信息:set_table_stats
设置索引统计信息:set_index_stats
设置列统计信息:set_column_stats
可以查看表 DBA_TABLES来查看表是否与被分析过,,如:
SELECT TABLE_NAME, LAST_ANALYZED FROM DBA_TABLES
通常使用的比较多的主要是DBMS_STATS.GATHER_TABLE_STATS和 DBMS_STATS.GATHER_INDEX_STATS。

注释:
ownname:要分析表的拥有者
tabname:要分析的表名.
partname:分区的名字,只对分区表或分区索引有用.
estimate_percent:这个参数相当于analyze中的"estimate statistics sample x percent".为总行数的百分比来估算.如果该参数为空.则为compute,当然也可以使用DBMS_STATS.AUTO_SAMPLE_SIZE 让Oracle 来决定估算百分比数
block_sample:该参数是一个boolean.在决定是否进行随机采样.
method_opt :该参数表明数据颁布不均衡的情况下是否使用直方图。可选值为"for all columns 或者for all indexed columns.当然也可以使用auto.让oracle来决定收集
degree     :parallel degree(并行收集维度) 看CPU个数
cascade :决定是否收集相关表的索引的统计信息.
force:即使表锁住了也收集统计信息.

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!