Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> nt script
Hi Dear list;
I don't have experience on NT scripting. but I have an urgent need for nt script. Someone's help would be appreciated. Here is the question; How to convert this script to nt script? I need to reboot the nt server if there is any error on this sql statement instead of paging someone on UNIX. Thanks a lot,
Joan
. $HOME/.profile
echo Sending mail!!!
dt=$(date '+%H%M_%m%d%y')
export ORACLE_SID=FMRPT
sqlplus / <<EOF! > sqllog
set heading off
SELECT 'FMRPT PSNTRP02 SCHEDULER DOWN' FROM DUAL
WHERE EXISTS (SELECT 'X' FROM PSSERVERSTAT
WHERE SERVERNAME = 'PSNTRP02' AND SERVERSTATUS <> 3) OR NOT EXISTS (SELECT 'X' FROM PSSERVERSTAT WHERE SERVERNAME = 'PSNTRP02')UNION
WHERE SERVERNAME = 'PSNTRP03' AND SERVERSTATUS <> 3) OR NOT EXISTS (SELECT 'X' FROM PSSERVERSTAT WHERE SERVERNAME = 'PSNTRP03');
if [ $? -eq 0 ] # found at least one match then mailx -s 'FMRPT P.SCHEDULER IS DOWN' xxxx_at_skytel.com< errfilelog exit -1 fi
Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services ---------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Mar 07 2003 - 10:24:24 CST
![]() |
![]() |