Scripts for finding errors Oracle/Unix

There are some ways which we can automate the things, either scripting or any realted tools. Here I have used some scripts for finding errors Oracle/Unix:


  • Below is the csh scripts to find out ORA- errors and get that errors triggered to your mail id:
setenv MAILLIST=""
setenv TRIGGER_MAIL /tmp/ora_errors.log
setenv LOG /tmp/ora_errors.log

#set alert file locaion as below, your environment may have different location
setenv ALERT_LOG /u01/oracle/diag/rdbms/db_name/trace/alert_dbname.log

#Connect to database for finding the path of alert log(this step jsu for knowing path of alert log):
${EXEDIR}/sqlplus -s /nolog < ${LOG}
connect / as sysdba
select value from v\$diag_info where name='Diag Trace';

grep -i ORA- $ALERT_LOG >>/tmp/ora_errors.log
cat $TRIGGER_MAIL | mailx -s "Errors detected in Alert Log for $ORACLE_SID" $MAILLIST


  • Below csh script is to check Errors in SYSLOG file at OS level and get that errors trigger to mail id.
#Date in Format Current Day-Month-Year@Timing.
setenv CURDATE `date "+%d-%m-%Y@%H:%M:%S"`
setenv LOG /home/testadm/test.log
setenv TRIGGER_MAIL /home/testadm/test1.log
setenv MAILLIST ""

#You can add any word you wanted to find in below egrep command, also below i have used to to tail last 100 lines 
#you can add any number as per your wish
tail -100 test.log | egrep -n "error|fail" > $TRIGGER_MAIL

#Check whether file is empty
if ( -z $TRIGGER_MAIL) then
 echo "Currently there is no errors upto $CURDATE in SYSLOG File" | mailx -s "NO Errors in SYSLOG File" $MAILLIST
 exit (1)
  cat $TRIGGER_MAIL | mailx -s "Errors detected nearly at $CURDATE in SYSLOG File" $MAILLIST
Please share If you like..Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on Yummly


