Capturing a database snapshot from the CLP

You can capture database snapshots from the CLP using the GET SNAPSHOT command. A number of different snapshot request types are available, which can be accessed by specifying certain parameters for the GET SNAPSHOT command.

Before you begin

You must have SYSADM, SYSCTRL, SYSMAINT, or SYSMON authority to capture a database snapshot.

You must have an instance attachment to capture a database snapshot. If there is not an attachment to an instance, then a default instance attachment is created. To obtain a snapshot of a remote instance, you must first attach to that instance.

Procedure

  • Optional: Set and check the status of the monitor switches.
  • From the CLP, issue the GET SNAPSHOT command with the required parameters. In the following example, the snapshot captures information for all databases:
    db2 get snapshot for all databases
    To capture a database snapshot for a specific database, use the following command:
    db2 get snapshot for database on db-name 
    where db-name is the name of the database you are interested in.
  • The following example captures database manager level information:
    db2 get snapshot for dbm
  • For partitioned database systems, you can capture a database snapshot specifically for a certain partition, or globally for all partitions. To capture a database snapshot for all applications on a specific partition (for example, partition number 2), issue the following command:
    db2 get snapshot for all applications at dbpartitionnum 2
  • To capture a database snapshot for all applications on all partitions, issue the following command:
    db2 get snapshot for all applications global
    For global snapshots on partitioned databases, the monitor data from all the partitions is aggregated.