0% found this document useful (0 votes)
252 views

Script To Monitor Database Instance and Listener

This script monitors the availability of an Oracle database instance and listener on a server. It checks if the database's SMON and listener processes are running. If either is down, it generates a report file and emails it. It also checks the status of Concurrent Managers and an Apache server, emailing alerts if they are down.

Uploaded by

infyrajayaar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
252 views

Script To Monitor Database Instance and Listener

This script monitors the availability of an Oracle database instance and listener on a server. It checks if the database's SMON and listener processes are running. If either is down, it generates a report file and emails it. It also checks the status of Concurrent Managers and an Apache server, emailing alerts if they are down.

Uploaded by

infyrajayaar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

#Script to monitor Database instance and Listener

############################################### #Set The Databse Environment ############################################### . $HOME/.bash_profile #ReportFile=/tmp/Services_Summary_Report.log rm -rf /tmp/Services_Summary_Report.log ################################################### #Check For The Avilability of Database ################################################## ps -ef|grep smon|grep ${ORACLE_SID}| grep -v grep >/tmp/Services_Report.log if [ `ps -ef | grep smon | grep ${ORACLE_SID} | grep -v grep | wc -l` -lt 1 ]; then echo "Oracle Database : ${ORACLE_SID} Host : `hostname` Status : Down" >$ReportFile else echo "Oracle Database : ${ORACLE_SID} Host : `hostname` Status : Database is Up" >>/dev/null fi ################################################## #Check For The Avilability Of Listener ################################################## ps -ef|grep tnslsnr|grep ${ORACLE_SID}| grep -v grep >/tmp/Services_Report.log if [ `ps -ef | grep tnslsnr | grep ${ORACLE_SID} | grep -v grep | wc -l` -lt 1 ]; then echo "Oracle Listener : ${ORACLE_SID} Host : `hostname` Status : Down" >>$ReportFile mailx -s $ORACLE_SID" Database and Listener Status Report"`date '+%m%d'` [email protected] <$ReportFile else echo "Oracle Listener : ${ORACLE_SID} Host : `hostname` Status : Listener is UP" >>/dev/null if [ -f $ReportFile ]; then mailx -s $ORACLE_SID" Database and Listener Status Report"`date '+%m%d'` [email protected]<$ReportFile else echo "File $ReportFile does not exists">>/dev/null fi fi Locks

select l1.sid, ' IS BLOCKING ', l2.sid from v$lock l1, v$lock l2 where l1.block =1 and l2.request > 0 and l1.id1=l2.id1 and l1.id2=l2.id2; 2 3 4 5 SID 'ISBLOCKING' SID ---------- ------------- ---------3251 IS BLOCKING 3001 select sid, b.serial#, osuser, b.username, status, process, paddr, spid, b.last_call_et/60 from v$process a,v$session b where sid = '&sid' and a.addr = b.paddr

and b.username != ' ' order by 1 / select sid, program, module, action, last_call_et, status from v$session where sid = &sid; alter system kill session ' Concurrent Manager #!/bin/sh ### check concurrent managers up/down ### 10,20,30,40,50,00 * * * * . /home/applprod/scripts/check_ccm.sh >> /home/applprod/scripts/logs/check_ccm.log 2>&1 . /home/applprod/.bash_profile $FND_TOP/bin/FNDSVCRG STATUS> /home/applprod/scripts/logs/ccmstatus.log if [ `cat /home/applprod/scripts/logs/ccmstatus.log |grep -i not |wc -l` -gt 0 ];then ##mail -s "Concurrent Manager is down for ${TWO_TASK}" "[email protected]" echo "ICM is not up on `hostname -s`" | mailx -s "Alert : Concurrent Manager is down for FIJI PRODUCTION Server `hostname -s`" "[email protected]" fi
SELECT component_name, component_status FROM fnd_svc_components WHERE component_type = 'WF_MAILER'; ====================================================================================================================== #!/bin/sh ### check apache server up/down ### 10,20,30,40,50,00 * * * * . /home/applprod/scripts/check_apache.sh >> /home/applprod/scripts/logs/check_apache.log 2>&1 . /home/applprod/.bash_profile $INST_TOP/admin/scripts/adapcctl.sh status if [ $? = 0 ];then echo " Apache is up" #echo " Apache is up on `hostname -s`"| mailx -s "Apache is up for FIJI PRODUCTION Server `hostname -s`" "[email protected]" else # echo "Apache is not up, Sending email" echo "Apache is down on `hostname -s`"| mailx -s "Alert : Apache is down for FIJI PRODUCTION Server `hostname -s`" "[email protected]" # echo "Apache is not up, Sending email" | mailx -s "Apache is down for ${TWO_TASK}" "[email protected]" Fi

find ICM log on Oracle Apps 11i and R12?


SELECT 'ICM_LOG_NAME=' || fcp.logfile_name FROM fnd_concurrent_processes fcp, fnd_concurrent_queues fcq WHERE fcp.concurrent_queue_id = fcq.concurrent_queue_id AND fcp.queue_application_id = fcq.application_id AND fcq.manager_type = '0' AND fcp.process_status_code = 'A';

You might also like