Re: Oracle 8.1.7 log to syslogd (404 Views)
Reply
Frequent Advisor
RiclyLeRoy
Posts: 45
Registered: ‎11-14-2009
Message 1 of 7 (404 Views)
Accepted Solution

Oracle 8.1.7 log to syslogd

Can I send Oracle logs directly to syslog daemon ? My HP-UX is B.11.00 and Oracle is 8.1.7.0.0
Please use plain text.
Exalted Contributor
Steven E. Protter
Posts: 33,806
Registered: ‎08-15-2002
Message 2 of 7 (404 Views)

Re: Oracle 8.1.7 log to syslogd

Shalom,

Sure you CAN send them to the syslog.

You really should not. The Oracle alert file is meant for Oracle specific information.

You can configure HP products like ITO/OVO to check these logs and alert you to issues.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Please use plain text.
Honored Contributor
Aneesh Mohan
Posts: 804
Registered: ‎07-02-2007
Message 3 of 7 (404 Views)

Re: Oracle 8.1.7 log to syslogd

It is not a wise option at all.It will make things complicated.

Let Oracle log in to its alert log and System logs in syslog.

Aneesh
Please use plain text.
Honored Contributor
Olivier Masse
Posts: 623
Registered: ‎04-19-2003
Message 4 of 7 (404 Views)

Re: Oracle 8.1.7 log to syslogd

As some already said it is possible, but not recommended. I had someone here experiment with a script that tailed the alert.log and piped it to logger so that we could at least send it to another box without bugging the DBA. It worked but this was a workaround more than anything else stricly for a compliance requirement. The alert.log is multiline and doesn't fit well in a syslog format.

Olivier
Please use plain text.
Frequent Advisor
RiclyLeRoy
Posts: 45
Registered: ‎11-14-2009
Message 5 of 7 (404 Views)

Re: Oracle 8.1.7 log to syslogd

My purpose is to retrieve Oracle messages to forward them to my central log server, according to standard security measures which they say to trace both every db access and db operation.
ITO/OVO is a package ? It's necessary to buy it ?
Other solutions to send logs to syslogd ?

To Olivier:

I was going to create the script you referenced, which tails Oracle log file and piped it.
Can you show me please where this script has been reported in HP-UX forum so I can take it as example.
Please use plain text.
Honored Contributor
Olivier Masse
Posts: 623
Registered: ‎04-19-2003
Message 6 of 7 (404 Views)

Re: Oracle 8.1.7 log to syslogd

Unfortunately when I said "I had someone here" in my post it meant that I had someone at my workplace write a script for me. I can't post it publicly. But I can interpret it. :)

Basically it's just a background script with a "tail -f" that follows any predefined text file and it pipes the output to logger. Since we needed to be sure it was always there, and be alerted if it ever stopped working, the author had to add lots of extras, namely put the tail in a loop and ensure that it didn't spin endlessly in the case of a missing file, etc. But all that might not be necessary for you.

Olivier
Please use plain text.
Occasional Visitor
Biswanath
Posts: 3
Registered: ‎11-24-2009
Message 7 of 7 (404 Views)

Re: Oracle 8.1.7 log to syslogd

Hi,

Pls find the below script to configure the alert.


this is dbalert
-----------------------
TMP_FILE=${TMP_PATH}/${1}_${TNSNAME}.tmp.${TIMESTAMP}
SQL_FILE=${HOME_DIR}/${1}.sql

echo "====================================================" | tee -a ${TMP_FILE}
echo "${2}, ${ORACLE_SID}@${HOSTNAME}" | tee -a ${TMP_FILE}
echo "====================================================" | tee -a ${TMP_FILE}

if [ ! -f ${SQL_FILE} ]; then
echo "SQL file ${SQL_FILE} not found."
echo ""
else
BACKDUMP=`sqlplus -s ${ORACLE_USER}/${USER_PASSWORD}@${TNSNAME} < ${SQL_FILE} | egrep -i "[a-z]|[0-9]"`
ALERT_FILE=${BACKDUMP}/alert_${ORACLE_SID}.log
echo "Alert file ${ALERT_FILE}" | tee -a ${TMP_FILE}
if [ -f ${ALERT_FILE} ]; then
grep "ORA-" ${ALERT_FILE} | awk '{ print "==> "$0 }' | tee -a ${
TMP_FILE}
mv ${ALERT_FILE} ${ALERT_FILE}.${TIMESTAMP}
echo "Rename to ${ALERT_FILE}.${TIMESTAMP}" | tee -a ${TMP_FILE}
MONTHSTAMP=`date "+%Y%m"`
cat ${ALERT_FILE}.${TIMESTAMP} >> ${ALERT_FILE}.mon${MONTHSTAMP}
echo "Append to ${ALERT_FILE}.mon${MONTHSTAMP}" | tee -a ${TMP_FILE}
else
echo "Not found." | tee -a ${TMP_FILE}
fi
echo "" | tee -a ${TMP_FILE}
fi

date "+Finished: %Y.%m.%d-%H:%M:%S" | tee -a ${TMP_FILE}
echo "" | tee -a ${TMP_FILE}

NEW_LINE=`grep "==> " ${TMP_FILE} | wc -l`
if [ ${NEW_LINE} -gt 0 ]; then
echo "Mail or Page DataBase Administrator ..."
for MAIL_ADDRESS in `cat ${MAIL_FILE} | awk '{ print $1 }'`; do
echo "${2} '${ORACLE_SID}@${HOSTNAME}'" >> ${TMP_FILE}
echo "Mail to '${MAIL_ADDRESS}'"
mail "${MAIL_ADDRESS}" < ${TMP_FILE}
done
echo ""
fi
-------------------------------------------
this is dbalert.sql
set heading off

SELECT value
FROM V$PARAMETER
WHERE name = 'background_dump_dest';
-----------------------------------------
make modification as needed.


Links to check the compatibility issues:
http://www.docs.hp.com/en/T1907-90031/ch01s03.html

Regards,
Biswanath
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation