`
影非弦
  • 浏览: 50915 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

mysql数据库转移到oracle

阅读更多

需要将mysql中的数据库hjjk的所有表全部转移到oracle数据库中,但是数据量巨大,需要个工具才方便,给大家推荐个好用的工具,Dbmover for mysql to oracle这个工具比较简单,所以,就用了这个工具。

下面,运行Dbmover for mysql to oracle工具:

 

首先,输入mysql服务器的用户名和密码:

 

接着进行mysql的连接设置:

然后,选择oracle服务器的连接方式,选择客户端模式即可,因为服务器就安装在本机,客户端oraclelistener默认是运行的。

 

 

然后,配置oracle的登录名、密码、服务名(数据库名)。

最后,选择要转换的表,进行转换即可。

但是,在第一次尝试时,出现了8个错误。

经过检查,发现主要是ORA-00910错误,到网上搜了下,解释如下:

复制代码
Oracle Database Error ORA-00910
ORA-00910 specified length too long for its datatype

问题
for datatypes CHAR and RAW, the length specified was > 2000; otherwise, the length specified was > 4000.

解决
use a shorter length or switch to a datatype permitting a longer length such as a VARCHAR2, LONG CHAR, or LONG RAW
复制代码

我就开始检查,转换后的类型,有没有超出其在oracle下预定的范围,发现了varchar(10000)类型。而,varchar(10000)类型的,范围是:

Variable-length character string having maximum length size bytes or characters. Maximum size is 4000 bytes or characters, and minimum is 1 byte or 1 character. You must specify size for VARCHAR2.
来自:http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements001.htm#i45694

 

所以,在先将mysql中哪些越界的字段修改 alter table操作,

然后重新转换,这一次转换是成功的。

 

 

这个工具我已经放在附件里面了,你也可以去官网下载!

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics