DB2_獲取健康設定

redhouser發表於2011-07-14

目的:
測試DB2獲取健康設定,本指令碼摘錄自DB2安裝目錄admin_scripts/gethealthconfig.db2。
版本:Windows DB2 Express-C V9.7

操作步驟:
使用"db2cmd db2 -t"進入互動模式,執行後續操作。

-- connect to sample database
CONNECT TO SAMPLE;

-- Get the definition for health indicator db2.mon_heap_util
SELECT D.ID,
       SUBSTR(D.SHORT_DESCRIPTION, 1, 25) AS SHORT_DESCRIPTION,
       SUBSTR(D.FORMULA, 1, 55) AS FORMULA
  FROM TABLE(SYSPROC.HEALTH_GET_IND_DEFINITION('')) AS D
  WHERE NAME = 'db2.mon_heap_util';

-- Get alert configuration for health indicator db.log_util on database SAMPLE
SELECT SUBSTR(D.NAME, 1, 15) AS NAME,
       C.EVALUATE,
       C.ACTION_ENABLED,
       C.WARNING_THRESHOLD,
       C.ALARM_THRESHOLD
  FROM TABLE(SYSPROC.HEALTH_GET_IND_DEFINITION('')) AS D,
       TABLE(SYSPROC.HEALTH_GET_ALERT_CFG('DB', 'O', 'SAMPLE', '')) AS C
  WHERE D.ID = C.ID AND D.NAME = 'db.log_util';

-- Get Global default alert configuration settings for tablespaces on health indicator ts.ts_util
SELECT SUBSTR(D.NAME, 1, 15) AS NAME,
       C.EVALUATE,
       C.ACTION_ENABLED,
       C.WARNING_THRESHOLD,
       C.ALARM_THRESHOLD
  FROM TABLE(SYSPROC.HEALTH_GET_IND_DEFINITION('')) AS D,
       TABLE(SYSPROC.HEALTH_GET_ALERT_CFG('TS', 'G', '', '')) AS C
  WHERE D.ID = C.ID AND D.NAME = 'ts.ts_util';

-- disconnect from the database
CONNECT RESET;

TERMINATE;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18922393/viewspace-702164/,如需轉載,請註明出處,否則將追究法律責任。

相關文章