创建表概述
本文为您介绍迁移 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;