IBM Db2 Warehouse客户端容器db_migrate错误

时间:2018-07-27 14:46:32

标签: db2 db2-woc

简短说明:db_migrate IBM Db2 Warehouse客户端容器上的错误

我已经从docker成功安装了用于DB2 Warehouse的客户端容器v2.9.0。我正在尝试运行db_migrate命令,将数据从我们的“旧” PDA服务器复制到我们自己的DB2仓库。

docker run -itd --net=host -v db2wh_vol:/mnt/clientdir --name=client store/ibmcorp/db2wh_ce:v2.9.0-db2wh_client-linux

我正在客户端容器中发出以下命令(出于安全原因密码被隐藏):

db_migrate -sdb BACC_DEV_STGPWRPT_SDFDM  -tdb BLUDB_24 -shost dstbld-pda02.bld.dst.ibm.com -suser h16720 -tuser bluadmin -spassword password -tpassword password  -sschema POTINA -tables "PO_FACT" "PRODUCT_DIMENSION" "CUSTOMER_DIMENSION"

开始加载作业,当我检查日志中是否存在引发错误的情况时:

=======================================================================================

db_migrate started on 2018-07-27 07:44:20

Parameters:   -logdir /mnt/clientdir/clienthome/db2inst1/logs/db_migrate -sdb BACC_DEV_STGPWRPT_SDFDM -tdb BLUDB_24 -shost dstbld-pda02.bld.dst.ibm.com -suser h16720 -tuser bluadmin -spassword ****** -tpassword ****** -sschema POTINA -tables PO_FACT PRODUCT_DIMENSION CUSTOMER_DIMENSION

Migrating dstbld-pda02.bld.dst.ibm.com:BACC_DEV_STGPWRPT_SDFDM --> localhost:BLUDB_24 (dashdb-txn-flex-yp-dal09-734.services.dal.bluemix.net/50001/BLUDB SSL)

Source Full Schema Enabled: TRUE
Source System Lettercase  : UPPERCASE

Data Format   : ascii
Log Directory : /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133
Log File      : /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/db_migrate.output

Initiated From:  linuxkit-025000000001
Top Level PID : 7133

SOURCE Version: NPS 7.2       Unloaded Via: exttab    # of Dataslices: 240
TARGET Version: v11.1.3.3       Loaded Via: exttab    # of Dataslices: 1
Script version: 1.0.0.1008.[20180418_132854] [CHANGES: BUG355]

=======================================================================================


Migrating the table: "POTINA"."PO_FACT"

.....processing table 1 of 3
.....using target table "POTINA"."PO_FACT"
.....migration process                              started at  2018-07-27 07:44:38
.....estimated # of records                                     5,096,960
.....load starting               ( thread 1 of 4 )
.....waiting on load             ( thread 2 of 4 )
.....load starting               ( thread 2 of 4 )
.....load starting               ( thread 3 of 4 )
.....load starting               ( thread 4 of 4 )
.....unloading data              ( thread 1 of 4 )
.....unloading data              ( thread 2 of 4 )
.....unloading data              ( thread 3 of 4 )
.....unloading data              ( thread 4 of 4 )
ERROR:  The load operation error
ERROR:  The load operation error
ERROR:  See logs: /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/POTINA.PO_FACT_3.load
ERROR:  The load operation error
ERROR:  See logs: /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/POTINA.PO_FACT_4.load
ERROR:  The load operation error
ERROR:  See logs: /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/POTINA.PO_FACT_1.load
ERROR:  See logs: /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/POTINA.PO_FACT_2.load
ERROR:  /opt/ibm/migration_tools/db_toolkit/db_extTab.sh issue, see logs: POTINA.PO_FACT_3.unload
ERROR:  /opt/ibm/migration_tools/db_toolkit/db_extTab.sh issue, see logs: POTINA.PO_FACT_4.unload
ERROR:  /opt/ibm/migration_tools/db_toolkit/db_extTab.sh issue, see logs: POTINA.PO_FACT_2.unload
ERROR:  /opt/ibm/migration_tools/db_toolkit/db_extTab.sh issue, see logs: POTINA.PO_FACT_1.unload

