ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 收集global partition index 统计信息

收集global partition index 统计信息

原创 Linux操作系统 作者:。豆芽。 时间:2012-10-10 13:20:46 0 删除 编辑
在以下版本中使用dbms_stats 收集的信息有误
Oracle 9i Release 2 (9.2.0)
Oracle Database 10g Release 1(10.1.0)
原因是有bug
BUG:3491127
在Oracle Database 10g Release 2(10.2.0)中修复
SQL> create table test
  2  (col1 number(5) ,
  3  col2 number(3)
  4  )
  5  partition by range(col1,col2)
  6  (partition p1 values less than (1,6) ,
  7  partition p2 values less than (maxvalue,maxvalue)
  8  )
  9  ;

Table created.

SQL> select * from test;

      COL1       COL2
---------- ----------
         1          1
         1          2
         1          3
         1          4
         1          5
         2          1

6 rows selected.

SQL>  create index idx_test on test
(
  col1 ,
  col2
)
global partition by range(col1,col2)
(
partition p1 values less than (1,6) ,
partition p2 values less than (maxvalue,maxvalue)
);

Index created.

SQL>  exec dbms_stats.gather_index_stats( wnname => 'sys', indname => 'IDX_TEST');

PL/SQL procedure successfully completed.

SQL> select partition_name, num_rows from user_ind_partitions where
PARTITION_NAME='P1' or PARTITION_NAME='P2';

PARTITION_NAME                   NUM_ROWS
------------------------------ ----------
P1                                      5
P2                                      1
统计信息正确

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24756186/viewspace-746060/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 开启em
下一篇: 动态注册监听
请登录后发表评论 登录
全部评论

注册时间:2010-11-23

  • 博文量
    38
  • 访问量
    72349