ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

Centos7 设置oracle11G开机自动启动

2020-04-17 15:08:20  阅读:689  来源: 互联网

标签:bin etc 11.2 Centos7 ORACLE oracle 开机 HOME oracle11G


Centos7 设置oracle11G开机自动启动

1.vim /etc/oratab

把orcl:/data/oracle/product/11.2.0/db_1:N

修改成orcl:/data/oracle/product/11.2.0/db_1:Y

2.vim vi /etc/rc.d/rc.local

把红色的,修改成,现场实际文件实际的路径。

#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local
su - oracle -c /data/oracle/product/11.2.0/db_1/bin/lsnrctl start
su - oracle -c /data/oracle/product/11.2.0/db_1/bin/dbstart

 

3.新建文件

vim /etc/init.d/oracle

 


#!/bin/sh
# chkconfig: 345 61 61
# description: Oracle 11g R2 AutoRun Servimces
# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=ORCL
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracle"
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
su $ORA_OWNR -lc $ORACLE_HOME/bin/dbstart

 

标签:bin,etc,11.2,Centos7,ORACLE,oracle,开机,HOME,oracle11G
来源: https://www.cnblogs.com/lvhongwei/p/12720022.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有