操作步骤:
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