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. It is not supported in Db2®
pureScale® environments. For
more information, see Health monitor has been deprecated..
Syntax
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
One of the following authorities is required to execute the routine:
- EXECUTE privilege on the routine
- DATAACCESS authority
- DBADM authority
- SQLADM authority
Default PUBLIC privilege
In a non-restrictive database, EXECUTE privilege is granted to PUBLIC when the function is automatically created.
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 is an example of
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 is an example of 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
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 - Object name monitor element |
ID | BIGINT | id - cluster caching facility identification monitor element |
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 an operating system command script or 'D' for a database command script; if ACTIONTYPE is 'T', this value is null. |
WORKING_DIR | VARCHAR(5000) | If ACTIONTYPE is 'S', the working directory for the script; if ACTIONTYPE is 'T', this value is null. |
TERMINATION_CHAR | VARCHAR(4) | For a database command script action, the statement termination character; otherwise, this values is null. |
PARAMETERS | VARCHAR(200) | For a operating system command script action, the command line parameters. |