Linux下设置Oracle自启动

简介: 测试机总是断电,导致重启后Oracle不自动重启,需要手工操作,因此可以设置成自启动模式。操作系统:Linux数据库:Oracle 10g1、vi /etc/oratab找到bisal:/opt/oracle/102:N,将N设为Y。

测试机总是断电,导致重启后Oracle不自动重启,需要手工操作,因此可以设置成自启动模式。


操作系统:Linux

数据库:Oracle 10g


1、vi /etc/oratab

找到bisal:/opt/oracle/102:N,将N设为Y。

文件的注释:

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

可以看到这里$ORACLE_SID是bisal,$ORACLE_HOME是/opt/oracle/102。

设置为Y时,允许实例自启动,当设置为N时,则不允许自启动。 

这个文件里的配置仅仅起一个开关的作用,其并不会具体的执行启动和关闭,具体的操作由$ORACLE_HOME/bin/dbstart和dbshut 脚本来实现。 这2个脚本在执行时会检查/etc/oratab 文件里的配置,为Y时才能继续执行。


2、将lsnrctl start和dbstart添加到rc.local文件中:

vi /etc/rc.d/rc.local

su oracle -lc "/opt/oracle/102/bin/lsnrctl start"

su oracle -lc  /opt/oracle/102/bin/dbstart

文件:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

此处也可以使用自己定义的脚本作为启动脚本。


然后重启服务器,就可以看到监听和实例都可以自动启动了。

目录
相关文章
|
7月前
|
Oracle 关系型数据库 MySQL
Oracle Linux 8.10 编译安装sysbench
Oracle Linux 8.10 编译安装sysbench
209 34
|
6月前
|
Oracle Cloud Native 关系型数据库
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
266 11
Oracle Linux 10 - Oracle 提供支持 RHEL 兼容发行版
|
6月前
|
Ubuntu Linux 网络安全
在Linux云服务器上限制特定IP进行SSH远程连接的设置
温馨提示,修改iptables规则时要格外小心,否则可能导致无法远程访问你的服务器。最好在掌握足够技术知识和理解清楚操作含义之后再进行。另外,在已经配置了防火墙的情况下,例如ufw(Ubuntu Firewall)或firewalld,需要按照相应的防火墙的规则来设置。
336 24
|
6月前
|
Java 关系型数据库 MySQL
在Linux操作系统上设置JDK、Tomcat、MySQL以及J2EE后端接口的部署步骤
让我们总结一下,给你的Linux操作系统装备上最强的军队,需要先后装备好JDK的弓箭,布置好Tomcat的阵地,再把MySQL的物资原料准备好,最后部署好J2EE攻城车,那就准备好进军吧,你的Linux军团,无人可挡!
151 18
|
6月前
|
Oracle Cloud Native 关系型数据库
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
282 0
Oracle Linux 9.6 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
|
7月前
|
Linux Shell
在Linux、CentOS7中设置shell脚本开机自启动服务
以上就是在CentOS 7中设置shell脚本开机自启动服务的全部步骤。希望这个指南能帮助你更好地管理你的Linux系统。
588 25
|
5月前
|
Oracle 关系型数据库 Linux
MyEMS开源系统安装之CentOS/RHEL/Rocky/AlmaLinux/Oracle Linux
本指南介绍如何在CentOS/RHEL/Rocky/AlmaLinux/Oracle Linux服务器上部署MyEMS开源能源管理系统。内容涵盖系统准备、数据库配置、多个MyEMS服务(如myems-api、myems-admin、myems-modbus-tcp等)的安装与配置,以及Nginx服务器设置和防火墙规则调整。通过完成所有步骤,您将能够访问MyEMS Admin UI和Web UI,默认端口分别为8001和80,初始登录凭据已提供。
244 0
|
7月前
|
Oracle 关系型数据库 MySQL
Oracle linux 8 二进制安装 MySQL 8.4企业版
Oracle linux 8 二进制安装 MySQL 8.4企业版
243 1
|
Oracle 关系型数据库 Linux