CentOS 7.6 RPM 方式安装Oracle19c 后 使用 systemd 的方式设置开机自动启动Oracle数据库
2024-08-31 01:32:02
1. 方法简介:
使用systemd 来进行 oracle数据库的启动和关闭操作. 使用的脚本为 lsnrctl和dbstart
2. 修改事项.
需要先修改一下 oracle 的启动脚本配置:
vim /etc/oratab 将里面 最后一句话设置从N 修改为Y 允许启动 ORA19C:/opt/oracle/product/19c/dbhome_1:Y
注意这个文档说明:
# 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:<N|Y>:
#
# 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.
3. 然后设置一下 数据库的启动命令
vim /usr/bin/oracle.sh 增加的内容为:
#! /bin/bash
# script For oracle19c.service
/opt/oracle/product/19c/dbhome_1/bin/lsnrctl start
/opt/oracle/product/19c/dbhome_1/bin/dbstart /opt/oracle/product/19c/dbhome_1
然后设置这个文件的读写权限
chmod /usr/bin/oracle.sh
4. 设置一个 oracle19c.service
vim /etc/systemd/system/oracle19c.service 编辑添加内容为:
[Unit]
Description=Oracle19c
After=syslog.target network.target
[Service]
LimitMEMLOCK=infinity
LimitNOFILE=65535
Type=oneshot
RemainAfterExit=yes
User=oracle
Environment="ORACLE_HOME=/opt/oracle/product/19c/dbhome_1"
ExecStart=/usr/bin/oracle.sh
[Install]
WantedBy=multi-user.target
5. 设置开机自动启动
systemctl enable oracle19c
6. 重启测试.
成功.
最新文章
- jQuery验证插件 Validate详解
- ASP.NET MVC 异常Exception拦截器Fillter
- moment.js 的简单应用
- mysql提示:Illegal mix of collations for operation ‘UNION’
- BZOJ2121 字符串游戏
- 消息系统Kafka介绍
- 直接使用ip访问google搜索
- switch函数——Gevent源码分析
- Java 多线程 (并发)总结
- 玩转web之javaScript(五)---js和jquery一些不可不知的方法(input篇)
- mongodb中limit与skip方法
- Ubuntu 安装 Mysql 5.6 数据库
- Flask入门之SQLAlchemy配置与数据库连接
- centOS6.5 mysql-community-server安装失败
- 百度地图开发者API学习笔记一(转载)
- Gedit浏览器常用快捷键备注
- 超恶心的TP模版取值
- php in_array 的一个坑
- linux安装部署Nginx
- Elasticsearch分布式机制探究
热门文章
- thinkphp5杂谈--模板
- vue导航菜单动态展示
- Mybatis-Plus和Mybatis的区别
- Qt新建工程
- 【转载】mysqld_safe Directory ‘/var/run/mysqld’ for UNIX socket file don’t exists.
- Module not found: Error: Can&#39;t resolve &#39; vue-resource&#39;
- jconsole性能监控
- java.sql.SQLException: The server time zone value &#39;&#195;–&#195;&#194;&#185;&#195;&#186;&#194;&#177;&#195;&#170;&#195;—&#194;&#188;&#195;Š&#194;&#177;&#194;&#188;&#195;&#164;&#39; is unrecognized or repr
- MVC的一个简单实例
- Oracle JET Router 与 Module 数据传递