DB2 10.5 for Linux, UNIX, and Windows

LIST ACTIVE DATABASES command

Displays a subset of the information listed by the GET SNAPSHOT FOR ALL DATABASES command. An active database is available for connection and use by any application.

For each active database, this command displays the following information:
  • Database name
  • Number of applications currently connected to the database
  • 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

One of the following authorities:
  • SYSADM
  • SYSCTRL
  • SYSMAINT
  • SYSMON

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-LIST ACTIVE DATABASES--+--------------------------+---------><
                          +-AT MEMBER--member-number-+   
                          '-GLOBAL-------------------'   

Command parameters

AT MEMBER member-number
Specifies the member for which the list of active databases is to be displayed.
GLOBAL
Returns a list of active databases for all members in a partitioned database environment or a DB2® pureScale® environment.

Examples

The following example is sample output from the LIST ACTIVE DATABASES command:

                           Active Databases

Database name                              = TEST
Applications connected currently           = 0
Database path                              = /home/smith/smith/NODE0000/SQL00002/

Database name                              = SAMPLE
Applications connected currently           = 1
Database path                              = /home/smith/smith/NODE0000/SQL00001/

Compatibilities

For compatibility with previous versions:
  • DBPARTITIONNUM or NODE can be substituted for MEMBER, except when the DB2_ENFORCE_MEMBER_SYNTAX registry variable is set to ON.