<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Oracle alert log script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976800#M921569</link>
    <description>TMP_FILE=${TMP_PATH}/${1}_${TNSNAME}.tmp.${TIMESTAMP}&lt;BR /&gt;SQL_FILE=${HOME_DIR}/${1}.sql&lt;BR /&gt;&lt;BR /&gt;echo "====================================================" | tee -a ${TMP_FILE}&lt;BR /&gt;echo "${2}, ${ORACLE_SID}@${HOSTNAME}" | tee -a ${TMP_FILE}&lt;BR /&gt;echo "====================================================" | tee -a ${TMP_FILE}&lt;BR /&gt;&lt;BR /&gt;if [ ! -f ${SQL_FILE} ]; then&lt;BR /&gt;        echo "SQL file ${SQL_FILE} not found."&lt;BR /&gt;        echo ""&lt;BR /&gt;else&lt;BR /&gt;        BACKDUMP=`sqlplus -s ${ORACLE_USER}/${USER_PASSWORD}@${TNSNAME}                                 &amp;lt; ${SQL_FILE} | egrep -i "[a-z]|[0-9]"`&lt;BR /&gt;        ALERT_FILE=${BACKDUMP}/alert_${ORACLE_SID}.log&lt;BR /&gt;        echo "Alert file ${ALERT_FILE}" | tee -a ${TMP_FILE}&lt;BR /&gt;        if [ -f ${ALERT_FILE} ]; then&lt;BR /&gt;                grep "ORA-" ${ALERT_FILE} | awk '{ print "==&amp;gt; "$0 }' | tee -a ${&lt;BR /&gt;TMP_FILE}&lt;BR /&gt;                mv ${ALERT_FILE} ${ALERT_FILE}.${TIMESTAMP}&lt;BR /&gt;                echo "Rename to ${ALERT_FILE}.${TIMESTAMP}" | tee -a ${TMP_FILE}&lt;BR /&gt;                MONTHSTAMP=`date "+%Y%m"`&lt;BR /&gt;                cat ${ALERT_FILE}.${TIMESTAMP} &amp;gt;&amp;gt; ${ALERT_FILE}.mon${MONTHSTAMP}&lt;BR /&gt;                echo "Append to ${ALERT_FILE}.mon${MONTHSTAMP}"                                                         | tee -a ${TMP_FILE}&lt;BR /&gt;        else&lt;BR /&gt;                echo "Not found." | tee -a ${TMP_FILE}&lt;BR /&gt;        fi&lt;BR /&gt;        echo "" | tee -a ${TMP_FILE}&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;date "+Finished: %Y.%m.%d-%H:%M:%S" | tee -a ${TMP_FILE}&lt;BR /&gt;echo "" | tee -a ${TMP_FILE}&lt;BR /&gt;&lt;BR /&gt;NEW_LINE=`grep "==&amp;gt; " ${TMP_FILE} | wc -l`&lt;BR /&gt;if [ ${NEW_LINE} -gt 0 ]; then&lt;BR /&gt;        echo "Mail or Page DataBase Administrator ..."&lt;BR /&gt;        for MAIL_ADDRESS in `cat ${MAIL_FILE} | awk '{ print $1 }'`; do&lt;BR /&gt;                echo "${2} '${ORACLE_SID}@${HOSTNAME}'" &amp;gt;&amp;gt; ${TMP_FILE}&lt;BR /&gt;                echo "Mail to '${MAIL_ADDRESS}'"&lt;BR /&gt;                mailx -s "dbalert"  "${MAIL_ADDRESS}" &amp;lt; ${TMP_FILE}&lt;BR /&gt;        done&lt;BR /&gt;        echo ""&lt;BR /&gt;fi&lt;BR /&gt;-----------&lt;BR /&gt;this is .sql file&lt;BR /&gt;set heading off&lt;BR /&gt;&lt;BR /&gt;SELECT value&lt;BR /&gt;FROM   V$PARAMETER&lt;BR /&gt;WHERE  name = 'background_dump_dest';</description>
    <pubDate>Tue, 20 May 2003 00:29:20 GMT</pubDate>
    <dc:creator>Printaporn_1</dc:creator>
    <dc:date>2003-05-20T00:29:20Z</dc:date>
    <item>
      <title>Oracle alert log script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976798#M921567</link>
      <description>does anyone have a script that can scan through an alert log for  ORA-errors in HP-UX 11 on HP 9000&lt;BR /&gt;thx</description>
      <pubDate>Mon, 19 May 2003 20:53:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976798#M921567</guid>
      <dc:creator>Nago</dc:creator>
      <dc:date>2003-05-19T20:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle alert log script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976799#M921568</link>
      <description>here's a function you can adapt, you'll need to set the parameters as per your site, but the logic works just fine...&lt;BR /&gt;&lt;BR /&gt;chk_alert()&lt;BR /&gt;{&lt;BR /&gt;    # Description: This function looks into alert file of oracle &amp;amp; reports&lt;BR /&gt;    #              all matches to ORA- pattern thru e-mail.&lt;BR /&gt;    #              It also pages DBA.&lt;BR /&gt;&lt;BR /&gt;    #Input: $LINE_FILE that stores line_no from where to start search&lt;BR /&gt;    #Output: A mail containing all ORA- messages. Resets the $PARFILE with the&lt;BR /&gt;    #        current no. of lines.&lt;BR /&gt;&lt;BR /&gt;if [ -f $LINE_FILE ] ; then&lt;BR /&gt;  from_line=`cat $LINE_FILE`&lt;BR /&gt;  if [ "$from_line" = "" ] ; then&lt;BR /&gt;        from_line=1&lt;BR /&gt;  fi&lt;BR /&gt;else&lt;BR /&gt;  from_line=1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [ ! -f $ORA_EXCEPTIONS_FILE ] ; then&lt;BR /&gt;  touch $ORA_EXCEPTIONS_FILE&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;rm -f $LOG_LOC/diffs_${ORACLE_SID}&lt;BR /&gt;cur_lines=`wc -l $ALERT_FILE|cut -f1 -d' '`&lt;BR /&gt;# If the $cur_lines is less than the last line the script looked at last,&lt;BR /&gt;# it probably means that the alert.log file has been cycled. So assume&lt;BR /&gt;# that the file has not been read from and set $from_line = 1&lt;BR /&gt;if [ $cur_lines -lt $from_line ] ; then&lt;BR /&gt;  from_line=1&lt;BR /&gt;fi&lt;BR /&gt;if [ $from_line -ne $cur_lines ] ; then&lt;BR /&gt;  rm -f $LOG_LOC/chk_alert_${ORACLE_SID}.log&lt;BR /&gt;  tail -n +$from_line $ALERT_FILE| grep "ORA-" &amp;gt; $LOG_LOC/chk_alert_${ORACLE_SID}.log&lt;BR /&gt;  if [ -s $LOG_LOC/chk_alert_${ORACLE_SID}.log ] ; then&lt;BR /&gt;      rm -f $LOG_LOC/alert_chk_${ORACLE_SID}.non600.log $LOG_LOC/alert_chk_${ORACLE_SID&lt;BR /&gt;}.600.log $LOG_LOC/alert_except_${ORACLE_SID}.600.log $LOG_LOC/alert_except_${ORACLE_SI&lt;BR /&gt;D}.non600.log&lt;BR /&gt;      cat $LOG_LOC/chk_alert_${ORACLE_SID}.log| grep "ORA-" | grep -v "ORA-00600" | awk&lt;BR /&gt; -F"[: ]" '{print $1}' | sort | uniq &amp;gt; $LOG_LOC/alert_chk_${ORACLE_SID}.non600.log&lt;BR /&gt;        cat $LOG_LOC/chk_alert_${ORACLE_SID}.log| grep "ORA-00600" | awk -F": " '{print&lt;BR /&gt; $1, $3}' | awk -F"," '{print $1}' | sort | uniq &amp;gt; $LOG_LOC/alert_chk_${ORACLE_SID}.600&lt;BR /&gt;.log&lt;BR /&gt;&lt;BR /&gt;      cat ${ORA_EXCEPTIONS_FILE} | grep ORA-00600 | awk '{print $1, $2}' | sort | uniq&lt;BR /&gt;&amp;gt; $LOG_LOC/alert_except_${ORACLE_SID}.600.log&lt;BR /&gt;        cat ${ORA_EXCEPTIONS_FILE} | grep -v ORA-00600 | sort | uniq &amp;gt; $LOG_LOC/alert_e&lt;BR /&gt;xcept_${ORACLE_SID}.non600.log&lt;BR /&gt;&lt;BR /&gt;        comm -23 $LOG_LOC/alert_chk_${ORACLE_SID}.non600.log $LOG_LOC/alert_except_${OR&lt;BR /&gt;ACLE_SID}.non600.log &amp;gt; $LOG_LOC/diffs_${ORACLE_SID}&lt;BR /&gt;        comm -23 $LOG_LOC/alert_chk_${ORACLE_SID}.600.log $LOG_LOC/alert_except_${ORACL&lt;BR /&gt;E_SID}.600.log &amp;gt;&amp;gt; $LOG_LOC/diffs_${ORACLE_SID}&lt;BR /&gt;&lt;BR /&gt;        cat ${LOG_LOC}/chk_alert_${ORACLE_SID}.log | mailx -s "Error Messages in ${ALER&lt;BR /&gt;T_FILE} on ${Server}" $MAILLST&lt;BR /&gt;        no_of_diffs=`cat ${LOG_LOC}/diffs_${ORACLE_SID} | wc -l`&lt;BR /&gt;        if [ $no_of_diffs -ne 0 ] ; then&lt;BR /&gt;        if [ "${PAGEDBA_ALERT}" = "YES" ] ; then&lt;BR /&gt;        cat $LOG_LOC/chk_alert_${ORACLE_SID}.log | sort | uniq | while read Msgtext&lt;BR /&gt;            do&lt;BR /&gt;            echo "pager command here."&lt;BR /&gt;            done&lt;BR /&gt;        fi&lt;BR /&gt;        fi&lt;BR /&gt;    fi&lt;BR /&gt;    echo $cur_lines &amp;gt;$LINE_FILE&lt;BR /&gt;fi&lt;BR /&gt;}</description>
      <pubDate>Mon, 19 May 2003 21:03:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976799#M921568</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2003-05-19T21:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle alert log script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976800#M921569</link>
      <description>TMP_FILE=${TMP_PATH}/${1}_${TNSNAME}.tmp.${TIMESTAMP}&lt;BR /&gt;SQL_FILE=${HOME_DIR}/${1}.sql&lt;BR /&gt;&lt;BR /&gt;echo "====================================================" | tee -a ${TMP_FILE}&lt;BR /&gt;echo "${2}, ${ORACLE_SID}@${HOSTNAME}" | tee -a ${TMP_FILE}&lt;BR /&gt;echo "====================================================" | tee -a ${TMP_FILE}&lt;BR /&gt;&lt;BR /&gt;if [ ! -f ${SQL_FILE} ]; then&lt;BR /&gt;        echo "SQL file ${SQL_FILE} not found."&lt;BR /&gt;        echo ""&lt;BR /&gt;else&lt;BR /&gt;        BACKDUMP=`sqlplus -s ${ORACLE_USER}/${USER_PASSWORD}@${TNSNAME}                                 &amp;lt; ${SQL_FILE} | egrep -i "[a-z]|[0-9]"`&lt;BR /&gt;        ALERT_FILE=${BACKDUMP}/alert_${ORACLE_SID}.log&lt;BR /&gt;        echo "Alert file ${ALERT_FILE}" | tee -a ${TMP_FILE}&lt;BR /&gt;        if [ -f ${ALERT_FILE} ]; then&lt;BR /&gt;                grep "ORA-" ${ALERT_FILE} | awk '{ print "==&amp;gt; "$0 }' | tee -a ${&lt;BR /&gt;TMP_FILE}&lt;BR /&gt;                mv ${ALERT_FILE} ${ALERT_FILE}.${TIMESTAMP}&lt;BR /&gt;                echo "Rename to ${ALERT_FILE}.${TIMESTAMP}" | tee -a ${TMP_FILE}&lt;BR /&gt;                MONTHSTAMP=`date "+%Y%m"`&lt;BR /&gt;                cat ${ALERT_FILE}.${TIMESTAMP} &amp;gt;&amp;gt; ${ALERT_FILE}.mon${MONTHSTAMP}&lt;BR /&gt;                echo "Append to ${ALERT_FILE}.mon${MONTHSTAMP}"                                                         | tee -a ${TMP_FILE}&lt;BR /&gt;        else&lt;BR /&gt;                echo "Not found." | tee -a ${TMP_FILE}&lt;BR /&gt;        fi&lt;BR /&gt;        echo "" | tee -a ${TMP_FILE}&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;date "+Finished: %Y.%m.%d-%H:%M:%S" | tee -a ${TMP_FILE}&lt;BR /&gt;echo "" | tee -a ${TMP_FILE}&lt;BR /&gt;&lt;BR /&gt;NEW_LINE=`grep "==&amp;gt; " ${TMP_FILE} | wc -l`&lt;BR /&gt;if [ ${NEW_LINE} -gt 0 ]; then&lt;BR /&gt;        echo "Mail or Page DataBase Administrator ..."&lt;BR /&gt;        for MAIL_ADDRESS in `cat ${MAIL_FILE} | awk '{ print $1 }'`; do&lt;BR /&gt;                echo "${2} '${ORACLE_SID}@${HOSTNAME}'" &amp;gt;&amp;gt; ${TMP_FILE}&lt;BR /&gt;                echo "Mail to '${MAIL_ADDRESS}'"&lt;BR /&gt;                mailx -s "dbalert"  "${MAIL_ADDRESS}" &amp;lt; ${TMP_FILE}&lt;BR /&gt;        done&lt;BR /&gt;        echo ""&lt;BR /&gt;fi&lt;BR /&gt;-----------&lt;BR /&gt;this is .sql file&lt;BR /&gt;set heading off&lt;BR /&gt;&lt;BR /&gt;SELECT value&lt;BR /&gt;FROM   V$PARAMETER&lt;BR /&gt;WHERE  name = 'background_dump_dest';</description>
      <pubDate>Tue, 20 May 2003 00:29:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976800#M921569</guid>
      <dc:creator>Printaporn_1</dc:creator>
      <dc:date>2003-05-20T00:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle alert log script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976801#M921570</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;please see my post at this address:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x4177ef70e827d711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x4177ef70e827d711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Filename: alerts.ksh &lt;BR /&gt;Description: Automatic monitoring of the production database's ALERT LOG file for exceptions. &lt;BR /&gt;&lt;BR /&gt;Running it as the Oracle User, reschedules daily execution of script - morning, evening and night everyday (uses at) &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Tue, 20 May 2003 06:59:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-alert-log-script/m-p/2976801#M921570</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-05-20T06:59:25Z</dc:date>
    </item>
  </channel>
</rss>

