DBA Tips Archive for Oracle
Sending messages to the standard alert log file
by Jeff Hunter, Sr. Database Administrator
Sending messages to Oracle's standard alert log file (alert_<SID>.log) file can be accomplished using the UTL_FILE package from within PL/SQL. First locate the background dump destination directory (background_dump_dest). This is the location to where Oracle will write the alert_<SID>.log file.
SQL> SELECT value FROM v$parameter WHERE name = 'background_dump_dest'; VALUE ------------------------------------------ /u01/app/oracle/admin/DBADB/bdump
You will then need to set the database parameter "UTL_FILE_DIR" to this directory. Edit your init<SID>.ora file and this entry.
i.e. UTL_FILE_DIR = /u01/app/oracle/admin/DBADB/bdump
After setting the UTL_FILE_DIR in your init<SID>.ora file, you will
need to bounce the database. After successfully bouncing the database, you can
then open and append to the alert_<SID>.log file from within PL/SQL using the
Copyright (c) 1998-2018 Jeffrey M. Hunter. All rights reserved.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at firstname.lastname@example.org.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.