本文為您介紹遷移 Oracle 資料庫的資料至 OceanBase 資料庫 Oracle 租戶時,CREATE TABLE DDL 支援的轉換範圍。
總覽
CREATE [table_prefix_options]
TABLE
[ schema_name. ] table_name
[ SHARING = {sharing_options} ]
{table_definition_options}
[ MEMOPTIMIZE FOR READ ][ MEMOPTIMIZE FOR WRITE ][ PARENT [ schema_name. ] table_name ];
table_definition_options
{ relational_table | object_table | XMLType_table }
支援建立關係表 relational_table,詳情請參見建立關係表。
不支援建立 Object 表和 XML 表(option:object_table、XMLType_table),轉換輸出空語句。
樣本一:
CREATE TYPE employees_typ AS OBJECT (e_no NUMBER, e_address CHAR(30)); CREATE TABLE employees_obj_t OF employees_typ (e_no PRIMARY KEY) OBJECT IDENTIFIER IS PRIMARY KEY; CREATE TABLE TABLE_TYPE_2 (d_no NUMBER, mgr_ref REF employees_typ SCOPE IS employees_obj_t);
樣本二:
CREATE TABLE TABLE_TYPE_3 OF XMLTYPE; CREATE TABLE TABLE_TYPE_4 OF XMLTYPE XMLSCHEMA "http://www.example.com/xwarehouses.xsd" ELEMENT "Warehouse"; CREATE TABLE TABLE_TYPE_5 (C1 NUMBER,C2 XMLTYPE) XMLTYPE SPEC STORE AS CLOB (TABLESPACE EXAMPLE STORAGE (INITIAL 6144) CHUNK 4000 NOCACHE LOGGING);
不支援
table_prefix_options
,關鍵字會被忽略。[ { GLOBAL | PRIVATE } TEMPORARY | SHARDED | DUPLICATED | [ IMMUTABLE ] BLOCKCHAIN | IMMUTABLE ]
不支援
sharing_options
,關鍵字會被忽略。樣本如下:{ METADATA | DATA | EXTENDED DATA | NONE }
不支援
MEMOPTIMIZE FOR READ
子句,會忽略該 option。樣本如下:CREATE TABLE MEMO_1 (C NUMBER) MEMOPTIMIZE FOR READ;
不支援
MEMOPTIMIZE FOR WRITE
子句,會忽略該 option。樣本如下:CREATE TABLE MEMO_2 (C NUMBER) MEMOPTIMIZE FOR WRITE;
不支援
PARENT [ schema_name. ] table
子句,會忽略該 option。樣本如下:CREATE SHARDED TABLE PARENT_1 (C NUMBER) PARENT PARENT_F;