甲骨文里收集与查看统计信息的方法

  

<李>

<李>

<李>

<李>

<李>

典型用法如下:

zx@ORCL> create  table  t2  as  select  *,得到dba_objects;      Table 创建。      zx@ORCL> create  index  idx_t2 提醒t2 (object_id);      Index 创建。      zx@ORCL> analyze  index  idx_t2  delete 统计;      Index 分析。

zx@ORCL> select  count(*),得到t2;      ,,COUNT (*)   ----------   ,,,,86852年

zx@ORCL> analyze  table  t2  estimate  statistics  sample  15, percent  for 表;      Table 分析。

zx@ORCL> analyze  table  t2  compute  statistics  for 表;      Table 分析。

zx@ORCL> analyze  table  t2  compute  statistics  for  columns  object_name, object_id;      Table 分析。

zx@ORCL> analyze  table  t2  compute  statistics  for  table  for  columns  object_name, object_id;      Table 分析。

zx@ORCL> analyze  index  idx_t2  compute 统计;      Index 分析。

zx@ORCL> analyze  table  t2  delete 统计;      Table 分析。

zx@ORCL> analyze  table  t2  compute 统计;      Table 分析。

<李>

<李>

<李>

分析表t2删除数据;

zx@ORCL> exec  dbms_stats.gather_table_stats (ownname=祝辞ZX, tabname=在t2, estimate_percent=在15日method_opt=祝辞FOR 表,级联=祝辞假);      PL/SQL  procedure  successfully 完成。


exec dbms_stats.gather_table_stats (ownname=祝辞ZX, tabname=在T2, estimate_percent=祝辞;100年,method_opt=在“表”,级联=祝辞假),

exec dbms_stats.gather_table_stats (ownname=祝辞ZX, tabname=在T2, estimate_percent=祝辞NULL, method_opt=在“表”,级联=祝辞假),

zx@ORCL> exec  dbms_stats.gather_table_stats (ownname=祝辞ZX, tabname=在T2, estimate_percent=祝辞;100年,method_opt=祝辞FOR 表,级联=祝辞假);      PL/SQL  procedure  successfully 完成。

zx@ORCL> exec  dbms_stats.gather_table_stats (ownname=祝辞ZX, tabname=在T2, estimate_percent=祝辞;100年,method_opt=祝辞的for  columns  size  1, object_name, object_id”,级联=祝辞假);      PL/SQL  procedure  successfully 完成。

zx@ORCL> exec  dbms_stats.gather_index_stats (ownname=祝辞ZX, indname=祝辞IDX_T2, estimate_percent=祝辞;100);      PL/SQL  procedure  successfully 完成。

zx@ORCL> exec  dbms_stats.delete_table_stats (ownname=祝辞ZX, tabname=在T2);      PL/SQL  procedure  successfully 完成。

zx@ORCL> exec  dbms_stats.gather_table_stats (ownname=祝辞ZX, tabname=在T2, estimate_percent=祝辞;100年,级联=祝辞真实);      PL/SQL  procedure  successfully 完成。

exec  dbms_stats.gahter_table_stats (ownname=祝辞斯科特,tabname=在T1,级联=祝辞;的确,estimate_percent=祝辞;100年,学位=祝辞;4);

<强>,附件是sosi脚本可以下载使用。

甲骨文里收集与查看统计信息的方法