DB2 10.5 for Linux, UNIX, and Windows

SNAPUTIL_PROGRESS administrative view and SNAP_GET_UTIL_PROGRESS table function - Retrieve progress logical data group snapshot information

The SNAPUTIL_PROGRESS administrative view and the SNAP_GET_UTIL_PROGRESS table function return snapshot information about utility progress, in particular, the progress logical data group.

Depending on if you are using the administrative view or the table function, refer to one of the following sections:

SNAPUTIL_PROGRESS administrative view

Used in conjunction with the SNAPUTIL administrative view, the SNAPUTIL_PROGRESS administrative view provides the same information as the LIST UTILITIES SHOW DETAIL CLP command.

The schema is SYSIBMADM.

Refer to Table 1 for a complete list of information that can be returned.

Authorization

One of the following authorizations is required to use the view:
  • SELECT privilege on the SNAPUTIL_PROGRESS administrative view
  • CONTROL privilege on the SNAPUTIL_PROGRESS administrative view
  • DATAACCESS authority
  • DBADM authority
  • SQLADM authority
One of the following is required to use the table function:
  • EXECUTE privilege on the SNAP_GET_UTIL_PROGRESS table function
  • DATAACCESS authority
  • DBADM authority
  • SQLADM authority
In addition, to access snapshot monitor data, one of the following authorities is also required:
  • SYSMON
  • SYSCTRL
  • SYSMAINT
  • SYSADM

Default PUBLIC privilege

In a non-restrictive database, SELECT privilege is granted to PUBLIC when the view is automatically created.

Example

Retrieve details on total and completed units of progress by utility ID.
SELECT UTILITY_ID, PROGRESS_TOTAL_UNITS, PROGRESS_COMPLETED_UNITS, 
   DBPARTITIONNUM FROM SYSIBMADM.SNAPUTIL_PROGRESS
The following is an example of output from this query.
UTILITY_ID PROGRESS_TOTAL_UNITS PROGRESS_COMPLETED_UNITS DBPARTITIONNU
---------- -------------------- ------------------------ -------------
         7                   10                        5             0
         9                   10                        5             1

  1 record(s) selected.

SNAP_GET_UTIL_PROGRESS table function

The SNAP_GET_UTIL_PROGRESS table function returns the same information as the SNAPUTIL_PROGRESS administrative view, but allows you to retrieve the information for a specific database on a specific database member, aggregate of all database members or all database members.

Used in conjunction with the SNAP_GET_UTIL table function, the SNAP_GET_UTIL_PROGRESS table function provides the same information as the LIST UTILITIES SHOW DETAIL CLP command.

Refer to Table 1 for a complete list of information that can be returned.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-SNAP_GET_UTIL_PROGRESS--(--+--------+--)--------------------><
                              '-member-'      

The schema is SYSPROC.

Table function parameter

member
An optional input argument of type INTEGER that specifies a valid database member number. Specify -1 for the current database member, or -2 for an aggregate of all active database members. If this input option is not used, data will be returned from all active database members. An active database member is a member where the database is available for connection and use by applications.

If member is set to NULL, an attempt is made to read data from the file created by SNAP_WRITE_FILE procedure. Note that this file could have been created at any time, which means that the data might not be current. If a file with the corresponding snapshot API request type does not exist, then the SNAP_GET_UTIL_PROGRESS table function takes a snapshot for the currently connected database and database member number.

Authorization

One of the following authorizations is required:
  • EXECUTE privilege on the SNAP_GET_UTIL_PROGRESS table function
  • DATAACCESS authority
In addition, to access snapshot monitor data, one of the following authorities is also required:
  • SYSMON
  • SYSCTRL
  • SYSMAINT
  • SYSADM

Default PUBLIC privilege

In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.

Example

Retrieve details on the progress of utilities on the currently connect member.
SELECT UTILITY_ID, PROGRESS_TOTAL_UNITS, PROGRESS_COMPLETED_UNITS, 
   DBPARTITIONNUM FROM TABLE(SNAP_GET_UTIL_PROGRESS(-1)) as T
The following is an example of output from this query.
UTILITY_ID PROGRESS_TOTAL_UNITS PROGRESS_COMPLETED_UNITS DBPARTITIONNUM
---------- -------------------- ------------------------ --------------
         7                   10                        5              0

  1 record(s) selected.

Information returned

Table 1. Information returned by the SNAPUTIL_PROGRESS administrative view and the SNAP_GET_UTIL_PROGRESS table function
Column name Data type Description or corresponding monitor element
SNAPSHOT_TIMESTAMP TIMESTAMP The date and time that the snapshot was taken.
UTILITY_ID INTEGER utility_id - Utility ID . Unique to a database partition.
PROGRESS_SEQ_NUM INTEGER progress_seq_num - Progress sequence number . If serial, the number of the phase. If concurrent, then could be NULL.
UTILITY_STATE VARCHAR(16) utility_state - Utility state . This interface returns a text identifier based on the defines in sqlmon.h
PROGRESS_DESCRIPTION VARCHAR(2048) progress_description - Progress description
PROGRESS_START_TIME TIMESTAMP progress_start_time - Progress start time . Start time if the phase has started, otherwise NULL.
PROGRESS_WORK_METRIC VARCHAR(16) progress_work_metric - Progress work metric . This interface returns a text identifier based on the defines in sqlmon.h and is one of:
  • NOT_SUPPORT
  • BYTES
  • EXTENTS
  • INDEXES
  • PAGES
  • ROWS
  • TABLES
PROGRESS_TOTAL_UNITS BIGINT progress_total_units - Total progress work units
PROGRESS_COMPLETED_UNITS BIGINT progress_completed_units - Completed progress work units
DBPARTITIONNUM SMALLINT dbpartitionnum - Database partition number monitor element
MEMBER SMALLINT member - Database member monitor element