#####AUTOMATIC TERMINATION:  Prior problems were encountered.  Aborting the migration of this table.

.....migration aborted                                          TOTAL seconds: 39
.....migration process                              ended at    2018-07-27 07:45:17

我打开了PO_FACT_1.unload的日志:

[Db2wh - Client CLI ~]\>
db_migrate.20180727_074340.7133/POTINA.PO_FACT_1.loade/db2inst1/logs/db_migrate/

==> POTINA.PO_FACT [Thread: 1, attempt: 0]
DEBUG: DB EXTERNAL TABLE OPTIONS:  Encoding 'INTERNAL'  CrInString true CtrlChars true TimeDelim ':'  NULLVALUE 'QNZQ'   Remotesource 'jdbc'  MAXERRORS 1
DEBUG: /opt/ibm/migration_tools/db_toolkit/db_extTab.sh -action load -dbtype DB2 -host dashdb-txn-flex-yp-dal09-734.services.dal.bluemix.net -port 50001 -database BLUDB -schema "POTINA" -table PO_FACT -user bluadmin  -password '***' -pipeline /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/db_migrate.20180727_074340.7133_1.pipe_10 -logname POTINA.PO_FACT_1.load -logpath /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133 -addinoptions Encoding 'INTERNAL'  CrInString true CtrlChars true TimeDelim ':'  NULLVALUE 'QNZQ'   Remotesource 'jdbc'  MAXERRORS 1   -certFile /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/dashdb-txn-flex-yp-dal09-734.services.dal.bluemix.net:50001_20180727_074409.pem >> /mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/db_migrate.20180727_074340.7133_1.dbsql
20180727T07:44:38.361 : [1] SQL: INSERT INTO "POTINA"."PO_FACT" SELECT * FROM EXTERNAL '/mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133/db_migrate.20180727_074340.7133_1.pipe_10'  USING (    DELIMITER '|'   LOGDIR '/mnt/clientdir/clienthome/db2inst1/logs/db_migrate/db_migrate.20180727_074340.7133'  EscapeChar '\' Encoding 'INTERNAL'  CrInString true CtrlChars true TimeDelim ':'  NULLVALUE 'QNZQ'   Remotesource 'jdbc'  MAXERRORS 1  )
Using user specified non-default DB2 port number: 50001
An unexpected token "EXTERNAL" was found following "FROM".  Expected tokens may include:  "<space>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.23.42
Rows Returned : transfer failed
The /opt/ibm/migration_tools/db_toolkit/db_extTab.sh returned 255

您能帮我解决我做错了什么吗? 预先感谢!

1 个答案:

答案 0 :(得分:0)

db_migrate仅支持从PDA(又名Netezza)到Db2 Warehouse的迁移。它不支持“普通”的Db2,既可以在内部使用,也不能在Cloud上作为Db2使用。 即您的目标服务器是Db2 11.1.3.3,它不支持EXTERNAL TABLE。这就是为什么您收到An unexpected token "EXTERNAL"消息的原因。

即从Db2 Warehouse

touch /mnt/bludata0/scratch/test
db2 "INSERT INTO test SELECT * FROM EXTERNAL '/mnt/bludata0/scratch/test'"

SQL0100W  No row was found for FETCH, UPDATE or DELETE; or the result of a 
query is an empty table.  SQLSTATE=02000

但来自Db2

db2 "INSERT INTO test SELECT * FROM EXTERNAL '/tmp/test'"

DB21034E  The command was processed as an SQL statement because it was not a 
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "EXTERNAL" was found following "FROM".  Expected 
tokens may include:  "<space>".  SQLSTATE=42601