<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#0050d0">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Try writing a
program destination driver to sqlplus instead of using a named pipe.
Without knowing exactly what is happening, I dont know if this will
accomplish anything.<br>
Also, this would seem to be something you'd need to take up with oracle
as it would seem sqlplus is as fault for not handling a disconnect, not
syslog-ng.<br>
<br>
A more graceful solution would be to use the sql destination driver,
which has the ability to reconnect if the connection is terminated.<br>
<br>
-Patrick<br>
</font></font><br>
Sent: Wed Nov 10 2010 10:23:54 GMT-0700 (Mountain Standard Time)<br>
From: vijay <a class="moz-txt-link-rfc2396E" href="mailto:bhaskarpeddi@gmail.com">&lt;bhaskarpeddi@gmail.com&gt;</a><br>
To: Syslog-ng users' and developers' mailing list
<a class="moz-txt-link-rfc2396E" href="mailto:syslog-ng@lists.balabit.hu">&lt;syslog-ng@lists.balabit.hu&gt;</a> <br>
Subject: [syslog-ng] writing to Database
<blockquote
 cite="mid:AANLkTinPYZ5AoLcEfRe1vymW_v2QZO53Wz74_Tuexo=F@mail.gmail.com"
 type="cite">
  <pre wrap="">Hi All,

 Iam writing syslog-ng entries in to database by configuring in
syslog-ng.conf like below

destination d_oracle {
            pipe("/dev/ora.pipe" template ("INSERT INTO logs (LL_HOST,
LL_facility, LL_priority,LL_level, LL_tag,LL_DATE, LL_program, LL_msg)
VALUES ( '$HOST', '$FACILITY', '$PRIORITY','$LEVEL',
'$TAG',to_date('$YEAR.$MONTH.$DAY $HOUR:$MIN:$SEC', 'yyyy.mm.dd
hh24:mi:ss'),'$PROGRAM', substrc('$MSG',1,511));\n COMMIT;\n")
template-escape(yes));
};

Iam writting logs from pipe to database.Iam using below script.

nohup sqlplus UNAME/PWORD@IPADDRESS/orcl @/dev/ora.pipe  &gt; /dev/null &amp;.

Sometimes pipe is getting blocked.one reason we are suspecting is DB
server restarting.How to handle these situations.Even the DB server
restarting the script process is alive but it is not writing to DB.


                                            vijay
______________________________________________________________________________
Member info: <a class="moz-txt-link-freetext" href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
Documentation: <a class="moz-txt-link-freetext" href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a>
FAQ: <a class="moz-txt-link-freetext" href="http://www.campin.net/syslog-ng/faq.html">http://www.campin.net/syslog-ng/faq.html</a>

  </pre>
</blockquote>
</body>
</html>