使用kettle做数据库数据转移遇到问题
刚开始使用kettle,用的笨方法,在windows下用Spoon配置,再在aix环境下用pan.sh跑配置出来的脚本
现在只是实现一个简单的从db2数据库select数据,输出到excel文件,再导入另一个表,就遇到很多问题,请大家帮忙解答,谢谢
总之是select,disconnect,update,commit,回退的时候都有报错,很是困惑,导致每次excel文件中都能取出部分记录(条数不定),但是插入数据库还是没结果。下面贴出日志
INFO 26-07 13:33:53,686 - Pan - Start of run.
INFO 26-07 13:33:54,005 - large32 - Dispatching started for transformation [large32]
INFO 26-07 13:33:54,859 - output - Connected to database [cusltdb32] (commit=1000)
ERROR 26-07 13:33:55,142 - input - Unexpected error
ERROR 26-07 13:33:55,144 - input - org.pentaho.di.core.exception.KettleDatabaseException:
Couldn't get row from result set
Unable to get value 'String(40)' from database resultset, index 93
at java.lang.Thread.run (Thread.java:736)
at org.pentaho.di.trans.step.RunThread.run (RunThread.java:50)
at org.pentaho.di.trans.steps.tableinput.TableInput.processRow (TableInput.java:153)
at org.pentaho.di.core.database.Database.getRow (Database.java:2796)
at org.pentaho.di.core.database.Database.getRow (Database.java:2816)
at org.pentaho.di.core.database.DatabaseMeta.getValueFromResultSet (DatabaseMeta.java:2613)
at org.pentaho.di.core.database.BaseDatabaseMeta.getValueFromResultSet (BaseDatabaseMeta.java:1870)
at com.ibm.db2.jcc.b.rc.getString (rc.java:887)
at com.ibm.db2.jcc.b.r.M (r.java:1193)
at com.ibm.db2.jcc.b.r.n (r.java:582)
at com.ibm.db2.jcc.b.r.a (r.java:1564)
at org.pentaho.di.core.database.Database.getRow(Database.java:2824)
at org.pentaho.di.core.database.Database.getRow(Database.java:2796)
at org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:153)
at org.pentaho.di.trans.step.RunThread.run(RunThread.java:50)
at java.lang.Thread.run(Thread.java:736)
Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
Unable to get value 'String(40)' from database resultset, index 93
at java.lang.Thread.run (Thread.java:736)
at org.pentaho.di.trans.step.RunThread.run (RunThread.java:50)
at org.pentaho.di.trans.steps.tableinput.TableInput.processRow (TableInput.java:153)
at org.pentaho.di.core.database.Database.getRow (Database.java:2796)
at org.pentaho.di.core.database.Database.getRow (Database.java:2816)
at org.pentaho.di.core.database.DatabaseMeta.getValueFromResultSet (DatabaseMeta.java:2613)
at org.pentaho.di.core.database.BaseDatabaseMeta.getValueFromResultSet (BaseDatabaseMeta.java:1870)
at com.ibm.db2.jcc.b.rc.getString (rc.java:887)
at com.ibm.db2.jcc.b.r.M (r.java:1193)
at com.ibm.db2.jcc.b.r.n (r.java:582)
at com.ibm.db2.jcc.b.r.a (r.java:1564)
at org.pentaho.di.core.database.BaseDatabaseMeta.getValueFromResultSet(BaseDatabaseMeta.java:1900)
at org.pentaho.di.core.database.DatabaseMeta.getValueFromResultSet(DatabaseMeta.java:2613)
at org.pentaho.di.core.database.Database.getRow(Database.java:2816)
... 4 more
Caused by: com.ibm.db2.jcc.b.SqlException
at com.ibm.db2.jcc.b.r.a(r.java:1564)
at com.ibm.db2.jcc.b.r.n(r.java:582)
at com.ibm.db2.jcc.b.r.M(r.java:1193)
at com.ibm.db2.jcc.b.rc.getString(rc.java:887)
at org.pentaho.di.core.database.BaseDatabaseMeta.getValueFromResultSet(BaseDatabaseMeta.java:1870)
... 6 more
INFO 26-07 13:33:55,146 - input - Finished reading query, closing connection.
ERROR 26-07 13:33:55,149 - cusltdb8 - Error disconnecting from database:
Error comitting connection
DatabaseMetaData information is not known for server DB2/AIX64SQL09057 by this version of JDBC driver
ERROR 26-07 13:33:55,151 - cusltdb8 - org.pentaho.di.core.exception.KettleDatabaseException:
Error comitting connection
DatabaseMetaData information is not known for server DB2/AIX64SQL09057 by this version of JDBC driver
at org.pentaho.di.core.database.Database.commit(Database.java:709)
at org.pentaho.di.core.database.Database.commit(Database.java:678)
at org.pentaho.di.core.database.Database.disconnect(Database.java:565)
at org.pentaho.di.trans.steps.tableinput.TableInput.dispose(TableInput.java:285)
at org.pentaho.di.trans.step.RunThread.run(RunThread.java:76)
at java.lang.Thread.run(Thread.java:736)
Caused by: com.ibm.db2.jcc.b.SqlException: DatabaseMetaData information is not known for server DB2/AIX64SQL09057 by this version of JDBC driver
at com.ibm.db2.jcc.b.s.supportsTransactions(s.java:4845)
at org.pentaho.di.core.database.Database.commit(Database.java:695)
... 5 more
INFO 26-07 13:33:55,152 - input - Finished processing (I=49, O=0, R=0, W=48, U=0, E=1)
INFO 26-07 13:33:55,152 - large32 - large32
INFO 26-07 13:33:55,153 - large32 - large32
ERROR 26-07 13:33:55,183 - output - Unexpected batch update error committing the database connection.
ERROR 26-07 13:33:55,184 - output - org.pentaho.di.core.exception.KettleDatabaseBatchException:
Error updating batch
Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1505)
at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:658)
at org.pentaho.di.trans.step.RunThread.run(RunThread.java:51)
at java.lang.Thread.run(Thread.java:736)
Caused by: com.ibm.db2.jcc.b.vd: Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
at com.ibm.db2.jcc.b.i.a(i.java:390)
at com.ibm.db2.jcc.b.ad.b(ad.java:2863)
at com.ibm.db2.jcc.b.ad.a(ad.java:2632)
at com.ibm.db2.jcc.b.ad.executeBatch(ad.java:2444)
at com.ibm.db2.jcc.b.ad.executeBatch(ad.java:1329)
at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1488)
... 3 more
ERROR 26-07 13:33:55,185 - output - Unexpected error rolling back the database connection.
ERROR 26-07 13:33:55,187 - output - org.pentaho.di.core.exception.KettleDatabaseException:
Error performing rollback on connection
DatabaseMetaData information is not known for server DB2/AIX64SQL09057 by this version of JDBC driver
at org.pentaho.di.core.database.Database.rollback(Database.java:741)
at org.pentaho.di.core.database.Database.rollback(Database.java:715)
at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:708)
at org.pentaho.di.trans.step.RunThread.run(RunThread.java:51)
at java.lang.Thread.run(Thread.java:736)
Caused by: com.ibm.db2.jcc.b.SqlException: DatabaseMetaData information is not known for server DB2/AIX64SQL09057 by this version of JDBC driver
at com.ibm.db2.jcc.b.s.supportsTransactions(s.java:4845)
at org.pentaho.di.core.database.Database.rollback(Database.java:726)
... 4 more
ERROR 26-07 13:33:55,188 - cusltdb32 - Error disconnecting from database:
Error comitting connection
DatabaseMetaData information is not known for server DB2/AIX64SQL09057 by this version of JDBC driver
ERROR 26-07 13:33:55,189 - cusltdb32 - org.pentaho.di.core.exception.KettleDatabaseException:
Error comitting connection
DatabaseMetaData information is not known for server DB2/AIX64SQL09057 by this version of JDBC driver
at org.pentaho.di.core.database.Database.commit(Database.java:709)
at org.pentaho.di.core.database.Database.commit(Database.java:678)
at org.pentaho.di.core.database.Database.disconnect(Database.java:565)
at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:716)
at org.pentaho.di.trans.step.RunThread.run(RunThread.java:51)
at java.lang.Thread.run(Thread.java:736)
Caused by: com.ibm.db2.jcc.b.SqlException: DatabaseMetaData information is not known for server DB2/AIX64SQL09057 by this version of JDBC driver
at com.ibm.db2.jcc.b.s.supportsTransactions(s.java:4845)
at org.pentaho.di.core.database.Database.commit(Database.java:695)
... 5 more
INFO 26-07 13:33:55,190 - output - Finished processing (I=0, O=0, R=16, W=0, U=0, E=1)
INFO 26-07 13:33:55,236 - large32 - large32
INFO 26-07 13:33:55,236 - large32 - large32
INFO 26-07 13:33:55,340 - Microsoft Excel Output - Finished processing (I=0, O=17, R=17, W=16, U=0, E=0)
INFO 26-07 13:33:55,366 - Pan - Finished!
INFO 26-07 13:33:55,367 - Pan - Start=2012/07/26 13:33:53.689, Stop=2012/07/26 13:33:55.367
INFO 26-07 13:33:55,368 - Pan - Processing ended after 1 seconds.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
表输入可以预览数据。如果没问题就可以配置表输出,只要注意目标表的字段和流里面的字段对应。如果是异构的表,中间可以需要转换字段。
解决这个步骤的错误吧,试着用excel做中间处理,不可取吧。
谢谢,我也试过,但是一直是在报错,所以中间添加一个步骤,用来寻找问题所在
一个简单的表到表转换就可以了,没必要中间弄个excel。