The APPLICATIONS administrative view returns information about the connected database applications. The view is an SQL interface for the LIST APPLICATIONS SHOW DETAIL CLP command, but only for the currently connected database. Its information is based on the SNAPAPPL_INFO administrative view.
The schema is SYSIBMADM.
SELECT AGENT_ID, SUBSTR(APPL_NAME,1,10) AS APPL_NAME, AUTHID,
APPL_STATUS FROM SYSIBMADM.APPLICATIONS WHERE DB_NAME = 'SAMPLE'
AGENT_ID APPL_NAME AUTHID APPL_STATUS
-------------------- ---------- ---------- ---------------------
23 db2bp.exe JESSICAE UOWEXEC
1 record(s) selected.
SELECT SUBSTR(APPL_NAME, 1, 10) AS APPL_NAME, COUNT(*) AS NUM
FROM SYSIBMADM.APPLICATIONS WHERE DBPARTITIONNUM = 0
AND DB_NAME = 'SAMPLE' GROUP BY APPL_NAME
APPL_NAME NUM
---------- -----------
db2bp.exe 3
javaw.exe 1
2 record(s) selected.
The view does not support the GLOBAL syntax available from the CLP. However, aggregation can be done using SQL aggregation functions as data from all database partitions is returned from the view.
Column name | Data type | Description or corresponding monitor element |
---|---|---|
SNAPSHOT_TIMESTAMP | TIMESTAMP | snapshot_timestamp - Snapshot timestamp monitor element |
CLIENT_DB_ALIAS | VARCHAR(128) | client_db_alias - Database alias used by application |
DB_NAME | VARCHAR(128) | db_name - Database name |
AGENT_ID | BIGINT | agent_id - Application handle (agent ID) |
APPL_NAME | VARCHAR(256) | appl_name - Application name |
AUTHID | VARCHAR(128) | auth_id - Authorization ID |
APPL_ID | VARCHAR(128) | appl_id - Application ID |
APPL_STATUS | VARCHAR(22) | appl_status - Application status . This
interface returns a text identifier based on defines in sqlmon.h,
and is one of:
|
STATUS_CHANGE_TIME | TIMESTAMP | status_change_time - Application status change time |
SEQUENCE_NO | VARCHAR(4) | sequence_no - Sequence number |
CLIENT_PRDID | VARCHAR(128) | client_prdid - Client product/version ID |
CLIENT_PID | BIGINT | client_pid - Client process ID |
CLIENT_PLATFORM | VARCHAR(12) | client_platform - Client operating
platform . This interface returns a text identifier based on defines
in sqlmon.h, and is one of:
|
CLIENT_PROTOCOL | VARCHAR(10) | client_protocol - Client communication
protocol . This interface returns a text identifier based on the
defines in sqlmon.h,
|
CLIENT_NNAME | VARCHAR(128) | The client_nname monitor element is deprecated. The value returned is not a valid value. |
COORD_NODE_NUM | SMALLINT | coord_node - Coordinating node |
COORD_AGENT_PID | BIGINT | coord_agent_pid - Coordinator agent |
NUM_ASSOC_AGENTS | BIGINT | num_assoc_agents - Number of associated agents |
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 was retrieved for this row. |