SNAPAPPL_INFO administrative view and SNAP_GET_APPL_INFO table function - Retrieve appl_info logical data group snapshot information
The SNAPAPPL_INFO administrative view and the SNAP_GET_APPL_INFO table function return information about applications from an application snapshot, in particular, the appl_info logical data group.
SNAPAPPL_INFO administrative view
This administrative view allows you to retrieve appl_info logical data group snapshot information for the currently connected database.
Used with the MON_GET_AGENT, MON_GET_CONNECTION, MON_GET_MEMORY_POOL, and MON_GET_MEMORY_SET table functions and the MON_CURRENT_SQL 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 members.
The schema is SYSIBMADM.
Refer to Table 1 for a complete list of information that can be returned.
Authorization
- SELECT privilege on the SNAPAPPL_INFO administrative view
- CONTROL privilege on the SNAPAPPL_INFO administrative view
- DATAACCESS authority
- DBADM authority
- SQLADM authority
- ACCESSCTRL authority
- SECADM authority
- EXECUTE privilege on the SNAP_GET_APPL_INFO table function
- DATAACCESS authority
- DBADM authority
- SQLADM authority
- SYSMON
- SYSMAINT
- SYSCTRL
- SYSADM
Default PUBLIC privilege
In a non-restrictive database, SELECT privilege is granted to PUBLIC when the view is automatically created.
Example
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.
SNAP_GET_APPL_INFO table function
The SNAP_GET_APPL_INFO 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 member, aggregate of all database members or all database members.
Used with the SNAP_GET_AGENT, SNAP_GET_AGENT_MEMORY_POOL, SNAP_GET_APPL, 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 members.
Refer to Table 1 for a complete list of information that can be returned.
Syntax
The schema is SYSPROC.
Table function parameters
-
dbname
- An input argument of type VARCHAR(128) that specifies a valid database name in the same instance as the currently connected database. Specify a database name that has a directory entry type of either "Indirect" or "Home", as returned by the LIST DATABASE DIRECTORY command. Specify an empty string to take the snapshot from the currently connected database. Specify a NULL value to take the snapshot from all databases within the same instance as the currently connected database. member
- An optional input argument of type INTEGER that specifies a valid database member number. Specify -1 for the current database member, or -2 for an aggregate of all active database members. If dbname is not set to NULL and member is set to NULL, -1 is set implicitly for member. If this input option is not used, that is, only dbname is provided, data is returned from all active database members. An active database member is a member where the database is available for connection and use by applications.
If both dbname and member 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 member number.
Authorization
- EXECUTE privilege on the SNAP_GET_APPL_INFO table function
- DATAACCESS authority
- SYSMON
- SYSCTRL
- SYSMAINT
- SYSADM
Default PUBLIC privilege
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
Examples
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(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.
Information returned
Column name | Data type | Description or corresponding monitor element |
---|---|---|
SNAPSHOT_TIMESTAMP | TIMESTAMP | The date and time that the snapshot was taken. |
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_NUM is deprecated and is replaced by MEMBER. |
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) | client_nname - Client name monitor element |
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(255) | tpmon_acc_str - TP monitor client accounting string |
DBPARTITIONNUM | SMALLINT | dbpartitionnum - Database partition number monitor element |
WORKLOAD_ID | INTEGER | workload_id - Workload ID monitor element |
IS_SYSTEM_APPL | SMALLINT | is_system_appl - Is System Application monitor element |
MEMBER | SMALLINT | member - Database member monitor element |
COORD_MEMBER | SMALLINT | coord_member - Coordinator member monitor element |
COORD_DBPARTITIONNUM | SMALLINT | The coordinating database partition number. |