Chinaunix首页 | 论坛 | 博客
  • 博客访问: 249329
  • 博文数量: 64
  • 博客积分: 1416
  • 博客等级: 上尉
  • 技术积分: 565
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-18 10:54
文章分类

全部博文(64)

文章存档

2011年(4)

2010年(60)

我的朋友

分类: Oracle

2010-04-08 21:52:53

DBMS_SERVER_ALERT 简介:是oracle里用来设置数据库告警服务的。当一个被监控的测量值超过阀值就会启动事件,并记录到数据库中。

Managing Server-Generated Alerts
Threshold alerts leverage the metrics computed by the MMON process to determine potential
performance problems. This is accomplished by comparing the current metrics to preset
threshold levels. If the threshold is exceeded, an alarm is generated.
阀值与非阀值报警
Non-threshold alerts are generated based on specific database events, rather than on threshold settings.
默认报警 oracle提供一组预定义报警
报警过程概述
The MMON process automatically computes metric values from in-memory performance statistics once every minute.


Using Enterprise Manager to Configure Thresholds
查看度量阀值 EM DATABASE CONTROL--MAMAGE METRICS 编辑度量阀值,设置多阀值
通过PL/SQL设置阀值
http://www.stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10802/d_salt.htm#1000747
TABLE 8 . 7 Comparison Operator Constants
Comparison Operator Description
OPERATOR_CONTAINS Metrics value is contained in the list of threshold values.
OPERATOR_DO_NOT_CHECK Will not apply default threshold to a specified object type.
OPERATOR_EQ Metrics value is equal to the threshold value.
OPERATOR_GE Metrics value is greater than or equal to the threshold value.
OPERATOR_GT Metrics value is greater than the threshold value.
OPERATOR_LE Metrics value is less than or equal to the threshold value.
OPERATOR_LT Metrics value is less than the threshold value.
OPERATOR_NE Metrics value is not equal to the threshold value.


exec DBMS_SERVER_ALERT.SET_THRESHOLD
(9000, --Metric Identifier, METRIC_ID in V$METRICNAME
DBMS_SERVER_ALERT.OPERATOR_GE, --Operator for Warning Threshold
'60', --Warning Threshold
DBMS_SERVER_ALERT.OPERATOR_GE, --Operator for Critical Threshold
'80', --Critical Threshold
1, --Observation Period in Minutes
1, --Occurrences
NULL, --Instance Name (NULL implies ORACLE_SID value)
DBMS_SERVER_ALERT.OBJECT_TYPE_TABLESPACE, ??Object Type
'KITCHEN' --Name of the Object);


BEGIN
DBMS_SERVER_ALERT.SET_THRESHOLD(
METRICS_ID => DBMS_SERVER_ALERT.CPU_TIME_PER_CALL,
WARNING_OPERATOR => DBMS_SERVER_ALERT.OPERATOR_GT,
WARNING_VALUE => '15000',
CRITICAL_OPERATOR => DBMS_SERVER_ALERT.OPERATOR_GT,
CRITICAL_VALUE => '30000',
OBSERVATION_PERIOD => 10,
CONSECUTIVE_OCCURRENCES => 3,
instance_name=>'ORCL',
object_type=>DBMS_SERVER_ALERT.OBJECT_TYPE_SERVICE,
object_name=>'ORCL.COM'
);
END;
阅读(3558) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~