Search This Blog

Total Pageviews

Monday, 30 April 2018

Oracle How write into alert.log

Oracle How to write into alert.log


custom messages in alert log
package dbms_system.ksdwrt

        option 1- for trace file
        option 2- for alert log
        option 3- for both
connect / as sysdba

begin
    sys.dbms_system.ksdwrt(2, to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')||' --- Anuj test --- ');
end;
/

exec dbms_system.ksdwrt(1, 'This message goes to trace file in the udump location'); 
exec dbms_system.ksdwrt(2, 'This message goes to the alert log');
exec dbms_system.ksdwrt(3, 'This message goes to the alert log and trace file in the udump location')

begin
    exec sys.dbms_system.ksdwrt(2, to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')||' ******--- Anuj---******');
end;
/

or 

exec sys.dbms_system.ksdwrt(2, to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')||' ******--- Anuj---******');
exec sys.dbms_system.ksdwrt(2, to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')||' ******--- Start---******');
exec sys.dbms_system.ksdwrt(2, to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')||' ******--- Start Failover Change No: 7777777 ---******');


Oracle DBA

anuj blog Archive