LIST APPLICATIONS command
The LIST APPLICATIONS command displays to standard output the application program name, authorization ID (user name), application handle, application ID, and database name of all active database applications. This command can also optionally display an application's sequence number, status, status change time, and database path.
Scope
This command is issued on the currently attached member and, by default, returns information only for that member. In the case of multiple members per host, the currently attached member is the first member that is listed in the db2nodes.cfg file on that host.
To issue the command for a specific member that is not the currently attached member, specify the ATTACH_MEMBER parameter. To issue the command for all members and receive an aggregated result, specify the GLOBAL parameter.
To change the currently attached member, issue the SET CLIENT command with the ATTACH_MEMBER parameter . You must issue the DETACH command followed by the ATTACH command from your application for this change to take effect.
Authorization
- SYSADM
- SYSCTRL
- SYSMAINT
- SYSMON
Required connection
Instance. To list applications for a remote instance, it is necessary to first attach to that instance.
Command syntax
Command parameters
- FOR DATABASE database-alias
- Information for each application that is connected
to the specified database is to be displayed. Database name information
is not displayed. If this option is not specified, the command displays
the information for each application that is currently connected to
any database at the member to which the user is currently attached.
The default application information consists of the following:
- Authorization ID
- Application name
- Application handle
- Application ID
- Database name
- Number of agents
- AT MEMBER member-number
- Specifies the member for which the active applications are to be displayed.
- GLOBAL
- Returns a list of active applications for all members in a partitioned database environment or a Db2® pureScale® environment.
- SHOW DETAIL
- Some of the additional output information will include:
- CONNECT Auth ID
- Sequence number
- Coordinating member number
- Coordinator pid or thread
- Status
- Status change time
- Node
- Database path
If this option is specified, it is recommended that the output be redirected to a file, and that the report be viewed with the help of an editor. The output lines might wrap around when displayed on the screen. When a database is activated by a user other than the database administrator or an user without SYSADM authority the authorization ID will be shown as the non system user.
Examples
list applications for database sample show detail
Usage notes
The database administrator can use the output from this command as an aid to problem determination. In addition, this information is required if the database administrator wants to use the GET SNAPSHOT command or the FORCE APPLICATION command in an application.
To list applications at a remote instance (or a different local instance), it is necessary to first attach to that instance. If FOR DATABASE is specified when an attachment exists, and the database resides at an instance which differs from the current attachment, the command will fail.
LIST APPLICATIONS only shows user applications while LIST APPLICATIONS SHOW DETAIL shows all applications including the system applications. Event monitors are an example of system applications. System applications usually appear in snapshot output with application names beginning "db2" (for example, db2stmm, db2taskd). For additional information, see the Related links section about the is_system_appl monitor element.
Compatibilities
- DBPARTITIONNUM or NODE can be substituted for MEMBER, except when the DB2_ENFORCE_MEMBER_SYNTAX registry variable is set to ON.