Tuesday, September 3, 2013

How to write in alert log from database

KSDWRT
Used to write messages to the alertlog and/or trace files.

EXEC DBMS_System.ksdwrt(n, message);
EXEC DBMS_System.ksdwrt(2, 'My Test Alertlog Message');Where the value of "n" indicates the destination.

1 - Write to trace file.
2 - Write to alertlog.
3 - Write to both.


SQL> exec dbms_system.KSDWRT (2,'Shutting down for maintenance');

PL/SQL procedure successfully completed.




No comments:

Post a Comment