DB2 DPF环境下load query命令报错 SQL6024C Table or index T1 is not defined on node 0

问题现象:
DPF环境下db2diag.log中有Error级别的报错, FUNCTION为sqluCTable::iGetTableInfoForLoadQuery

 

问题原因:
正常情况下,DPF环境,连接到任意一个节点即可对表做增删改操作,无论该节点是否有该表的定义。
但load query是例外,如果应用连接到某个节点上对一张表发出了load query命令,但该表所在的表空间所在的 partition group 并未包含该节点(也就是该表在这个节点上未定义),那么load query会失败,报错 SQL6024C


问题重现:
创建一个分区数据库,有0、1、2共三个分区,然后在1和2分区上创建表t1, 那么在0号节点可以增删改t1,但不能load query.

db2dpf@node01:~> db2start
05/31/2020 05:18:21     1   0   SQL1063N  DB2START processing was successful.
05/31/2020 05:18:21     0   0   SQL1063N  DB2START processing was successful.
05/31/2020 05:18:22     2   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.
db2dpf@node01:~> db2 "create db sample"
DB20000I  The CREATE DATABASE command completed successfully.
db2dpf@node01:~> db2 connect to sample

   Database Connection Information

 Database server        = DB2/LINUXX8664 10.5.8
 SQL authorization ID   = DB2DPF
 Local database alias   = SAMPLE

db2dpf@node01:~> db2 "CREATE DATABASE PARTITION GROUP grp1 on DBPARTITIONNUMS(1,2)"
DB20000I  The SQL command completed successfully.
db2dpf@node01:~> db2 "CREATE TABLESPACE tbs1 IN DATABASE PARTITION GROUP grp1"
DB20000I  The SQL command completed successfully.
db2dpf@node01:~> db2 "create table t1(id int) in tbs1"
DB20000I  The SQL command completed successfully.

1/ 
db2dpf@node01:~> db2 "values  (current dbpartitionnum)"

1          
-----------
          0

  1 record(s) selected.

db2dpf@node01:~> db2 "insert into t1 values(1),(2),(3)"
DB20000I  The SQL command completed successfully.
db2dpf@node01:~> db2 "select * from t1"

ID         
-----------
          1
          2
          3

  3 record(s) selected.

db2dpf@node01:~> db2 "load query table t1"
SQL6024C  Table or index "T1" is not defined on node "0".

 

db2diag.log如下:

2020-05-31-05.25.35.374272-240 I117629E1082          LEVEL: Error
PID     : 26032                TID : 140085789976320 PROC : db2sysc 0
INSTANCE: db2dpf               NODE : 000            DB   : SAMPLE
APPHDL  : 0-66                 APPID: *N0.db2dpf.200531092306
AUTHID  : DB2DPF               HOSTNAME: node01
EDUID   : 51                   EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, database utilities, sqluCTable::iGetTableInfoForLoadQuery, probe:1539
MESSAGE : ZRC=0x8015006D=-2146107283=SQLU_CA_BUILT
          "SQLCA has already been built"
DATA #1 : String, 0 bytes
Object not dumped: Address: 0x0000000000000000 Size: 0 Reason: Address is NULL
DATA #2 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
 sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -6024   sqlerrml: 4
 sqlerrmc: T1 0
 sqlerrp : SQLUTRGT
 sqlerrd : (1) 0x8015006D      (2) 0x00000000      (3) 0x00000000
           (4) 0x00000000      (5) 0x00000000      (6) 0x00000000
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)    
           (7)      (8)      (9)      (10)        (11)     
 sqlstate:      

2020-05-31-05.25.35.375247-240 I118712E512           LEVEL: Error
PID     : 26032                TID : 140085789976320 PROC : db2sysc 0
INSTANCE: db2dpf               NODE : 000            DB   : SAMPLE
APPHDL  : 0-66                 APPID: *N0.db2dpf.200531092306
AUTHID  : DB2DPF               HOSTNAME: node01
EDUID   : 51                   EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, database utilities, sqluReportErrToDiag, probe:0
MESSAGE :  , -2146107283, (nil), Detected in file:sqluqagt.C, Line:617

2020-05-31-05.25.35.392193-240 I119225E514           LEVEL: Error
PID     : 26032                TID : 140085789976320 PROC : db2sysc 0
INSTANCE: db2dpf               NODE : 000            DB   : SAMPLE
APPHDL  : 0-66                 APPID: *N0.db2dpf.200531092306
AUTHID  : DB2DPF               HOSTNAME: node01
EDUID   : 51                   EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, database utilities, sqluReportErrToDiag, probe:0
MESSAGE : sqluv_rollback , 0, 0x2, Detected in file:sqluvutl.C, Line:971

 

你可能感兴趣的:(DB2)