DB2 Version 9.7 for Linux, UNIX, and Windows

HEALTH_GET_ALERT_ACTION_CFG table function

Returns health alert action configuration settings for various object types (database manager, database, table space, and table space container) and for various configuration levels (install default, instance, global, and object).

Important: This table function has been deprecated and might be removed in a future release because the health monitor has been deprecated in Version 9.7. For more information, see Health monitor has been deprecated.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-HEALTH_GET_ALERT_ACTION_CFG--(--objecttype--,---------------->

>--cfg_level--,--dbname--,--objectname--)----------------------><

The schema is SYSPROC.

Table function parameters

objecttype
An input argument of type VARCHAR(3) that indicates the object type. The value must be one of the following case-insensitive values:
  • 'DBM' for database manager
  • 'DB' for database
  • 'TS' for table space
  • 'TSC' for table space container
Note: Leading and trailing spaces will be ignored.
cfg_level
An input argument of type VARCHAR(1) that indicates the configuration level. The value must be one of the following case-insensitive values:
  • For objecttype 'DBM': 'D' for install default; 'G' or 'O' for instance level.
  • For objecttype that is not 'DBM': 'D' for install default; 'G' for global level; 'O' for object level.
dbname
An input argument of type VARCHAR(128) that indicates the database name. The database name must be provided if objecttype is 'DB', 'TS', or 'TSC', and cfg_level is 'O'. For all other combinations of objecttype and cfg_level, the dbname parameter should be NULL (or an empty string).
objectname
An input argument of type VARCHAR(1024) that indicates the object name, for example, <table space name> or <table space name>.<container name>. The object name must be provided if objecttype is 'TS' or 'TSC', and cfg_level is 'O'. For all other combinations of objecttype and cfg_level, the objectname parameter should be NULL (or an empty string).

Authorization

EXECUTE privilege on the HEALTH_GET_ALERT_ACTION_CFG table function.

Examples

Example 1: Retrieve object level alert action configuration settings for database SAMPLE for health indicator ID 1004.
SELECT OBJECTTYPE, CFG_LEVEL, SUBSTR(DBNAME,1,8) AS DBNAME, 
   SUBSTR(OBJECTNAME,1,8) AS OBJECTNAME, ID, IS_DEFAULT, 
   SUBSTR(CONDITION,1,10) AS CONDITION, ACTIONTYPE, 
   SUBSTR(ACTIONNAME,1,30) AS ACTIONNAME, SUBSTR(USERID,1,8) AS USERID, 
   SUBSTR(HOSTNAME,1,10) AS HOSTNAME, SCRIPT_TYPE, 
   SUBSTR(WORKING_DIR,1,10) AS WORKING_DIR, TERMINATION_CHAR, 
   SUBSTR(PARAMETERS,1,10) AS PARAMETERS 
FROM TABLE(HEALTH_GET_ALERT_ACTION_CFG('DB','O','SAMPLE','')) AS ACTION_CFG 
WHERE ID = 1004
The following example is a sample output for this query.
OBJECTTYPE CFG_LEVEL DBNAME   OBJECTNAME ID        IS_DEFAULT CONDITION 
---------- --------- -------- ---------- --...---- ---------- ----------
DB         O         SAMPLE                   1004          1 ALARM     
DB         O         SAMPLE                   1004          1 ALARM     
                                                                        
  2 record(s) selected.                                                 
Output for this query (continued).
... ACTIONTYPE ACTIONNAME                     USERID   HOSTNAME  
... ---------- ------------------------------ -------- ----------
... S          ~/health_center/script/scrpn6  uid1     -         
... T          00.0005                        uid1     HOST3     
Output for this query (continued).
... SCRIPT_TYPE WORKING_DIR TERMINATION_CHAR PARAMETERS  
... ----------- ----------- ---------------- ----------  
... O           ~/health_c  -                -           
... -           -           -                -           
Example 2: Retrieve the condition, action type, action name, hostname, and script type for database SAMPLE for health indicator ID 1004.
SELECT CONDITION, ACTIONTYPE, SUBSTR(ACTIONNAME,1,35) AS ACTIONNAME, 
   SUBSTR(USERID,1,8) AS USERID, SUBSTR(HOSTNAME,1,10) AS HOSTNAME, SCRIPT_TYPE 
FROM TABLE(HEALTH_GET_ALERT_ACTION_CFG('DB','O','SAMPLE','')) AS ALERT_ACTION_CFG 
WHERE ID=1004
The following example is a sample output for this query.
CONDITION       ACTIONTYPE ACTIONNAME                       ...
---------...--- ---------- -------------------------------- ...
ALARM           S          ~/health_center/script/scrpn6    ...
ALARM           T          00.0005                          ...
                                                               
  2 record(s) selected.                                        
Output for this query (continued).
... USERID   HOSTNAME   SCRIPT_TYPE  
... -------- ---------- -----------  
... uid1     -          O            
... uid1     HOST3      -            

Usage notes

The HEALTH_GET_IND_DEFINITION table function can be used to map health indicator IDs to the health indicator names.

Information returned

Table 1. Information returned by the HEALTH_GET_ALERT_ACTION_CFG table function
Column name Data type Description
OBJECTTYPE VARCHAR(3) Object type.
CFG_LEVEL CHAR(1) Configuration level.
DBNAME VARCHAR(128) Database name.
OBJECTNAME VARCHAR(512) Object name.
ID BIGINT Health indicator ID.
IS_DEFAULT SMALLINT Whether the settings is the default: 1 if it is the default, 0 if it is not the default, Null if it is not applicable.
CONDITION VARCHAR(32) Alert condition upon which the action is triggered.
ACTIONTYPE CHAR(1) Action type: 'S' for script action or 'T' for task action.
ACTIONNAME VARCHAR(5000) If ACTIONTYPE is 'S', this is the script path name. If ACTIONTYPE is 'T', this is the task ID.
USERID VARCHAR(1024) User name under which the action will be executed.
HOSTNAME VARCHAR(255) hostname - Host name monitor element
SCRIPT_TYPE CHAR(1) Script type: If ACTIONTYPE is 'S', 'O' for operating system command script or 'D' for DB2® command script; If ACTIONTYPE is 'T', Null.
WORKING_DIR VARCHAR(5000) The working directory for the script if ACTIONTYPE is 'S' or Null if ACTIONTYPE is 'T'.
TERMINATION_CHAR VARCHAR(4) The statement termination character if it is a DB2 command script action, otherwise Null.
PARAMETERS VARCHAR(200) The command line parameters if it is an operating system command script action.