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: How to see alert entries from stored procedure

Re: How to see alert entries from stored procedure

From: Knut Talman <knut.talman_at_mytoys.de>
Date: Fri, 08 Jun 2001 00:17:45 +0200
Message-ID: <3B1FFD89.C83067C7@mytoys.de>

> You can have your stored procedure execute an Oracle external procedure
> which could read the alert log and return what you are looking for.
 

> > Hello all,
> >
> > Is there is a way to see alert log entries from within an Oracle 8.1.7
> > stored procedure?

Modify your UTL_FILE_DIR entry in init.ora, that you can also read the directory where alert.log is stored. Then you can open, read and parse it with

DECLARE
  v_FileHandle UTL_FILE.FILE_TYPE;
  v_NewLine VARCHAR2(3000);
BEGIN
  v_FileHandle := UTL_FILE.FOPEN('directory_of', 'alert<SID>.log','r');   LOOP
    BEGIN

      UTL_FILE.GET_LINE(v_FileHandle, v_NewLine);
      <do some parsing>
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        EXIT;

    END;
  END LOOP;
  UTL_FILE.FCLOSE(v_FileHandle);
END;
/

Regards,

Knut

-- 
Knut Talman                                     Fon +49 30 72 62 01 411
dba_at_myToys.de                                   Fax +49 30 72 62 01 222
          The degree of normality in a database is inversely             
                    proportional to that of its DBA
Received on Thu Jun 07 2001 - 17:17:45 CDT

Original text of this message

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