CENTOS7下设置oracle 11g自启动
来源:互联网 发布:上海日料放题 知乎 编辑:程序博客网 时间:2024/06/05 19:30
修改oratab文件
以root身份进入系统,通过vi命令打开文件
vi /etc/oratab
进入vi编辑器后,找到“orcl:/oracle/app/product/11.2.0/dbhome_1:N”,改为“orcl:/oracle/app/product/11.2.0/dbhome_1:Y”。修改完成后,保存退出vi
# This file is used by ORACLE utilities. It is created by root.sh# and updated by the Database Configuration Assistant when creating# a database.# A colon, ':', is used as the field terminator. A new line terminates# the entry. Lines beginning with a pound sign, '#', are comments.## Entries are of the form:# $ORACLE_SID:$ORACLE_HOME:<N|Y>:## The first and second fields are the system identifier and home# directory of the database respectively. The third filed indicates# to the dbstart utility that the database should , "Y", or should not,# "N", be brought up at system boot time.## Multiple entries with the same $ORACLE_SID are not allowed.###orcl11g:/oracle/app/oracle/product/11.2.0/db_1:Norcl11g:/oracle/app/product/11.2.0/dbhome_1:Y
键入命令“vi /etc/rc.d/rc.local”
在vi编辑器中,添加:
su oracle -lc "/oracle/app/product/11.2.0/dbhome_1/bin/lsnrctl start"su oracle -lc "/oracle/app/product/11.2.0/dbhome_1/bin/dbstart"
新建Oracle服务启动脚本
vim /etc/init.d/oracle
新建一个以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 Interfaceexport ORACLE_BASE=/oracle/appexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=ORCLexport PATH=$PATH:$ORACLE_HOME/binORA_OWNR="oracle"# if the executables do not exist -- display errorif [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]thenecho "Oracle startup: cannot start"exit 1fi# depending on parameter -- startup, shutdown, restart# of the instance and listener or usage displaycase "$1" instart)# Oracle listener and instance startupsu $ORA_OWNR -lc $ORACLE_HOME/bin/dbstartecho "Oracle Start Succesful!OK.";;stop)# Oracle listener and instance shutdownsu $ORA_OWNR -lc $ORACLE_HOME/bin/dbshutecho "Oracle Stop Succesful!OK.";;reload|restart)$0 stop$0 start;;*)echo $"Usage: `basename $0` {start|stop|reload|reload}"exit 1esacexit 0
保存退出
在/etc新建oratab
cd /etcvi oratab
添加如下内容:
orcl:/oracle/app/product/11.2.0/dbhome_1:Y
保存后退出。
检查一下脚本能否正确执行
cd /etc/rc.d/init.d./oracle start./oracle stop
加入自动启动行列
执行如下命令:
chmod 750 /etc/rc.d/init.d/oracleln –s /etc/rc.d/init.d/oracle /etc/rc0.d/K61oracleln –s /etc/rc.d/init.d/oracle /etc/rc2.d/S61oracleln –s /etc/rc.d/init.d/oracle /etc/rc3.d/S61oracleln –s /etc/rc.d/init.d/oracle /etc/rc4.d/S61oracleln –s /etc/rc.d/init.d/oracle /etc/rc6.d/K61oracle
0 0
- CENTOS7下设置oracle 11g自启动
- 在solaris 10下设置Oracle 10g自启动
- CentOS7 Oracle 12C 自启动设置过程
- Centos7下配置nfs并设置开机自启动
- Linux centos7下设置Tomcat开机自启动
- Linux下设置Oracle自启动
- linux下设置oracle自启动
- Linux下设置Oracle开机自启动
- ORACLE 10G+AIX5.3自启动设置
- Redhat4下Oracle 10g安装及自启动配置
- oracle 10G在rhel5下开机启动启动设置
- Linux 下设置oracle 10g 自动启动服务
- centos7设置MySQL开机自启动
- centos7 设置禅道开机自启动
- CentOS7中如何设置网络自启动
- Linux下oracle设置开机自启动的方法
- Linux下Oracle设置开机自启动的方法
- linux下oracle设置开机自启动实现方法
- GDOI2017总结
- 单向链表实现堆栈
- Entity Framework Code First关系映射约定
- [Leetcode] #79 Word Search
- IEEE 802简介 802.11 802.15
- CENTOS7下设置oracle 11g自启动
- Searching and Sorting
- 欢迎使用CSDN-markdown编辑器
- 研究算法的重要性
- 秒杀多线程第一篇 多线程笔试面试题汇总
- c++实现设计模式中的观察者模式,削除代码的if else switch
- POJ 1010 STAMPS 笔记
- numpy.linspace 生成等差数组
- TCP/IP协议族(TCP/UDP的区别)