DB2 Version 9.7 for Linux, UNIX, and Windows

ADMIN_GET_MSGS table function - Retrieve messages generated by a data movement utility that is executed through the ADMIN_CMD procedure

The ADMIN_GET_MSGS table function is used to retrieve messages generated by a single execution of a data movement utility command through the ADMIN_CMD procedure. The input parameter operation_id identifies that operation.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-ADMIN_GET_MSGS--(--operation_id--)--------------------------><

The schema is SYSPROC.

Table function parameter

operation_id
An input argument of type VARCHAR(139) that specifies the operation ID of the message file(s) produced by a data movement utility that was executed through the ADMIN_CMD procedure. The operation ID is generated by the ADMIN_CMD procedure.

Authorization

EXECUTE privilege on the ADMIN_GET_MSGS table function. The fenced user ID must have read access to the files under the directory indicated by registry variable DB2_UTIL_MSGPATH. If the registry variable is not set, then the fenced user ID must have read access to the files in the tmp subdirectory of the instance directory.

Example

Check all the messages returned by EXPORT utility that was executed through ADMIN_CMD procedure, with operation ID '24523_THERESAX'
SELECT * FROM TABLE(SYSPROC.ADMIN_GET_MSGS('24523_THERESAX')) AS MSG
The following example is a sample output from this query.
DBPARTITIONNUM AGENTTYPE SQLCODE   MSG 
-------------- --------- --------- ---------------------------------------...-
-              -         SQL3104N  The Export utility is beginning to 
                                    export data to file 
                                    "/home/theresax/rtest/data/ac_load03.del".
-              -         SQL3105N  The Export utility has finished 
                                    exporting "8" rows. 

2 record(s) selected.

Usage notes

The query statement that invokes this table function with the appropriate operation_id can be found in the MSG_RETRIEVAL column of the first result set returned by the ADMIN_CMD procedure.

Information returned

Table 1. Information returned by the ADMIN_GET_MSGS table function
Column name Data type Description
DBPARTITIONNUM INTEGER Database partition number. This value is only returned for a distributed load and indicates which database partition the corresponding message is for.
AGENTTYPE CHAR(4) Agent type. This value is only returned for a distributed load. The possible values are:
  • 'LOAD': for load agent
  • 'PART': for partitioning agent
  • 'PREP': for pre-partitioning agent
  • NULL: no agent type information is available
SQLCODE VARCHAR(9) SQLCODE of the message being returned.
MSG VARCHAR(1024) Short error message that corresponds to the SQLCODE.