#!/bin/sh
#
#set -x
start() {
su - oracle -c "dbstart /home/db/oracle/product/10.2.0"
RETVAL=$?
if [ $RETVAL -eq 0 ];then
return 0
else
return 1
fi
}
stop() {
su - oracle -c "dbshut /home/db/oracle/product/10.2.0"
RETVAL=$?
if [ $RETVAL -eq 0 ];then
return 0
else
return 1
fi
}
orastatus() {
L_status=`su - oracle -c "sqlplus -s /nolog < conn / as sysdba;
set heading off;
set feedback off;
set trimspool on;
@/home/db/oracle/product/10.2.0/rdbms/admin/orastatus.sql
exit;
EOF
"
`
echo $L_status
if [ $L_status = OPEN ]; then
return 0
else
return 1
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
orastatus
;;
*)
echo $"Usage: $0 {start|stop|status}"
exit 2
esac
exit $?
#set -x
阅读(851) | 评论(0) | 转发(0) |