Add a Comment
  1. Hello, everything is going perfectly here and ofcourse every one is sharing information, that’s really fine, keep
    up writing.

  2. Appreciation to my father who told me on the topic of this blog, this website is
    really amazing.

  3. wonderful submit, very informative. I wonder why the opposite specialists of
    this sector don’t understand this. You should proceed your writing.
    I am confident, you’ve a huge readers’ base already!

  4. Hello there! This blog post could not be written much better!

    Reading through this article reminds me of my previous roommate!
    He always kept preaching about this. I will send this post to him.
    Fairly certain he’s going to have a very good read.
    I appreciate you for sharing!

  5. I loved the way you discuss the topic great work thanks for the share Your informative post.

  6. Yours is a clever way of thikinng about it.

  7. That’s 2 clever by half and 2×2 clever 4 me. Thksna!

  8. Thanks for sharing such a good opinion, article is nice, thats why i have read
    it entirely

  9. Really very happy to say,your post is very interesting to read.I never stop myself to say something about it.You’re doing a great job.Keep it up

  10. Your style is so unique in comparison to other folks I have read
    stuff from. Many thanks for posting when you have the opportunity, Guess I will
    just bookmark this site.

  11. I know this if off topic but I’m looking into starting
    my own weblog and was curious what all is required to get set up?
    I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web smart so I’m not 100% positive. Any recommendations or advice would be greatly appreciated.
    Thank you

    1. Take good theme and always update the content which mostly users not find on other blog …also yes your are right during startup you have to spend pretty penny

  12. Very soon this web site will be famous among all blog visitors,
    due to it’s fastidious posts

  13. “Greetings! Very helpful advice within this post! It is the little changes which will make the greatest changes. Thanks for sharing!”

  14. Im grateful for the article post. Cool.

  15. Well I definitely enjoyed reading it. This article procured by you is very practical for correct planning.

  16. “You made some good points there. I did a search on the subject and found most persons will go along with with your website.”

  17. “I loved up to you will receive performed right here. The article is delightful tasting, your very own authored subject is terrific.”

  18. Muchos Gracias for your blog.Really looking forward to read more. Much obliged.

  19. Im obliged for the article post.Much thanks again. Awesome.

  20. I truly appreciate this blog article.Really thank you! Cool.

  21. Muchos Gracias for your blog article.Really thank you! Keep writing.

  22. I appreciate you sharing this article.Thanks Again. Want more.

  23. I really liked your post.Really thank you! Keep writing.

  24. I have to express my appreciation to this writer just for rescuing me from this type of instance. Right after looking out through the the web and coming across tips that were not beneficial, I was thinking my life was well over. Living minus the answers to the issues you’ve fixed all through the posting is a crucial case, as well as the kind that could have in a negative way damaged my entire career if I had not come across your blog post. Your good understanding and kindness in touching every aspect was priceless. I am not sure what I would’ve done if I had not come upon such a subject like this. I can at this point look forward to my future. Thanks a lot so much for your reliable and sensible help. I won’t hesitate to refer the blog to anybody who will need support on this problem.

  25. I want to point out my appreciation for your kindness in support of men and women that require help on this niche. Your very own dedication to getting the message all around became exceptionally valuable and have always enabled professionals much like me to arrive at their desired goals. The invaluable tutorial entails this much to me and still more to my peers. With thanks; from all of us.

  26. Hi there, just became aware of your blog through Google, and found that it’s really informative.
    I am going to watch out for brussels. I’ll be grateful if
    you continue this in future. Many people will be benefited from your writing.

  27. This blog was… how do I say it? Relevant!!
    Finally I’ve found something that helped me. Thank you!

  28. I really enjoy the article post.Really thank you! Keep writing.

  29. An fascinating discussion is worth comment. I think that it’s best to write more on this subject, it won’t be a taboo subject however generally persons are not sufficient to talk on such topics. To the next. Cheers

  30. You should participate in a contest for the most effective blogs on the web. I’ll advocate this website!

  31. There are some fascinating points in time on this article however I don抰 know if I see all of them center to heart. There’s some validity but I will take hold opinion till I look into it further. Good article , thanks and we would like more! Added to FeedBurner as nicely

  32. After study a couple of of the weblog posts on your web site now, and I really like your approach of blogging. I bookmarked it to my bookmark web site checklist and will be checking back soon. Pls check out my web site as properly and let me know what you think.

  33. It抯 arduous to seek out knowledgeable people on this subject, however you sound like you know what you抮e speaking about! Thanks

  34. There are some interesting time limits on this article but I don抰 know if I see all of them center to heart. There’s some validity however I’ll take maintain opinion until I look into it further. Good article , thanks and we would like more! Added to FeedBurner as well

  35. My spouse and i were very glad that Albert could round up his research out of the precious recommendations he gained using your web page. It is now and again perplexing just to choose to be handing out information which the rest might have been selling. Therefore we recognize we have got the writer to appreciate for this. The main illustrations you made, the easy website menu, the relationships you can give support to instill – it’s all incredible, and it is helping our son and our family recognize that the subject matter is entertaining, which is incredibly vital. Many thanks for the whole thing!

  36. A powerful share, I just given this onto a colleague who was doing somewhat evaluation on this. And he the truth is bought me breakfast as a result of I found it for him.. smile. So let me reword that: Thnx for the deal with! However yeah Thnkx for spending the time to debate this, I feel strongly about it and love studying extra on this topic. If attainable, as you turn out to be expertise, would you thoughts updating your blog with more particulars? It’s extremely helpful for me. Large thumb up for this blog submit!

  37. It is best to participate in a contest for among the finest blogs on the web. I’ll suggest this site!

Leave a Reply

Your email address will not be published. Required fields are marked *

Fariddin Shaikh's Oracle DBA Blog © 2016 Being DBA
Go Back