1、使用Oracle用户在Oracle应用的bin目录下(例如:/oracle/product/9.2.0/bin)建立启动和停止Oracle的脚本文件。
例如
startoracle.bat

echo "start oracle ......"
lsnrctl start
sqlplus /nolog <<EOF
connect / as sysdba
startup
exit
exit
echo "start oracle over!"

stoporacle.bat

echo "Stop Oracle ......"
lsnrctl stop
sqlplus /nolog <<EOF
connect / as sysdba
shutdown immediate
exit
exit

2、使用root用户在/etc建立rc.startoracle和rc.stoporacle

rc.startoracle

su - oracle "-c /oracle/app/product/9.2.0/bin/autostart.bat" #auto start oracle

rc.stoporacle

su - oracle "-c /oracle/app/product/9.2.0/bin/autostop.bat"

给予rc.startoracle和rc.stoporacle执行权限

在inittab中最后添加一样如下:
startoracle:2:wait:/etc/rc.startoracle

在rc.shutdown中添加一行如下:
rc.stoporacle

3、至此,设置完毕



相关文章:

  • 2022-02-15
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2021-11-18
相关资源
相似解决方案