Oracle log monitoring from a shell script
I found this rather old article when looking up some shell scripting syntax. Occasionally there is gold to be found: search_log.sh. A variety of logs are generated by Oracle products, and you might be interested in monitoring them. The database alert log contains messages that are critical to database operations. Log files are also generated when products are installed or deinstalled and when patches are applied. The following script iterates over a file passed to it as an argument. If any lines are found that contain ORA-, an e-mail message is sent to a designated recipient. cat $1 | grep ORA- > alert.err if [ ‘cat alert.err|wc -l‘ -gt 0 ] then mail -s "$0 $1 Errors" administrator@yourcompany.com < alert.err fi The specific test being performed is a count of the number of words that exist in the file alert.err, which is written when you redirect to alert.err. If the word count ( wc ) is greater than ( -gt ) zero, the contents of the if bl...