Manually write in Alert log file with dbms_system.ksdwrt Package in Oracle

Generate ORA error in Alert log file with dbms_system.ksdwrt Oracle

We can generate entry in alert log file for making alerts on sepecific things with help of dbms_system package.

It help us to configured alert for us in alert log file. We can monitor alert log file with lot of monitoring tools which will help us when specific condition occurred in database or application level then we get alert in alert log file of Oracle.

Generate your own error in alert log file
dbms_system.ksdwrt is the package used to write in alert log.

Syntax
Execute the following command to write any message in alert log.

dbms_system.ksdwrt(3, 'message');

Example
To write on alert log file through package, we are monitoring ETL job with alert log if record above 600000 then it write message in alert log.

create or replace procedure monitoredrep as
n_count number;
begin
select count(*) into n_count from TRACKNTRACE.SSA_REPL_LOG;
if n_count > 600000 then
dbms_system.ksdwrt(3,'ORA-3 Count value of SSA_REPL_LOG is higher than 600000 in PRODAMP Database');
end if;
end;
/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.