linux启动关闭oracle脚本

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 07:30 点击:

自动启动ORACLE服务
在oracle用户下:
   vi Start_ORA.sh
--------------------------------
echo "Begin to start the oracle!"
lsnrctl start
sqlplus /nolog <<EOF
connect /as sysdba
startup
exit
EOF
echo "Oracle just have been started!"
exit

自动关闭ORACLE服务
vi Stop_ORA.sh
--------------------------------
echo "Begin to stop the oracle!"
sqlplus /nolog <<EOF
connect /as sysdba
shutdown immediate
exit
EOF
lsnrctl stop
echo "Oracle just have been stopped!"
exit

脚本编写完成后分别给这两个脚本执行权限
chmod a+x Start_ORA.sh
chmod a+x Stop_ORA.sh
将启动和关闭oracle脚本加到系统的开机自启动
vi /etc/rc.local
su - oracle -c "/home/oracle/Start_ORA.sh" #启动oracle

作者“lijun-19871023”
 

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • /etc/fstab 详解
      • nginx主主集群
      •  LVS-NAT和LVS-DR模式的实现详解
      •  RHCE考试之磁盘配额
      • 学习笔记:ACL详解
      • suse linux双网卡双网关配置
      •  LVM逻辑卷管理器
      •  Nginx主主负载均衡架构
      • ubuntu学习Mysql

      快速直达

      操作系统导航

      LinuxWindows虚拟机
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1