Linux设置Oracle开机自启动

栏目: 数据库 · Oracle · 发布时间: 8年前

内容简介:版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kongxx/article/details/82155876

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kongxx/article/details/82155876

编辑 /etc/oratab 文件

修改其中的路径,并且将最后的 “N” 改为 “Y”,如下:

orcl:/home/oracle/app/oracle/product/12.2.0/dbhome_1:Y

创建/修改 /etc/systemd/system/oracle-rdbms.service 文件

文件内容如下(注意其中文件路径):

# /etc/systemd/system/oracle-rdbms.service
# Invoking Oracle scripts to start/shutdown Instances defined in /etc/oratab
# and starts Listener
[Unit]
Description=Oracle Database(s) and Listener
Requires=network.target
[Service]
Type=forking
Restart=no
ExecStart=/home/oracle/app/oracle/product/12.2.0/dbhome_1/bin/dbstart /home/oracle/app/oracle/product/12.2.0/dbhome_1
ExecStop=/home/oracle/app/oracle/product/12.2.0/dbhome_1/bin/dbshut /home/oracle/app/oracle/product/12.2.0/dbhome_1
User=oracle
[Install]
WantedBy=multi-user.target

设置服务开机自启动

sudo systemctl enable oracle-rdbms.service

重新启动机器。

也可以手动启动/停止服务

sudo systemctl start oracle-rdbms.service 
sudo systemctl stop oracle-rdbms.service

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

Charlotte's Web

Charlotte's Web

E. B. White / Puffin Classics / 2010-6-3 / GBP 6.99

This is the story of a little girl named Fern who loved a little pig named Wilbur and of Wilbur's dear friend, Charlotte A. Cavatica, a beautiful large grey spider. With the unlikely help of Templeton......一起来看看 《Charlotte's Web》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具