文档

创建索引概述

更新时间:

本文为您介绍迁移 Oracle 数据库的数据至 OceanBase 数据库 Oracle 租户时,CREATE INDEX DDL 的支持转换范围。

总览

CREATE [ UNIQUE | BITMAP ] INDEX [ schema_name. ] index_name
  ON { cluster_index_clause
     | table_index_clause
     | bitmap_join_index_clause
     }
[ USABLE | UNUSABLE ]
[ { DEFERRED | IMMEDIATE } INVALIDATION ] ;


table_index_clause:
[ schema. ] table [ t_alias ]
(index_expr [ ASC | DESC ]
  [, index_expr [ ASC | DESC ] ]...)
  [ index_properties ]

index_properties:
[ { { global_partitioned_index
    | local_partitioned_index
    }
  | index_attributes
  }...
| INDEXTYPE IS { domain_index_clause
               | XMLIndex_clause
               }
]

cluster_index_clause:
CLUSTER [ schema. ] cluster 

index_attributes:
[ { physical_attributes_clause
  | logging_clause
  | ONLINE
  | TABLESPACE { tablespace | DEFAULT }
  | index_compression
  | { SORT | NOSORT }
  | REVERSE
  | VISIBLE | INVISIBLE
  | partial_index_clause
  | parallel_clause
  }...
]

bitmap_join_index_clause:
[ schema.]table
   ( [ [ schema. ]table. | t_alias. ]column
     [ ASC | DESC  ]
       [, [ [ schema. ]table. | t_alias. ]column
          [ ASC | DESC ]
       ]...
   )
   FROM [ schema. ]table [ t_alias ]
          [, [ schema. ]table [ t_alias ]
        ]...
   WHERE condition
      [ local_partitioned_index ] index_attributes

支持的范围

  • 支持 UNIQUE INDEX 唯一键索引。

  • 支持普通索引 INDEX。

  • 支持 table_index_clause 子句定义普通索引、唯一键索引,详情请参见 普通表索引

不支持的范围

  • 不支持 cluster_index_clause 子句定义 CLUSTER INDEX,会报错。

  • 不支持 bitmap_join_index_clause 子句定义 BITMAP INDEX,会报错。

忽略的属性

说明

如果同步的 DDL 中包含以下属性的定义,则这些属性不会被解析和转换,最终会被忽略。

  • 关键字 USABLEUNUSABLE 定义 index 是否可用,会忽略该 option。

  • 关键字 BITMAP INDEX 位图索引,会忽略 BITMAP,创建普通索引。

  • 关键字 DEFERRED INVALIDATION 延迟失效和IMMEDIATE INVALIDATION 立即失效用于在创建索引时,控制数据库何时使依赖指针失效,会忽略该 option。

  • 本页导读 (0)
文档反馈