从Oracle迁移到MySql

时间:2011-05-15 17:22:17

标签: mysql oracle database-migration

我想从oracle迁移到MySql。我正在使用MySql Migration tools 5.0。 迁移向导出了点问题。

Error while establishing connection

错误讯息是

Connecting to source database and retrieve schemata names.
Initializing JDBC driver ... 
Driver class Oracle Thin JDBC Driver using Service
Opening connection ... 
Connection jdbc:oracle:thin:system/**********@//127.0.0.1:1521/OracleServiceXE
The list of schema names could not be retrieved (error: 0).
ReverseEngineeringOracle.getSchemata :Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
The Connection descriptor used by the client was:
//127.0.0.1:1521/OracleServiceXE

Details: 
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:280)
oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:361)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:595)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection(ReverseEngineeringGeneric.java:141)
com.mysql.grt.modules.ReverseEngineeringOracle.getSchemata(ReverseEngineeringOracle.java:43)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.mysql.grt.Grt.callModuleFunction(Unknown Source)

两个SQL服务器都在localhost上运行。

如何解决这些错误?

2 个答案:

答案 0 :(得分:2)

您可以将使用过的服务名称添加到oracle数据库,或将输入的值“OracleServiceXE”修改为正确的值“XE”。输入的值看起来很像默认的Windows服务名称,可能与Oracle数据库服务名称混淆。

将当前实例服务名称更改为OracleServiceXE:

alter system set service_name = 'OracleServiceXE';

lsnrctl services

除非数据库实例处于受限状态,否则

还应显示病房后的服务名称,在这种情况下,使用服务名称的连接将失败。

答案 1 :(得分:0)

在我看来,您的Oracle的jdbc连接URL是错误的。通常它看起来像这样:

jdbc:oracle:thin:@localhost:1521:xe

如果删除双斜杠//并用冒号/替换1521/OracleServiceXE之间的斜杠:,会发生什么?