Retrieving health recommendations using the command line processor

Recommendations can be retrieved using the GET RECOMMENDATIONS command from the command line processor (CLP). The command syntax supports querying recommendations to resolve a specific health alert, such as a health indicator that entered an alert state on a particular object.

Before you begin

You must have an instance attachment to retrieve recommendations from the health monitor. If there is not an attachment to an instance, a default instance attachment is created. To obtain recommendations from a health monitor on a remote instance, you must first attach to that instance. No special authority is required to retrieve recommendations from the health monitor.

About this task

The command syntax also supports retrieval of the complete set of recommendations for a specific health indicator, which does not have to be in an alert state when the command is executed. Recommendations for resolving an alert on a specific health indicator can be queried at either a single partition level or a global level.

When querying recommendations on a health alert on a specific object, the health monitor is solving a specific alert and is able to provide details on the alert that is being resolved in the problem section of the output.

The health monitor is also able to provide a ranking for the recommendations and, in some cases, it might be able to generate scripts that can be executed to resolve the alert. Additionally, the health monitor might reject and not display some recommendations if they are not applicable to the particular problem situation. Alternatively, if recommendations are queried by health indicator name only, as in the first example shown, the total set of possible recommendations is always returned. In such cases, the CLP command is simply providing information about actions that you should consider undertaking if they see an alert.

Important: The health monitor, health indicators, and related components have been deprecated and might be removed in a future release. Health monitor is not supported in Db2® pureScale® environments. For more information, see Health monitor has been deprecated.

Procedure

Retrieve the recommendations using the GET RECOMMENDATIONS command:

  • You might want to issue the following command to see the total set of actions that could be recommended to resolve an alert on the db.db_op_status health indicator.
    db2 get recommendations for health indicator db.db_op_status
    
    In this example, the full set of recommendations for the db.db_op_status health indicator is returned. The health indicator does not have to be in an alert state to issue this command.

    This output shows that there are two possible recommendations for this health indicator: unquiesce the database or investigate rollforward progress on the database. Because the command is being used to query all possible recommendations, rather than to ask how to resolve a specific alert, the health monitor cannot identify the best recommendation in this case. As a result, the full set of recommendations is returned.

    Recommendations:
    
    Recommendation: Investigate rollforward progress.
    
    A rollforward is in progress on the database due to an explicit 
    request from the administrator. You have to wait for the rollforward 
    to complete for the instance to return to active state.
    
    
    From the Command Line Processor, issue the commands shown in the 
    following example to view the progress of the rollforward 
    utility:
    
    LIST UTILITIES SHOW DETAIL
    
    Recommendation: Unquiesce the database.
    
    The database has been put into QUIESCE PENDING or QUIESCE state by 
    an explicit request from the administrator. If you have QUIESCE_CONNECT 
    authority, or are DBADM or SYSADM, you will still have access to the 
    database and will be able to use it normally. For all other users, new 
    connections to the database are not permitted and new units of work 
    cannot be started. Also, depending on the quiesce request, active 
    units of work will be allowed to complete or will be rolled back 
    immediately. You can issue an unquiesce to return to active state.
    
    
    From the Command Line Processor, issue the commands shown in the 
    following example:
    
    CONNECT TO DATABASE database-alias
    UNQUIESCE DATABASE
  • Suppose you observe that the health indicator db.db_heap_util entered an alert state for the database SAMPLE, and you want to determine how to resolve the alert. In this case, you want to resolve a specific problem, therefore you could issue the GET RECOMMENDATIONS command in the following way:
    db2 get recommendations for health indicator db.db_heap_util 
        for database on sample
    
    
    This output shows a summary of the problem and a set of recommendations to resolve the problem. The health monitor ranked the recommendations in its order of preference. Each recommendation contains a description and a set of actions that indicate how to perform the recommended action.
    Problem:
    
        Indicator Name                             = db.db_heap_util
           Value                                   = 42
           Evaluation timestamp                    = 11/25/2003 19:04:54
           Alert state                             = Alarm
           Additional information                  = 
    
    Recommendations:
    
    Recommendation: Increase the database heap size.
    Rank: 1
    
    Increase the database configuration parameter dbheap sufficiently 
    to move utilization to normal operating levels. To increase the 
    value, set the new value of dbheap to be equal to 
    (pool_cur_size / (4096*U)) where U is the desired utilization rate. 
    For example, if your desired utilization rate is 60% of the warning 
    threshold level, which you have set at 75%, then 
    U = 0.6 * 0.75 = 0.45 (or 45%).
    
    Execute the following commands at the Db2 server (this can be done using 
    the EXEC_DB2_CMD stored procedure):
    
    CONNECT TO DATABASE SAMPLE;
    UPDATE DB CFG USING DBHEAP 149333;
    CONNECT_RESET;
    
    
    Recommendation: Investigate memory usage of database heap.
    Rank: 2
    
    There is one database heap per database and the database manager uses 
    it on behalf of all applications connected to the database. The data 
    area is expanded as needed up to the maximum specified by dbheap.
    
    For more information on the database heap, refer to the Db2  
    documentation.
    
    Investigate the amount of memory that was used for the database heap 
    over time to determine the most appropriate value for the database 
    heap configuration parameter. The database system monitor tracks the 
    highest amount of memory that was used for the database heap.
    
    
  • For partitioned database systems, you can query recommendations for a health indicator that entered an alert state on a certain partition, or globally for all partitions. When recommendations are queried globally, a set of recommendations is returned that applies to the health indicator on all partitions. For example, if the health indicator is in an alert state on partitions 1 and 3, a collection of two scripts might be returned where each script is to be applied to a different partition.
    The following example shows how to query recommendations for a health indicator on a specific partition (in this example, partition number 2):
    db2 get recommendations for health indicator db.db_heap_util 
      for database on sample at dbpartitionnum 2
    The following example shows how to retrieve a set of recommendations to resolve a health indicator that is in an alert state on several partitions:
    db2 get recommendations for health indicator db.db_heap_util 
      for database on sample global