Home » Infrastructure » Unix » shell script to check the lsitener (oracle 10g unix)  () 1 Vote
shell script to check the lsitener [message #301096] Tue, 19 February 2008 03:30 Go to next message
daniesh.shaikh@gmail.com
Messages: 62
Registered: February 2008
Location: india
Member
Hi gurus,
I am writing a script for one of the clients.
i got stuck could anybody help me out.

dbalist="daniesh.shaikh@gmail.com";export dbalist
ps -ef|grep pmon >database.txt
if (grep "PROD" database.txt)
then
touch "no file"
else
echo "database is down"| mailx -s $dbalist
fi
i am getting an error. i am not getting my mail to my id.
i am redirecting the o/p of ps -ef|grep to database.txt
then alse the o/p of that command get displayed on my screen
i want only database is down to my id .
could anyone explain me the better way to write the script.

Thanks,
Daniesh
Re: shell script to check the lsitener [message #301103 is a reply to message #301096] Tue, 19 February 2008 03:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ How is this a Performance question
2/ "i am getting an error" but there is none in your post
3/ "i am not getting my mail to my id" How is this an Oracle problem?

"could anyone explain me the better way to write the script."
I think you should post this in a Unix forum as this has nothing to do with Oracle.

Regards
Michel

Re: shell script to check the lsitener [message #301109 is a reply to message #301096] Tue, 19 February 2008 03:50 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
To add,
the topic says
>>shell script to check the lsitener
But you are looking at pmon.
Looking into smon/pmon to check the availability of database is flawed. The Instance can be up and still database could be down.
Previous Topic: Invoking Oracle stored procedure in unix shell script
Next Topic: Error while attempting to create database on Solaris 10
Goto Forum:
  


Current Time: Thu Mar 28 10:30:32 CDT 2024