参考链接:https://www.cnblogs.com/m317/p/6163781.html 感谢
环境:centos6.2 oracle:10g
1.编写执行的脚本 initSdh.sh
#!/bin/sh
su - oracle <<EON
export ORACLE_SID=sdh
lsnrctl start
sqlplus /nolog <<EOF
conn / as sysdba
startup
exit
EOF
exit
EON
2.添加执行权限
chmod +x initSdh.sh
3.添加自启动
echo “shell脚本路径” >> /etc/rc.local