In addition, this condition need only occur during one reporting period, which by default is one
minute. For the other conditions in this list, the condition must be true anywhere between 2 and
15 consecutive reporting periods before an alert is issued.
To change the level at which an alert is generated, we can use the DBMS_SERVER_ALERT.
SET_THRESHOLD procedure. In this example, we want to be notified sooner if a tablespace is
running out of space, so we will update the warning threshold for alert notification from 85
percent down to 60 percent:
--
-- PL/SQL anonymous procedure to update the Tablespace Space Usage threshold
--
declare
/* OUT */
warning_operator number;
warning_value varchar2(100);
critical_operator number;
critical_value varchar2(100);
observation_period number;
consecutive_occurrences number;
/* IN */
metrics_id number;
instance_name varchar2(50);
object_type number;
object_name varchar2(50);
new_warning_value varchar2(100) := '60';
begin
metrics_id := DBMS_SERVER_ALERT.TABLESPACE_PCT_FULL;
object_type := DBMS_SERVER_ALERT.OBJECT_TYPE_TABLESPACE;
instance_name := 'dw';
object_name := NULL;
192 Oracle Database 11g DBA Handbook
-- retrieve the current values with get_threshold
dbms_server_alert.get_threshold(
metrics_id, warning_operator, warning_value,
critical_operator, critical_value,
observation_period, consecutive_occurrences,
instance_name, object_type, object_name);
-- update the warning threshold value from 85 to 60
dbms_server_alert.
Pages:
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348