Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: functon or stored procedure to check alert file?

Re: functon or stored procedure to check alert file?

From: Jurij Modic <jmodic_at_src.si>
Date: Sun, 13 Jun 1999 20:13:40 GMT
Message-ID: <37650deb.24632008@news.siol.net>


On Sat, 12 Jun 1999 23:57:44 -0700, David Spaisman <davedba_at_intercall.net> wrote:

>Hello:
>
>I have several Oracle 8.0.4 applicartions running on NT 4.0 sp 3.
>
>I would like to periodically check the alert file to see if there any
>errors. Even better, I would like to hve email sent to me if there are
>any ORA- errors. I intend to do this in batch and periodically during
>the day. I currently manually look at the alert log.
>
>Has ant one done this before? Does any one have a function or stored
>procedure to do so? Any other job. Could this be done with dbms_alert
>package? Hoe to trap errors?

As alert file is stored "outside" of the database, the most "natural" way would be to handle this in the OS level.

For "periodically": you can set up a batch that executes at predetermined intervals vie NT's AT scheduler (very clumsy one)

For "check": you should write your own application that searches the alert file for unexpected events. Or even better, find something that behaves like grep/sed/awk in Unix and simply include them into your batch.

For "e-mailing": that shouldn't be to hard to achieve, even on NT.

If you wan't to do this from "inside" your database, than you should use UTL_FILE to read the alert file, your own PL/SQL procedure to filter out the irregular events from the alert, DBMS_JOB to perform all this periodically and external procedures calls of Oracle8 (database library, TNS listener process) for e-mailing. I don't think DBMS_ALERT would be of any use here.

In Oracle 8i you could use the new "database event" triggers, more specifically the AFTER SERVERERROR trigger. It fires whenever the ORA error is logged in the alert file, so you could be notified immediately after the error occurs, whithot the need to periodically check the alert file.

>Thanks.
>
>David Spaisman

HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Sun Jun 13 1999 - 15:13:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US