shell script not getting current error messages with time from alert.log


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script not getting current error messages with time from alert.log
# 1  
Old 10-22-2008
shell script not getting current error messages with time from alert.log

Hi All,

I need to get current error messages with time from alert.log.Below is my shell script but it's not working to meet this objective.

could anyone pls share on the above issue for resolution:

####################################################################
## ckalertlog.sh ##
####################################################################
#! /usr/bin/ksh

export DBALIST="xyz@rediffmail.com"
export ORACLE_HOME=some value
export SID=ORCL

cd $ORACLE_HOME/admin/bdump
if [ -f alert_${SID}.log ]
then
cp alert_${SID}.log alert_work.log
cat alert_work.log >> alert_${SID}.hist
grep ORA- alert_work.log | tail -100 > alert.err
fi
if [ `cat alert.err|wc -l` -gt 0 ]
then
echo "`date`" | mailx -s "${SID} ORACLE ALERT ERRORS as on `date`" $DBALIST < alert.err
fi
rm -f alert.err
rm -f alert_work.log
rm alert_ORCL.hist


Thanks for your time!!

Regards,
# 2  
Old 10-22-2008
What is the script doing that is wrong? Other than not remembering where it left off looking in the log file?
# 3  
Old 10-22-2008
shell script not getting current error messages with time from alert.log

Hi,

I need the output with the latest timestamp and ORA- messages as below:

Mon Oct 6 11:05:17 2008
Errors in file /apps/SID/oracle/10.2.0/admin/SID_Hostname/bdump/SID_arc0_1454262.trc:
ORA-16014: log 3 sequence# 1 not archived, no available destinations

Thanks,
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Current New Badge Alert Script (Beta 1)

Here is the JS I wrote and am now testing live for alerting a member when they have received a new badge (seems to be working OK so far, still testing live): var badgeChange = readCookie("badgestatechange"); $(function() { if (badgeChange == "1") { if (vbuserId > 0) { var... (0 Replies)
Discussion started by: Neo
0 Replies

2. Shell Programming and Scripting

Shell script to capture Current day ORA errors from Alert Log

Please provide Shell script to capture ORA errors from Alert Log for a given date or Current date. -Veera (1 Reply)
Discussion started by: Veera_V
1 Replies

3. Shell Programming and Scripting

Log search and mail it if the log is updated before 24 hours from the current time

Hi , We have around 22 logs , each has different entries. I have to automate this using shell script. The ideas which am sharing is given below 1) We use only TAIL -100 <location and name of the log> Command to check the logs. 2) We want to check whether the log was updated before 24... (13 Replies)
Discussion started by: Kalaihari
13 Replies

4. Homework & Coursework Questions

Sort current logged in users by log in time (supposedly to be very easy but I'm missing something)

1. The problem statement, all variables and given/known data: Show all users who are currently logged in, sorted from earliest to latest log in time. The log in time includes the month, day, and time. 2. Relevant commands, code, scripts, algorithms: finger, who, sort, pipe, head, tail, ... (8 Replies)
Discussion started by: vtmd
8 Replies

5. Shell Programming and Scripting

Shell script to capture ORA errors from Alert Log

Hi, as the title says, I am after a simple script, which will open the Alert log from an 11.2.0.1 Linux environment and mail the error message and description to a recipient email address. I can then schedule this job via cron and let it run every 15 minutes. I have searched online... (16 Replies)
Discussion started by: jnrpeardba
16 Replies

6. Shell Programming and Scripting

help with script Alert log not update every time.

:p Hello :) This is my script . This check log file size every 1 minute. Credit code https://www.unix.com/shell-programming-scripting/151723-help-writing-script-check-log-not-update.html #! /bin/bash logFiles="log1.log log2.log" logLocation="/usr/home/test/log/" sleepTime=60 ... (8 Replies)
Discussion started by: ooilinlove
8 Replies

7. Shell Programming and Scripting

Alert log not update every time.

My Script . This check log file size every 1 minute. #! /bin/bash logFiles="log1.log log2.log" logLocation="/usr/home/test/log/" sleepTime=60 failMessage=":: Log not running :: Pls Check Service" successMessage="OK" arr=($logFiles) arrlen=${#arr} arrcount=() date for... (0 Replies)
Discussion started by: ooilinlove
0 Replies

8. Shell Programming and Scripting

Shell script to find the run time based on log entries?

Shell script to find the run time based on log entries? Below is the log files content updated when the script test.sh runs. I would like to calculte the difference between first update time stamp and last update time stamp to find the run time of the script. The below log file shows the first... (1 Reply)
Discussion started by: mailtopranesh
1 Replies

9. Shell Programming and Scripting

Perl or Shell script to read a transaction log in real time

Hello, I have a Apache webserver running on RedHat. Its primary function is a proxy server for users accessing the internet. I have a transaction log that logs every transactions of every users. For users trying to access certain sites/content the transactions goes into a 302 redirect loop and... (2 Replies)
Discussion started by: bruno406
2 Replies

10. UNIX for Advanced & Expert Users

Shell script to append a time for the existing error log file

Hi Guys, the requirement is like this, i am having a error log file in this format, 4594.493: parallel nursery GC 2594592K->2544691K (2969600K), 30.848 ms 4605.958: parallel nursery GC 2634887K->2584986K (2969600K), 38.900 ms 4619.079: parallel nursery GC 2822555K->2774812K... (12 Replies)
Discussion started by: gsprasanna
12 Replies
Login or Register to Ask a Question