Unix 开机时如何自启动oracle

来源:互联网 发布:java性能权威指南 知乎 编辑:程序博客网 时间:2024/06/04 01:27
 下面介绍如何在开机时自动启动ORACLE
在/etc/init.d下建立dbora
#!/bin/sh
ORA_HOME=/u01/app/oracle/product/8.1.7
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start') # Start Oracle Database and Net8 listener
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start" &
su - $ORA_OWNER -c "ORA_HOME/Apache/Apache/bin/apachectl start" &
;;
'stop') # Stop Oracle Database and Net8 listener
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut" &
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" &
su - $ORA_OWNER -c "ORA_HOME/Apache/Apache/bin/apachectl stop" &
;;
esac

然后作一个连接
ln -s /etc/init.d/dbora /etc/rc2.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora

打开/var/opt/oracle/oratab
把N改为Y
orcl:/u01/app/oracle/product/8.1.7:Y
原创粉丝点击