红联Linux门户
Linux帮助

linux开机自动启动Oracle实例及监听器

发布时间:2015-12-18 09:56:00来源:linux网站作者:【Wonder原创】

操作步骤:


1、编写Script

$ vi /u01/app/oracle/scripts/startup_test.sh

#!/bin/bash
export ORACLE_SID=TEST
echo "`date`  starting up db TEST"

lsnrctl start

$ORACLE_HOME/bin/sqlplus / as sysdba <<EOF

startup;
exit;

EOF

echo "`date` startup successful"
exit;


2、新增开机启动项

# vi /etc/init.d/startup_test

#!/bin/bash
#
# chkconfig: 345 99 80
# description: lsnrctl start
#              startup database.
# processname: startup_test

su - oracle -c "sh /u01/app/oracle/scripts/startup_test.sh">>/u01/app/oracle/scripts/startup_test.log

# ln -s /etc/init.d/startup_test  /etc/rc.d/rc3.d/S99startup_db


Linux开机自动启动ORACLE设置:http://www.linuxdiyf.com/linux/15624.html