最近公司需要迁移数据库到MySQL
由于可以采用停机迁移,所以我选择了最笨的,PowerDesign反构数据库结构为 MySQL,再用CSV导入.
以下记录一些遇到得问题:
1.由于MySQL单行长度不允许超过65535
2.由于MySQL索引长度不能超过3072
3.部分语法问题造成的触发器创建失败
SQL语法差异
Oracle | MySQL |
---|---|
to_char | cast 如果使用在日期上date_format |
to_number | cast |
to_date | str_to_date |
decode | case when |
rownum | 会话变量 |
rowId | UUID() |
nvl | ifnull |
yyyy-MM-dd HH24:mm:ss | %H:%m:%s |
(+) | join |
|| | concat |
sysdate | 具体根据获取的格式使用now() |
分页使用rowId | 分页使用limit |
nulls last(frist) | order by isnull(xx)(-1),xx |