Suse下oracle开机自启动
suseoracle开机自启动
vi /etc/oratab
把最后的 N 改成 Y。
比如:orcl:/home/db/oracle/product/11.1.0/db_1:Y orcl是oracle_sid
./dbstart
./lsnrctl start
设置服务
su
cd /etc/init.d
vi oracle
(注:内容开始,可以在非Linux环境下生成然后复制过去,注意要去掉0D字符)
#!/bin/bash
#
# Startup script for Oracle and listener
#
# chkconfig: 35 99 1
# description: Oracle 8.1.7.0.1
# Setup environment for script execution.
case "$1 " in
start)
echo "Starting Oracle database(s) listed in /etc/oratab ... "
sleep 2
su - oracle -c "/home/db/oracle/product/11.1.0/db_1/bin/dbstart "
echo "Starting TNS listener... "
sleep 2
su - oracle -c "/home/db/oracle/product/11.1.0/db_1/bin/lsnrctl start "
touch /var/lock/subsys/oracle
;;
stop)
echo "Stopping TNS listener... "
sleep 2
su - oracle -c "/home/db/oracle/product/11.1.0/db_1/bin/lsnrctl stop "
echo "Stopping Oracle databases(s) listed in /etc/oratab ... "
sleep 2
su - oracle -c "/home/db/oracle/product/11.1.0/db_1/bin/dbshut "
rm -f /var/lock/subsys/oracle
;;
status)
ps -ax | grep -e ora_ -e tnslsnr
;;
*)
&nbs