请问如何建立分区索引?
能简单介绍一下吗?

解决方案 »

  1.   

    分区索引分为:局部分区索引和全局分区索引
    (1)局部分区索引:
    create index <idx_name> on <table_name>(col_name)
    local
    (partition <par_idx_name> [tablespace ts_name],
    partition <par_idx_name> [tablespace ts_name]
    ...--------------------------------------------表有多少分区,就在此指定多少个子句.
    )(2)全局索引:
    create index <idx_name> on <table_name>(col_name)
    global partition by range (col_name)
    (
    partition <par_idx_name> values less than(value) [tablespace ts_name],
    partition <par_idx_name> values less than(value) [tablespace ts_name],
    ...------------------------------------------表有多少分区,就在此指定多少个子句.
    )(3)也可以直接在分区表上创建索引
    create index <idx_name> on <table_name>(col_name)