0

I am trying to perform DB2 import/export by using JDBC. As the offical document suggests, I have to execute

call sysproc.admin_cmd(import...messages on server...) 

first, then retrieve the messages using the SQL statement returned by field "msg_retrival", and finally remove the messages using "msg_removal". However, I was stuck on the second step when I was querying with the SQL statement DB2 returns

SELECT SQLCODE, MSG FROM TABLE (SYSPROC.ADMIN_GET_MSGS ('xxxx_xxxx_user')) AS MSG

DB2 raises error

SQL0443N Routine "SYSPROC.ADMIN_GET_MSGS"(specific name "ADMIN_GET_MSGS") has returned an error SQLSTATE with diagnostic text "".

Is there any possibility that the routine encounters an internal error, since it returns an empty SQLSTATE and an empty diagnostic text ? The DB2 version is 10.1.3.

I have tried to execute the query statement

SELECT SQLCODE, MSG FROM TABLE (SYSPROC.ADMIN_GET_MSGS ('xxxx_xxxx_user')) AS MSG

using different java applications, and even in the CLP on the server. I have tried the DB2 application user, instance user and fence user, the results seems to be the same. By the way, the query statement works only if I have indicated a wrong table name in the import/export command. PS: I've tried with 6 different environments(server) and the results seemed to be the same...

4
  • Check the db2diag.log on Db2-server for additional information. As you did not post your code, we cannot know if your code is in error, or whether there is a flaw elsewhere. At the least, you should recreate your import/admin_get_msgs with the CLP temporarily (i.e. not using java/jdbc) just to eliminate whether there is some flaw in yoru code.
    – mao
    Commented May 21, 2023 at 8:15
  • Thanks for your advise, I did simply execute db2 "call sysproc.admin_cmd('import...')" and db2"select ... from table(sysproc.admin_get_msgs)" in the CLP, and eventually got the same error. Also, I've checked the db2diag.log. There were only events instead of errors. Perhaps I didn't check it in the right way...
    – Moron9645
    Commented May 21, 2023 at 9:58
  • Please edit your question to post your CLP code, so others can check the usage (re messages on server option), use of the retrieval SQL etc, and recreate. You are using an antique Db2-luw version that is from 2013 (the final fixpack for that version is fixpack 6 in 2017, which may also be relevant). The DIAGLEVEL of the Db2-server-instance should be 3 at least.
    – mao
    Commented May 21, 2023 at 10:14
  • In the different server environments you tried, were they all using different Db2-versions, and different fixpacks. Are you saying that the ADMIN_GET_MSGS only works when the import has failed for a specific reason, but ADMIN_GET_MSGS gives -443 when the import fails for some different reason?
    – mao
    Commented May 21, 2023 at 10:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.