同构数据库ORACLE—>ORACLE支持列表

一、字段转化对照表

源库oracle字段类型 加载至目标库oracle字段类型 是否支持
CHAR(size) CHAR(size) 是
NCHAR(size) CHAR(size) 是
VARCHAR2(size) CLOB 是,转换为CLOB
NVARCHAR2(size) NVARCHAR2(size) 是
NUMBER(p,s) DICIMAL(p,s) 是
DECIMAL(p,s) NUMBER(p,s) 是
INTEGER NUMBER 是
FLOAT NUMBER 是
BINARY_FLOAT NUMBER 是
BINARY_DOUBLE NUMBER 是
REAL NUMBER 是
DATE DATE 是
TIMESTAMP TIMESTAMP 是
TIMESTAMP(6) WITH TIME ZONE TIMESTAMP 是
TIMESTAMP(6) WITH LOCAL TIME ZONE VARCHAR 是,转化为varchar型
BLOB BLOB 是
CLOB CLOB 是
NCLOB CLOB 是
LONG CLOB 是
RAW RAW 是
LONG RAW BLOB 是

二、DDL语句支持列表

语句类型 语句概要 SQL ORACLE-->MYSQL是否支持
创建表 数值型 create table oracle_tab1 (test_1 number(38) primary key,test_2 number(38,29),test_3 integer,test_4 float(126),test_5 binary_float,test_6 binary_double); 是
字符型 create table oracle_tab2 (test_1 number(38) primary key,test_2 char(255),test_3 varchar2(4000),test_4 nvarchar2(2000),test_5 varchar(30)); 是
日期型 create table oracle_tab3 (test_1 number(38) primary key,test_2 date,test_3 timestamp,test_4 TIMESTAMP WITH LOCAL TIME ZONE,test_5 TIMESTAMP WITH TIME ZONE); 是
lob及raw create table oracle_tab4 (test_1 number(38) primary key,test_2 blob,test_3 clob,test_4 long,test_5 raw(2000)); 是
主键 create table oracle_tab5 (test_1 number(38,27),test_2 char(255),test_3 date,test_4 varchar2(4000),constraint pk_test12 primary key (test_1,test_2)); 是
主键+外键 create table oracle_tab6 (test_1 number(38,27),test_2 char(255),test_3 integer,test_4 float(126),test_5 timestamp,constraint pk_test1 primary key (test_1,test_2),constraint fk_test foreign key(test_1,test_2) references oracle_tab5(test_1,test_2)); 是
不常用类型 create table oracle_tab7 (test_1 nchar(200),test_2 real); 是
不常用类型 create table oracle_tab9 (test_1 nclob); 是
添加列 主键列 alter table oracle_tab7 add tab7_pk number(38) primary key; 是
特殊字段列 alter table oracle_tab7 add long_raw long raw; 是
含长度字段 alter table oracle_tab7 add tab7_var varchar2(4000); 是
不含长度字段 alter table oracle_tab7 add tab7_lob blob; 是
设为null alter table oracle_tab7 add tab7_null number(38) null; 是
设为not null alter table oracle_tab7 add tab7_not_null number(38) not null; 是
null+默认值 alter table oracle_tab7 add tab7_defa number(38) default 10 null; 是
not null+默认值 alter table oracle_tab7 add tab7_defa1 number(38) default 10 not null; 是
添加多列 alter table oracle_tab7 add (tab7_var2 varchar2(300),tab7_num2 number(38)); 是
修改列属性 不含字段长度 alter table oracle_tab7 modify tab7_num2 number; 是
含字段长度 alter table oracle_tab7 modify tab7_var2 varchar(30); 是
null+默认值 alter table oracle_tab7 modify tab7_num2 number default 10 null; 是
not null+默认值 alter table oracle_tab7 modify tab7_num2 number default 10 not null; 是
删除表、列 删除列 alter table oracle_tab7 drop column tab7_null; 是
删除表 drop table oracle_tab7; 是。在删除表时,源若不带PURGE,则视为对表进行重命名
重命名表、列 修改列名 alter table oracle_tab7 rename column tab7_defa to tab7_defa2; 是
修改表名 alter table oracle_tab9 rename to oracle_tab8; 是
添加、删除约束及索引 建唯一索引 create unique index index_oracle_tab7 on oracle_tab7(test_2); 是
建唯一约束 alter table oracle_tab7 add constraint uni_cons_tab7_defa1 unique(tab7_defa1); 是
添加主键 alter table oracle_tab7 add constraint tab7_pk1 primary key (tab7_pk); 是
添加索引 create index index_tab1_test_2 on oracle_tab1(test_2); 是
添加约束 alter table oracle_tab7 add check(tab7_defa2 not like '%2%'); 是
删除索引 drop index index_oracle_tab7; 是
删除约束 alter table oracle_tab7 drop constraint uni_cons_tab7_defa1; 是
删除主键 alter table oracle_tab7 drop primary key; 是
表、列加注释 表注释 comment on table oracle_tab7 is '这是一张测试表'; 是
列注释 comment on column oracle_tab7.test_2 is '这是一个测试型字段'; 是
文档更新时间: 2021-11-01 22:55   作者:操李红