linux shell如何调用sqlplus关闭数据库
-bash-3.2 root$ gb.sh
#!/bin/bash
su - oracle
cd /home/oracle
sh shutdown.sh
-bash-3.2$ more shutdown.sh
#!/bin/bash
procc=`ps -ef|grep ora_|grep -v ora|wc -l`
if [ ${proc} -ne 0 ]
then
echo 'oracle is starting'
fi
sqlplus '/as sysdba'<<EOF
shutdown immediate
exit
EOF
proccnt=`ps -ef|grep ora_|grep -v ora|wc -l`
if [ ${proccnt} -eq 0 ]
then
echo 'oracle have stopped'
fi
linux shell如何调用sqlplus开启数据库
shutdown immediate
exit
EOF
proccnt=`ps -ef|grep ora_|grep -v ora|wc -l`
if [ ${proccnt} -eq 0 ]
then
echo 'oracle have stopped'
fi
linux shell如何调用sqlplus开启数据库
bash-3.2 root$ kq.sh
#!/bin/bash
su - oracle
cd /home/oracle