ITPub博客

首页 > Linux操作系统 > Linux操作系统 > DB2_获取健康设置

DB2_获取健康设置

原创 Linux操作系统 作者:redhouser 时间:2011-07-14 10:45:31 0 删除 编辑

目的:
测试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/,如需转载,请注明出处,否则将追究法律责任。

下一篇: DB2_获取诊断日志
请登录后发表评论 登录
全部评论

注册时间:2011-05-26

  • 博文量
    211
  • 访问量
    810161