[ale] cpu consumption

Zyman, Andy zymana at hra.nyc.gov
Mon Jul 1 08:56:07 EDT 2002


Good morning everyone,
some time ago i wrote this ( see below ) simple script. It suppose to sit in
the memory and do tail -f on oracle log files. Upon certain conditions it
sends email with last 10 lines from that log file, so DBA can take a quick
look on it...

>From time to time, I can see that this script ( it is working on 15 or so

SUnE10K and 3500 on Solaris ) is consuming more cpu than it should. Lets say
now it is on  only one of the machines:
$ /usr/ucb/ps -aux | grep log
oraowner 28459 25.0  0.1 1656  424 ?        O   Jun 13 6481:06 /bin/ksh
./log_mon
oraowner 29650  0.0  0.1  888  784 pts/0    S 08:54:45  0:00 grep log

I'm including here just a part of script, because the remaining is just a
synopsis and snd_mail function. On the top there is #!/bin/ksh


Now, my question is : 
why?




-----------------------------start --------------------------
# Main() 

echo " \n Starting to monitor the following logs: "

for i in `ls $ORACLE_BASE/admin | grep -iv TAR` ; do

  echo "\n $ORACLE_BASE/admin/${i}/bdump/alert_${i}.log ... "

(
 tail -f $ORACLE_BASE/admin/${i}/bdump/alert_${i}.log | while read LINE ; do

     if [ "`echo $LINE | /usr/bin/egrep -iv '^alter rollback segment' |
/usr/bin/egrep -e '^Shutting|^alter|^ORA-|^Checkpoint not complete' `" ] ;
then 

          snd_mail ;
     fi
 done; 
) &

done ;

echo "Done"
------------------------------end ---------------------------

Thank You
 Andy
office: 212 849 3543

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list