Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

TBS alert

BeefStuJun 30 2015 — edited Jul 12 2015

Can somebody help me put together some PL/SQL code. I am trying to put together
a simple version of the following:

DBMS_SERVER_ALERT.SET_THRESHOLD(
   metrics_id              => DBMS_SERVER_ALERT.TABLESPACE_PCT_FULL,
   warning_operator        => DBMS_SERVER_ALERT.OPERATOR_GT,
   warning_value           => '0',
   critical_operator       => DBMS_SERVER_ALERT.OPERATOR_GT,
   critical_value          => '0',
   observation_period      => 1,
   consecutive_occurrences => 1,
   instance_name           => NULL,
   object_type             => DBMS_SERVER_ALERT.OBJECT_TYPE_TABLESPACE,
   object_name             => 'USERS');
END;
/


1) Check all TBS in DB if one of them is over the default threshold of 90%
   than return a value as to how much MB will be needed to put the TBS down to
   80%  If I need to have different values there would be tbs_threshold_overide table

create table tbs_threshold_overide
  tablespace_name varchar2 (30)
  pct_full_alert (number 2)
  check_tbs (varchar 1)  # this is if I want to disable the check if set to Y
                         # than disable the check if record does not exist or set to
                         # 'N' than do the check.
 

Thanks in advance to all who answer. Some example calls would be greatly appreciated,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2015
Added on Jun 30 2015
11 comments
1,989 views