- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- monitoring script for oracle instance
Operating System - HP-UX
1748275
Members
3942
Online
108761
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 07:29 PM
тАО12-08-2003 07:29 PM
#!/usr/bin/ksh
OPER="user mail box"
LSNR=`su - oracle -c "lsnrctl status " |grep successfully|awk '{print $4}'`
if [[ "$LSNR" != "successfully" ]];then
echo "Listener is not ok at `date`" |mailx -v -s "Listener Status" $OPER
else
#TO define oracle sid
ORATAB=/var/opt/oracle/oratab
cat $ORATAB | while read LINE
do
case $LINE in
\#*) ;; #comment-line in oratab
*)
# Proceed only if third field is 'Y'.
if [[ "`echo $LINE | awk -F: '{print $3}' -`" == "Y" ]] ; then
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
if [[ "$ORACLE_SID" == '*' ]] ; then
ORACLE_SID=""
fi
ORACLE_HOME=`echo $LINE |awk -F: '{print $2}' -`
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin
export PATH
Stat=`echo "exit"|su oracle -c "sqlplus user/passwd@$ORACLE_SID"|grep Disconnected|awk '{print $2}'`
if [[ "$Stat" != "Disconnected" ]];then
echo "Database $ORACLE_SID not on" |mailx -v -s "Database Status" $OPER
fi
fi
;;
esac
done
fi
OPER="user mail box"
LSNR=`su - oracle -c "lsnrctl status " |grep successfully|awk '{print $4}'`
if [[ "$LSNR" != "successfully" ]];then
echo "Listener is not ok at `date`" |mailx -v -s "Listener Status" $OPER
else
#TO define oracle sid
ORATAB=/var/opt/oracle/oratab
cat $ORATAB | while read LINE
do
case $LINE in
\#*) ;; #comment-line in oratab
*)
# Proceed only if third field is 'Y'.
if [[ "`echo $LINE | awk -F: '{print $3}' -`" == "Y" ]] ; then
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
if [[ "$ORACLE_SID" == '*' ]] ; then
ORACLE_SID=""
fi
ORACLE_HOME=`echo $LINE |awk -F: '{print $2}' -`
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin
export PATH
Stat=`echo "exit"|su oracle -c "sqlplus user/passwd@$ORACLE_SID"|grep Disconnected|awk '{print $2}'`
if [[ "$Stat" != "Disconnected" ]];then
echo "Database $ORACLE_SID not on" |mailx -v -s "Database Status" $OPER
fi
fi
;;
esac
done
fi
steven
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 07:30 PM
тАО12-08-2003 07:30 PM
Re: monitoring script for oracle instance
attach file
steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 09:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-08-2003 09:08 PM
тАО12-08-2003 09:08 PM
Re: monitoring script for oracle instance
Hi,
A forum is a place to exchange ideas. I can imagine that Steven is only giving us 2 scripts that he finds useful. Thanks to him. Some times ago there were posts collecting this kind of sysadmin scripts.
Regards.
A forum is a place to exchange ideas. I can imagine that Steven is only giving us 2 scripts that he finds useful. Thanks to him. Some times ago there were posts collecting this kind of sysadmin scripts.
Regards.
It works for me (┬й Bill McNAMARA ...)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP