DB2 10.5 for Linux, UNIX, and Windows

GET SNAPSHOT command

Collects status information and formats the output. The information that is returned is a snapshot of the database manager operational status at the time that you issued the command.

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

Required connection

Instance. If there is no instance attachment, a default instance attachment is created.

To obtain a snapshot of a remote instance, it is necessary to first attach to that instance.

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-GET SNAPSHOT FOR--------------------------------------------->

>--+-+-DATABASE MANAGER-+----------------------------+---------->
   | +-DB MANAGER-------+                            |   
   | '-DBM--------------'                            |   
   +-ALL--+-----+--DATABASES-------------------------+   
   |      '-DCS-'                                    |   
   +-ALL--+-----+--APPLICATIONS----------------------+   
   |      '-DCS-'                                    |   
   +-ALL BUFFERPOOLS---------------------------------+   
   +-+-----+--APPLICATION--+-APPLID--appl-id------+--+   
   | '-DCS-'               '-AGENTID--appl-handle-'  |   
   +-FCM FOR ALL MEMBERS-----------------------------+   
   +-LOCKS FOR APPLICATION--+-APPLID--appl-id------+-+   
   |                        '-AGENTID--appl-handle-' |   
   +-ALL REMOTE_DATABASES----------------------------+   
   +-ALL REMOTE_APPLICATIONS-------------------------+   
   +---DYNAMIC SQL--ON--database-alias---------------+   
   '-+-ALL-------------------+--ON--database-alias---'   
     +-+-----+--+-DATABASE-+-+                           
     | '-DCS-'  '-DB-------' |                           
     +-+-----+--APPLICATIONS-+                           
     | '-DCS-'               |                           
     +-TABLES----------------+                           
     +-TABLESPACES-----------+                           
     +-LOCKS-----------------+                           
     +-BUFFERPOOLS-----------+                           
     +-REMOTE_DATABASES------+                           
     '-REMOTE_APPLICATIONS---'                           

>--+--------------------------+--------------------------------><
   +-AT MEMBER--member-number-+   
   '-GLOBAL-------------------'   

The monitor switches must be turned on in order to collect some statistics.

Command parameters

DATABASE MANAGER
Provides statistics for the active database manager instance.
ALL DATABASES
Provides general statistics for all active databases on the current member.
ALL APPLICATIONS
Provides information about all active applications that are connected to a database on the current member.
ALL BUFFERPOOLS
Provides information about buffer pool activity for all active databases.
APPLICATION APPLID appl-id
Provides information only about the application whose ID is specified. To get a specific application ID, use the LIST APPLICATIONS command.
APPLICATION AGENTID appl-handle
Provides information only about the application whose application handle is specified. The application handle is a 32-bit number that uniquely identifies an application that is currently running. Use the LIST APPLICATIONS command to get a specific application handle.
FCM FOR ALL MEMBERS
Provides Fast Communication Manager (FCM) statistics between the member against which the GET SNAPSHOT command was issued and the other members in the partitioned database environment or in a DB2® pureScale® environment.
LOCKS FOR APPLICATION APPLID appl-id
Provides information about all locks held by the specified application, identified by application ID.
LOCKS FOR APPLICATION AGENTID appl-handle
Provides information about all locks held by the specified application, identified by application handle.
ALL REMOTE_DATABASES
Provides general statistics about all active remote databases on the current member.
ALL REMOTE_APPLICATIONS
Provides information about all active remote applications that are connected to the current member.
ALL ON database-alias
Provides general statistics and information about all applications, tables, table spaces, buffer pools, and locks for a specified database.
DATABASE ON database-alias
Provides general statistics for a specified database.
APPLICATIONS ON database-alias
Provides information about all applications connected to a specified database.
TABLES ON database-alias
Provides information about tables in a specified database. This will include only those tables that have been accessed since the TABLE recording switch was turned ON.
TABLESPACES ON database-alias
Provides information about table spaces for a specified database.
LOCKS ON database-alias
Provides information about every lock held by each application connected to a specified database.
BUFFERPOOLS ON database-alias
Provides information about buffer pool activity for the specified database.
REMOTE_DATABASES ON database-alias
Provides general statistics about all active remote databases for a specified database.
REMOTE_APPLICATIONS ON database-alias
Provides information about remote applications for a specified database.
DYNAMIC SQL ON database-alias
Returns a point-in-time picture of the contents of the SQL statement cache for the database.
DCS
Depending on which clause it is specified, this keyword requests statistics about:
  • A specific DCS application currently running on the DB2 Connect™ Gateway
  • All DCS applications
  • All DCS applications currently connected to a specific DCS database
  • A specific DCS database
  • All DCS databases.
AT MEMBER member-number
Returns results for the member specified.
GLOBAL
Returns snapshot results for all members.

Examples

Usage notes

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.
  • DBPARTITIONNUMS or NODES can be substituted for MEMBERS, except when the DB2_ENFORCE_MEMBER_SYNTAX registry variable is set to ON.
  • The new registry variable in Version 9.5, DB2_SYSTEM_MONITOR_SETTINGS impacts the behavior of monitoring the CPU usage on Linux. If you need to use the method of reading CPU usage that returns both system and user CPU usage times on Linux, perform one of the following actions.

    On Linux on RHEL4 and SLES9:
    db2set DB2_SYSTEM_MONITOR_SETTINGS=DISABLE_CPU_USAGE:FALSE
    On Linux on RHEL5 and SLES10:
    db2set DB2_SYSTEM_MONITOR_SETTINGS=OLD_CPU_USAGE:TRUE