Results 1 to 8 of 8
Hi all,
I am newbie to shell scripting. I would like to enhance my skills.I would like to construct a shell script to determine the size of my oracle log ...
- 08-03-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 6
Shell script
Hi all,
I am newbie to shell scripting. I would like to enhance my skills.I would like to construct a shell script to determine the size of my oracle log files and get an alert via email to tell me that it has exceeded the threshold.
- 08-03-2009 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Have you ever written a shell script?
If not I'd recommend having a read through The Advanced Bash Scripting Guide. How are your skills generally on the command line?
- 08-03-2009 #3Just Joined!
- Join Date
- Jan 2009
- Posts
- 6
Shell script
Yes I do. I have average knowledge about unix command line. I have written shell scripts that have helped automate some commands that i need execute all the time.
This has been scheduled with a cron job. Now i want to take on something quite challenging.
Thanx.
- 08-03-2009 #4Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Alright, sounds good! Let's see what you've got so far and we can take it from there.
- 08-04-2009 #5Just Joined!
- Join Date
- Jan 2009
- Posts
- 6
#!/bin/bash
#. /home/oracle/.bash_profile
ORACLE_HOME=/x02/app1/oracle1/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=xxx2
error=Archive
egrep "ORA-|Archive*" /x02/app1/oracle1/admin/xxx2/bdump/alert_xxx2.log>/dev/null 2>&1
if [ $error="Archive*" ]
then mailx -n -s "Check alert log rrs2 for oracle errors..." \
xxx@abcde.com < /x02/app1/oracle1/admin/xxx2/bdump/alert_xxx2.log
fi
This is the sample script. The idea is to check for errors concerning the size of the of the oracle archive logs and email it to the address but it is not doing the needful.
Any help would be appreciated.
Thanx
- 08-05-2009 #6Just Joined!
- Join Date
- Jan 2009
- Posts
- 6
hi all,
still need help, bigtomrodney can i get a response
- 08-05-2009 #7Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Can you post the errors your're getting?
How are you getting on running each command one at a time?
- 08-06-2009 #8Just Joined!
- Join Date
- Jan 2009
- Posts
- 6
its not sending any mails nd its not givin me the archive log errors that i need.it just executes nd goes 2 d nxt shell. Thats all.
Thanks


Reply With Quote