oracle18c服务启动,Oracle数据库之oracle 18c centos7 设置开机自动启动Oracle

本文主要向大家介绍了Oracle数据库之oracle 18c centos7 设置开机自动启动Oracle,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。

1. 在root用户下进行修改 配置文件 /etc/oratab

vim /etc/oratab

内容:

# This file is used by ORACLE utilities.  It is created by root.sh

# and updated by either Database Configuration Assistant while creating

# a database or ASM Configuration Assistant while creating ASM instance.

# 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::

#

# The first and second fields are the system identifier and home

# directory of the database respectively.  The third field 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.

#

#

orcl:/u01/app/oracle/product/18.1.0/dbhome_1:Y

根据信息 增加后者是修改的一行信息为:

orcl:/u01/app/oracle/product/18.1.0/dbhome_1:Y

2. 切换到oracle用户,并且进入到oracle的home路径下

su - oracle

cd $ORACLE_HOME/bin

3. 编辑oracle home目录下的dbstart 以及 dbshut的文件

主要修改点:

将多个 $1 修改为 $ORACLE_HOME

以及将 ORACLEBASEHOME_EXEC修改为如下.

ORABASEHOME_EXEC=$ORACLE_HOME/bin

在bin目录下执行操作测试

./dbshut 以及 ./dbstart 验证 能够正常开启或者关闭数据库

验证lsnrctl 下status以及 oracle  sqlplus / as sysdba 下面都可用

4. 修改开机启动脚本.

切换到root用户

su - root

vim /etc/rc.d/rc.local#这里需要给rc.local增加可执行权限chmod +x /etc/rc.d/rc.localsystemd 之后 linux 应该已经不主要支持rc.local下面的启动方式了.

在文档的最后增加一行

su - oracle -lc dbstart

5. reboot linux 验证 oracle可以自动启动起来.

本文由职坐标整理并发布,希望对同学们学习Oracle有所帮助,更多内容请关注职坐标数据库Oracle数据库频道!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值