DB2 Version 9.7 for Linux, UNIX, and Windows

GET SNAPSHOT command

Collects status information and formats the output for the user. The information returned represents a snapshot of the database manager operational status at the time the command was issued.

Scope

In a partitioned database environment, this command can be invoked from any database partition defined in the db2nodes.cfg file. It acts only on that database partition.

Authorization

One of the following:
  • 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 DBPARTITIONNUMS----------------------------+   
   +-LOCKS FOR APPLICATION--+-APPLID--appl-id------+--------+   
   |                        '-AGENTID--appl-handle-'        |   
   +-ALL REMOTE_DATABASES-----------------------------------+   
   +-ALL REMOTE_APPLICATIONS--------------------------------+   
   +---DYNAMIC SQL--ON--database-alias--+---------------+---+   
   |                                    '-WRITE TO FILE '   |   
   '-+-ALL-------------------+--ON--database-alias----------'   
     +-+-----+--+-DATABASE-+-+                                  
     | '-DCS-'  '-DB-------' |                                  
     +-+-----+--APPLICATIONS-+                                  
     | '-DCS-'               |                                  
     +-TABLES----------------+                                  
     +-TABLESPACES-----------+                                  
     +-LOCKS-----------------+                                  
     +-BUFFERPOOLS-----------+                                  
     +-REMOTE_DATABASES------+                                  
     '-REMOTE_APPLICATIONS---'                                  

>--+----------------------------------------+------------------><
   +-AT DBPARTITIONNUM--db-partition-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 database partition.
ALL APPLICATIONS
Provides information about all active applications that are connected to a database on the current database partition.
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 DBPARTITIONNUMS
Provides Fast Communication Manager (FCM) statistics between the database partition against which the GET SNAPSHOT command was issued and the other database partitions in the partitioned database 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 database partition.
ALL REMOTE_APPLICATIONS
Provides information about all active remote applications that are connected to the current database partition.
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.
WRITE TO FILE
Specifies that snapshot results are to be stored in a file at the server, as well as being passed back to the client. This command is valid only over a database connection. The snapshot data can then be queried through the table function SYSFUN.SQLCACHE_SNAPSHOT over the same connection on which the call was made.
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 DBPARTITIONNUM db-partition-number
Returns results for the database partition specified.
GLOBAL
Returns an aggregate result for all database partitions in a partitioned database environment.

Examples

Usage notes

Compatibilities

For compatibility with versions earlier than Version 8:
  • The keyword NODE can be substituted for DBPARTITIONNUM.
  • The keyword NODES can be substituted for DBPARTITIONNUMS.
  • 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