sql mysql ->oracle

1、数据表迁移

     采用navicate客户端工具,点击右键mysql数据库,选着数据传输,填写好源和目标的信息,点击开始即可,将数据库表从mysql迁移到oracle中。具体如下图:

sql mysql ->oracle

2、oracle 表名小写转大写

批量将表名变为大写
begin
   for c in (select table_name tn from user_tables where table_name <> upper(table_name)) loop
       begin
          execute immediate 'alter table "'||c.tn||'" rename to '||c.tn;
       exception
          when others then
             dbms_output.put_line(c.tn||'已存在');
       end;
   end loop; 
end;

3、表中字段小写转大写

begin
for c in (select COLUMN_NAME cn from all_tab_columns where table_name='PROPERTY_INFO') loop
begin
execute immediate 'alter table PROPERTY_INFO rename column "'||c.cn||'" to '||c.cn;
exception
when others then
dbms_output.put_line('PROPERTY_INFO'||'.'||c.cn||'已经存在');
end;
end loop;
end;