Tuesday, February 01, 2011

KSDWRT

(Tested on Oracle 10.2.0.1.0)

With a parameter of 1, ksdwrt writes a message to a trace file in user_dump_dest:

SQL> exec sys.dbms_system.ksdwrt -
> (1, '*** Message to trace file ***');

PL/SQL procedure successfully completed.

SQL>


With a parameter of 2, ksdwrt writes a message to the alert log:
 
SQL> exec sys.dbms_system.ksdwrt -
> (2, '*** Message to alert log ***');

PL/SQL procedure successfully completed.

SQL>


With a parameter of 3, ksdwrt writes a message to a trace file AND the alert log:
 

SQL> exec sys.dbms_system.ksdwrt -
> (3, '*** Message to trace file and alert log ***');

PL/SQL procedure successfully completed.

SQL>


Now click on the screen print below (you may then also need to enlarge it to bring it into focus):


At the top is the trace file. Note that it contains both messages as they came from the same session.

At the bottom is the alert log, which also contains two messages. There is nothing else in it because I deleted the existing alert log before I started. Then, when I ran the SQL above, Oracle created a new one.

No comments: