Viewing status information for hosts in a Db2 pureScale instance

You can retrieve basic information that shows the overall status of hosts in a Db2 pureScale instance. This information tells you whether the host is active or not, if the instance is running on the host, and whether there are any alerts that require investigation.

About this task

Viewing the status of the hosts in a Db2 pureScale instance is one of the first places to start to get an overall view of the status of the instance.

One way to retrieve this status is using the DB2_CLUSTER_HOST_STATE administrative view. This view returns status information for all hosts in the instance. You can also use the following interfaces to retrieve information about host status:
  • DB2_GET_CLUSTER_HOST_STATE table function. This approach is useful if you want to query the status of a particular host, as the table function accepts a host ID as a parameter.
  • LIST INSTANCE command.
  • db2instance command, with the -list parameter

Procedure

To view the status of the hosts in a Db2 pureScale instance:

  1. Formulate an SQL statement using either the DB2_CLUSTER_HOST_STATE administrative view, or the DB2_GET_CLUSTER_HOST_STATE table function.
    This example uses the administrative view:
    SELECT varchar(HOSTNAME,10) AS HOST,
           varchar(STATE,8) AS STATE, 
           varchar(INSTANCE_STOPPED,7) AS STOPPED, 
           ALERT  
    FROM SYSIBMADM.DB2_CLUSTER_HOST_STATE
  2. Run the query.

Results

The output of running the preceding SQL statement would look like this:

HOST       STATE    STOPPED ALERT
---------- -------- ------- --------
HOSTD      ACTIVE   NO      NO
HOSTB      ACTIVE   NO      NO
HOSTA      ACTIVE   YES     NO
HOSTC      ACTIVE   NO      NO

  4 record(s) selected.

In this example, there are 4 hosts in this instance. Three are active, which just means that the systems are powered on, and are able to respond to operating system commands. One host is stopped, which means that the instance has been stopped on that host explicitly by the administrator. There are no alerts that require investigation.

Example

Retrieving host status using the DB2_GET_CLUSTER_HOST_STATE table function
The DB2_GET_CLUSTER_HOST_STATE table function also lets you retrieve status information about hosts in a Db2 pureScale instance. One of the benefits of the table function is that you can pass parameters to it to narrow the scope of the results returned. For example, to retrieve information about the host HOSTD in the Db2 pureScale instance, construct a query like the following:
SELECT varchar(HOSTNAME,10) as HOST,
       varchar(STATE,10) AS STATE,
       ALERT 
FROM TABLE(DB2_GET_CLUSTER_HOST_STATE('HOSTD'))

Results:


HOST       STATE      ALERT
---------- ---------- --------
HOSTD      ACTIVE     NO

  1 record(s) selected.