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
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.
Default PUBLIC privilege
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
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 output is an example of 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
Column name | Data type | Description |
---|---|---|
DBPARTITIONNUM | INTEGER | dbpartitionnum - Database partition number monitor element |
AGENTTYPE | CHAR(4) | Agent type. This value is only returned for
a distributed load. The possible values are:
|
SQLCODE | VARCHAR(9) | SQLCODE of the message being returned. |
MSG | VARCHAR(1024) | Short error message that corresponds to the SQLCODE. |