Question & Answer
Question
How can ITCAM DB2 monitoring agent in PureScale cluster environment be used to display "Last backup timestamp" for databases between cluster members?
Cause
Database backup in a PureScale environment:
A database may have been backed up on the current member, and then again on another member of the cluster. Thus the last backup timestamp for a database may be different for each member of the cluster. The most recent "Last backup timestamp" between the members needs to be considered in a PureScale environment.
How does DB2 agent report "Last backup timestamp:
DB2 monitoring agent uses local snapshot for the database to report the "Last Backup" attribute for a database. (The "Last Backup" column is displayed on DB2 agent workspace Database->Database Identification / Status Information.)
For example, on member Node1, you can run following command to get "Last backup timestamp" for db01 database on this node:
==> db2 get snapshot for database on db01 | grep backup
Last backup timestamp = 08/27/2013 07:35:01.000000
On member Node2, you may get a different value if the same database was backed up on Node2 at a different time:
==> db2 get snapshot for database on db01 | grep backup
Last backup timestamp = 09/06/2013 07:35:01.000000
DB2 agent displays "Last backup timestamp" based on local snapshot as shown in above example. Thus DB2 agent on each member node may display a different "Last backup timestamp" for the same database even though the most recent one counts.
How to display most recent Last backup timestamp in PureScale environment
To display the most recent "Last backup timestamp" between PureScale cluster members, you can use one of the following methods:
1) Use snapshot command with "global" parameter. In this example, 'octigate' is name of the database:
db2 get snapshot for database on octigate global | grep backup
Last backup timestamp = 08/29/2013 13:10:26.000000
2) Or use following SQL to get LAST_BACKUP amongst the members:
SELECT SUBSTR(DB_NAME, 1, 20) AS DB_NAME, DB_STATUS, SERVER_PLATFORM,
DB_LOCATION, LAST_BACKUP FROM TABLE(SNAP_GET_DB('', -2)) AS T
For example, for database named 'octigate', use following steps:
db2 connect to octigate
db2 "SELECT SUBSTR(DB_NAME, 1, 20) AS DB_NAME, DB_STATUS, SERVER_PLATFORM,
DB_LOCATION, LAST_BACKUP FROM TABLE(SNAP_GET_DB('', -2)) AS T "
DB_NAME DB_STATUS SERVER_PLATFORM DB_LOCATION LAST_BACKUP
--------------- ---------------- ---------------------------- ----------- --------------------------
OCTIGATE 0 30 1 13-08-29-13.10.26.000000
Answer
Customized SQL feature of DB2 monitoring agent (available in 7.1 and higher releases) can be used to monitor "Last backup timestamp" in a PureScale environment.
Steps to implement the monitoring of "Last backup timestamp" in PureScale environment:
1) Define a customized SQL by editing the ITM_HOME/config/kudcussql.properties (or the file configured for the Customized SQLs of the agent) as shown in the example below:
[SELECTSQL]
SQL_ID=purescale_last_backup
SQL_TEXT=SELECT SUBSTR(DB_NAME, 1, 20) AS DB_NAME, DB_STATUS, SERVER_PLATFORM, DB_LOCATION, LAST_BACKUP FROM TABLE(SNAP_GET_DB('', -2)) AS T
2) Restart the agent.
3) Use the Customized SQL Result workspace to view result of custom SQL results. (In the following screen print, the columns in Customized SQL Result view have been re-ordered to display SQL results.)
For additional information on Customized SQL feature, refer to agent User Guide.
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21650638