The SNAP_GET_APPL_INFO table function returns information about applications from an application snapshot, in particular, the appl_info logical data group.
Used with the SNAP_GET_AGENT, SNAP_GET_AGENT_MEMORY_POOL, SNAP_GET_APPL, SNAP_GET_APPL_INFO, SNAP_GET_STMT and SNAP_GET_SUBSECTION table functions, the SNAP_GET_APPL_INFO table function provides information equivalent to the GET SNAPSHOT FOR ALL APPLICATIONS CLP command, but retrieves data from all database partitions.
Refer to Table 1 for a complete list of information that can be returned.
>>-SNAP_GET_APPL_INFO--(--dbname--+------------------+--)------>< '-, dbpartitionnum-'
The schema is SYSPROC.
If both dbname and dbpartitionnum are set to NULL, an attempt is made to read data from the file created by SNAP_WRITE_FILE procedure. Note that this file could have been created at any time, which means that the data might not be current. If a file with the corresponding snapshot API request type does not exist, then the SNAP_GET_APPL_INFO table function takes a snapshot for the currently connected database and database partition number.
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
SELECT SUBSTR(DB_NAME,1,8) AS DB_NAME, AGENT_ID,
SUBSTR(APPL_NAME,1,10) AS APPL_NAME, APPL_STATUS
FROM TABLE(SNAP_GET_APPL_INFO(CAST(NULL AS VARCHAR(128)),-1)) AS T
DB_NAME AGENT_ID APPL_NAME APPL_STATUS
-------- -------------------- ---------- ----------------------
TOOLSDB 14 db2bp.exe CONNECTED
SAMPLE 15 db2bp.exe UOWEXEC
SAMPLE 8 javaw.exe CONNECTED
SAMPLE 7 db2bp.exe UOWWAIT
4 record(s) selected.
SELECT SUBSTR(DB_NAME,1,8) AS DB_NAME, AUTHORITY_LVL
FROM TABLE(SNAP_GET_APPL_INFO_V95(CAST(NULL AS VARCHAR(128)),-1)) AS T
DB_NAME AUTHORITY_LVL
-------- -----------------------------------------------------....
TESTDB SYSADM(GROUP) + DBADM(USER) + CREATETAB(USER, GROUP) +
BINDADD(USER, GROUP) + CONNECT(USER, GROUP) +
CREATE_NOT_FENC(USER) + IMPLICIT_SCHEMA(USER, GROUP) +
LOAD(USER) + CREATE_EXT_RT(USER) + QUIESCE_CONN(USER)
TESTDB SYSADM(GROUP) + DBADM(USER) + CREATETAB(USER, GROUP) +
BINDADD(USER, GROUP) + CONNECT(USER, GROUP) +
CREATE_NOT_FENC(USER) + IMPLICIT_SCHEMA(USER, GROUP) +
LOAD(USER) + CREATE_EXT_RT(USER) + QUIESCE_CONN(USER)
TESTDB SYSADM(GROUP) + DBADM(USER) + CREATETAB(USER, GROUP) +
BINDADD(USER, GROUP) + CONNECT(USER, GROUP) +
CREATE_NOT_FENC(USER) + IMPLICIT_SCHEMA(USER, GROUP) +
LOAD(USER) + CREATE_EXT_RT(USER) + QUIESCE_CONN(USER)
3 record(s) selected.
Column name | Data type | Description or corresponding monitor element |
---|---|---|
SNAPSHOT_TIMESTAMP | TIMESTAMP | snapshot_timestamp - Snapshot timestamp monitor element |
AGENT_ID | BIGINT | agent_id - Application handle (agent ID) |
APPL_STATUS | VARCHAR(22) | appl_status - Application status . This
interface returns a text identifier based on the defines in sqlmon.h, and is one of:
|
CODEPAGE_ID | BIGINT | codepage_id - ID of code page used by application |
NUM_ASSOC_AGENTS | BIGINT | num_assoc_agents - Number of associated agents |
COORD_NODE_NUM | SMALLINT | coord_node - Coordinating node |
AUTHORITY_LVL | VARCHAR(512) | authority_lvl - User authorization
level . This interface returns a text identifier based on the database authorities defined in sql.h and their source, and has the following format: authority(source, ...) + authority(source, ...) + ... The source of an authority can be multiple: either from a USER, a GROUP, or a USER and a GROUP. Possible values for "authority":
Possible values for "source":
|
CLIENT_PID | BIGINT | client_pid - Client process ID |
COORD_AGENT_PID | BIGINT | coord_agent_pid - Coordinator agent |
STATUS_CHANGE_TIME | TIMESTAMP | status_change_time - Application status change time |
CLIENT_PLATFORM | VARCHAR(12) | client_platform - Client operating
platform . This interface returns a text identifier based on the
defines in sqlmon.h,
|
CLIENT_PROTOCOL | VARCHAR(10) | client_protocol - Client communication
protocol . This interface returns a text identifier based on the
defines in sqlmon.h,
|
TERRITORY_CODE | SMALLINT | territory_code - Database territory code |
APPL_NAME | VARCHAR(256) | appl_name - Application name |
APPL_ID | VARCHAR(128) | appl_id - Application ID |
SEQUENCE_NO | VARCHAR(4) | sequence_no - Sequence number |
PRIMARY_AUTH_ID | VARCHAR(128) | auth_id - Authorization ID |
SESSION_AUTH_ID | VARCHAR(128) | session_auth_id - Session authorization ID |
CLIENT_NNAME | VARCHAR(128) | The client_nname monitor element is deprecated. The value returned is not a valid value. |
CLIENT_PRDID | VARCHAR(128) | client_prdid - Client product/version ID |
INPUT_DB_ALIAS | VARCHAR(128) | input_db_alias - Input database alias |
CLIENT_DB_ALIAS | VARCHAR(128) | client_db_alias - Database alias used by application |
DB_NAME | VARCHAR(128) | db_name - Database name |
DB_PATH | VARCHAR(1024) | db_path - Database path |
EXECUTION_ID | VARCHAR(128) | execution_id - User login ID |
CORR_TOKEN | VARCHAR(128) | corr_token - DRDA® correlation token |
TPMON_CLIENT_USERID | VARCHAR(256) | tpmon_client_userid - TP monitor client user ID |
TPMON_CLIENT_WKSTN | VARCHAR(256) | tpmon_client_wkstn - TP monitor client workstation name |
TPMON_CLIENT_APP | VARCHAR(256) | tpmon_client_app - TP monitor client application name |
TPMON_ACC_STR | VARCHAR(200) | tpmon_acc_str - TP monitor client accounting string |
DBPARTITIONNUM | SMALLINT | The database partition from which the data for the row was retrieved. |