dbms_system.ksdwrt Procedure to Write Custom Messages to Oracle Alert and Trace Files Manually

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
For some reasons Oracle DBAs needs to write custom messages to the alert log for better commenting or readability. This can be achieved by dbms_system.ksdwrt package.

Here is the syntax:


execute sys.dbms_system.ksdwrt(<argument>,to_char(sysdate)|| ' -- ');
where the argument values can be
  • 1 to write to trace file
  • 2 to write to alert log file
  • 3 to write both trace and alert logfile.

Example:
SQL> exec dbms_system.ksdwrt(2,'Database bounced for increasing the value of distributed_lock_timeout');

PL/SQL procedure successfully completed.

$ tail alert_prod9.log
Mon Aug 08 03:32:23 2011
Incremental checkpoint up to RBA [0x4a.107ae1.0], current log tail at RBA [0x4a.1084ae.0]
Mon Aug 08 04:02:29 2011
Incremental checkpoint up to RBA [0x4a.109252.0], current log tail at RBA [0x4a.109d5e.0]
Mon Aug 08 04:06:39 2011
Database bounced for increasing the value of distributed_lock_timeout

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer