Catatan Ku

Coretan Seorang Hamba

About Me

My Photo
Martha
Seorang Manusia Yang berasal Dari Air yang Hina, Berkat Rahmat Tuhannya dia dimuliakan dengan diciptakan sebagai Manusia. Dan akan berpulang menjadi bangkai yang di mkan ulat-ulat
View my complete profile

Popular Posts

berikut cara mengambil data dari oracle ke unix shell untuk monitoring :

ORACLE_HOME=/app/oracle/product/10.2.0/Db_1;
export ORACLE_HOME;
PATH=$PATH:$ORACLE_HOME/bin;
export PATH;

DATE=`sqlplus -s viewonly/viewonly@ABCSSRV << EOF
set pages 1000
set heading off

select CONCAT(CONCAT(TO_CHAR(SYSDATE,'DD-MM-YYYY HH24:MI:SS'), ' --> '),TO_CHAR(count(1))) BACKLOG from nsowner.server1_response_t
able_01 where status is null
and create_date <=sysdate;

quit;
EOF`

echo $DATE


Script ke 2
while true;
clear;
do
sh monitoring2.sh;
sleep 60;
done;

-bash-3.2$ more monitoring2.sh
datte=`date +%d-%m-%Y`
min=`date +%H:%M`
if ps -ef | grep -v grep | grep java | grep RxSmsEsme > /dev/null
then
echo $datte $min "| NS1 RX ESME STATUS = UP"
else
echo $datte $min "| NS1 RX ESME STATUS = DOWN (aplication down)"
fi

Leave a Reply