The SNAPAPPL_INFO administrative view and the SNAP_GET_APPL_INFO_V95 table function return information about applications from an application snapshot, in particular, the appl_info logical data group.
This administrative view allows you to retrieve appl_info logical data group snapshot information for the currently connected database.
Used with the SNAPAGENT, SNAPAGENT_MEMORY_POOL, SNAPAPPL, SNAPSTMT and SNAPSUBSECTION administrative views, the SNAPAPPL_INFO administrative view provides information equivalent to the GET SNAPSHOT FOR APPLICATIONS ON database-alias CLP command, but retrieves data from all database partitions.
The schema is SYSIBMADM.
Refer to Table 1 for a complete list of information that can be returned.
SELECT AGENT_ID, SUBSTR(APPL_NAME,1,10) AS APPL_NAME, APPL_STATUS
FROM SYSIBMADM.SNAPAPPL_INFO
AGENT_ID APPL_NAME APPL_STATUS
-------------------- ---------- ----------------------
101 db2bp.exe UOWEXEC
49 db2bp.exe CONNECTED
2 record(s) selected.
The SNAP_GET_APPL_INFO_V95 table function returns the same information as the SNAPAPPL_INFO administrative view, but allows you to retrieve the information for a specific database on a specific database partition, aggregate of all database partitions or all database partitions.
Used with the SNAP_GET_AGENT, SNAP_GET_AGENT_MEMORY_POOL, SNAP_GET_APPL_V95, SNAP_GET_STMT and SNAP_GET_SUBSECTION table functions, the SNAP_GET_APPL_INFO_V95 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_V95--(--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_V95 table function takes a snapshot for the currently connected database and database partition number.
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_V95(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_bitmap - 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. |
WORKLOAD_ID | INTEGER | workload_id - Workload ID monitor element |
IS_SYSTEM_APPL | SMALLINT | The value of IS_SYSTEM_APPL indicates whether or not the application is a DB2 internal system application: 0 means it is a user application 1 means it is a system application. An example of a DB2 system application is a DB2 event monitor. In general, the names of DB2 system applications begin with "db2". For example: db2stmm, db2taskd. |