Occasional Visitor
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