新手刚使用Kettle,今天迁移Oracle的表到Mysql的时候发现一个问题,导致数据无法迁移。请教一下大家怎么解决。谢谢。
Oracle表结构如下
Mysql表结构如下
现Oracle表中有一条数据如下:
Kettle中的转换过程如下:
执行转换过程报错,错误日志如下
2018/11/23 13:38:22 - 表输入.0 - 开始运行...
2018/11/23 13:38:22 - 表输出.0 - 开始运行...
2018/11/23 13:38:22 - 表输入.0 - SQL query : SELECT
WORK_TICKET_ID
,GZNR
,GZFZR
,QFRYJ
,QFR
,GZBQM
,QMRQ
,CREATED_BY
,CREATION_DATE
,LAST_UPDATE_DATE
,LAST_UPDATE_LOGIN
,LAST_UPDATED_BY
FROM SPM_TT_WKT_WXDKZ
WHERE WORK_TICKET_ID = 290381
2018/11/23 13:38:22 - 表输入.0 - Signaling 'output done' to 1\u8f93出 rowsets.
2018/11/23 13:38:22 - 表输入.0 - Finished reading query, closing connection.
2018/11/23 13:38:22 - 表输出.0 - Prepared statement : INSERT INTO spm_tt_work_ticket (WORK_TICKET_ID, GZNR, GZFZR, QFRYJ, QFR, GZBQM, QMRQ, CREATED_BY, CREATION_DATE, LAST_UPDATE_DATE, LAST_UPDATE_LOGIN, LAST_UPDATED_BY) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2018/11/23 13:38:22 - HN_TEST_ORACLE - Commit on database connection [HN_TEST_ORACLE]
2018/11/23 13:38:22 - 表输出.0 - Written row: [290381.0], [null], [null], [null], [null], [null], [null], [null], [null], [null], [null], [null]
2018/11/23 13:38:22 - 表输出.0 - ERROR (version 8.1.0.0-365, build 8.1.0.0-365 from 2018-04-30 09.42.24 by buildguy) : Unexpected batch update error committing the database connection.
2018/11/23 13:38:22 - 表输出.0 - ERROR (version 8.1.0.0-365, build 8.1.0.0-365 from 2018-04-30 09.42.24 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseBatchException:
2018/11/23 13:38:22 - 表输出.0 - Error updating batch
2018/11/23 13:38:22 - 表输出.0 - Unknown column 'GZNR' in 'field list'
2018/11/23 13:38:22 - 表输出.0 -
2018/11/23 13:38:22 - 表输出.0 - at org.pentaho.di.core.database.Database.createKettleDatabaseBatchException(Database.java:1425)
2018/11/23 13:38:22 - 表输出.0 - at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1414)
2018/11/23 13:38:22 - 表输出.0 - at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:586)
2018/11/23 13:38:22 - 表输出.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:97)
2018/11/23 13:38:22 - 表输出.0 - at java.lang.Thread.run(Unknown Source)
2018/11/23 13:38:22 - 表输出.0 - Caused by: java.sql.BatchUpdateException: Unknown column 'GZNR' in 'field list'
2018/11/23 13:38:22 - 表输出.0 - at sun.reflect.GeneratedConstructorAccessor77.newInstance(Unknown Source)
2018/11/23 13:38:22 - 表输出.0 - at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
2018/11/23 13:38:22 - 表输出.0 - at java.lang.reflect.Constructor.newInstance(Unknown Source)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.Util.getInstance(Util.java:408)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.SQLError.createBatchUpdateException(SQLError.java:1163)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1823)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1307)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:970)
2018/11/23 13:38:22 - 表输出.0 - at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1401)
2018/11/23 13:38:22 - 表输出.0 - ... 3 more
2018/11/23 13:38:22 - 表输出.0 - Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'GZNR' in 'field list'
2018/11/23 13:38:22 - 表输出.0 - at sun.reflect.GeneratedConstructorAccessor74.newInstance(Unknown Source)
2018/11/23 13:38:22 - 表输出.0 - at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
2018/11/23 13:38:22 - 表输出.0 - at java.lang.reflect.Constructor.newInstance(Unknown Source)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.Util.getInstance(Util.java:408)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2124)
2018/11/23 13:38:22 - 表输出.0 - at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1801)
2018/11/23 13:38:22 - 表输出.0 - ... 6 more
2018/11/23 13:38:22 - HN_TEST_ORACLE - Connection to database closed!
请教下大家,这个问题,怎么解决。谢谢
<p>表输出目标表和mysql里面的表不一样</p>
<p>2018/11/23 13:38:22 - 表输出.0 - Unknown column 'GZNR' in 'field list' </p>
<p>请看我的截图,mysql中是有GZNR这个字段的</p>
<p>列名大小写问题排查一下。。</p>
<div class="ref">
列名大小写问题排查一下。。
<div class="ref">
列名大小写问题排查一下。。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。