Linux_CentOS_7.9_Oracle11gr2配置数据库及监听服务自启动多方案实操之简易记录

news/2025/2/22 4:23:57/
前言: 作为运维保障,都无法准确预估硬件宕机的突发阶段,其生产数据实时在产出,那作为dba数据库服务以及相关Listener的其重要性、必要性就突显而出。这里拿虚拟机试验做个配置记录,便于大家学习参考。

实现方法一:

环境变量值::$ORACLE_HOME= /data/oracle/product/11.2.0/db_1/
一、安装好Oracle数据库后: 完成配置执行dbstart和dbshut
[root@orcl3 ~]# su - oracle
[oracle@orcl3 ~]$ dbstart
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /data/oracle/product/11.2.0/db_1/bin/dbstart ORACLE_HOME

在这里插入图片描述
错误原因:dbstart和dbshut脚本文件中ORACLE_HOME_LISTNER的设置有问题

[oracle@orcl3 ~]$ vim /data/oracle/product/11.2.0/db_1/bin/dbstart
[oracle@orcl3 ~]$ vim /data/oracle/product/11.2.0/db_1/bin/dbshut 

分别打开两个文件找到以下行并修改:

ORACLE_HOME_LISTNER=$1
修改为:
ORACLE_HOME_LISTNER=$ORACLE_HOME

在这里插入图片描述

二、Linux启动时自动启动Oracle监听和实例
1、修改/etc/oratab文件
[root@orcl3 data]# vim /etc/oratab
找到:   orcl:/data/oracle/product/11.2.0/db_1/:N   
修改为: orcl:/data/oracle/product/11.2.0/db_1/:Y

在这里插入图片描述
#----------------------------#
如果没有/etc/oratab文件,需要执行以下步骤(如有可直接跳过此步骤)
Root下执行以下脚本,生成/etc/oratab文件

[root@orcl3 ~]# /data/oracle/product/11.2.0/db_1/root.sh 
[root@orcl3 ~]# /data/oraInventory/orainstRoot.sh
[root@orcl3 ~]# /data/oracle/product/11.2.0/db_1/root.sh 
Performing root user operation for Oracle 11g 
The following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME=  /data/oracle/product/11.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions 

http://www.ppmy.cn/news/1297492.html

相关文章

浅谈安科瑞直流表在孟加拉某能源公司的应用

摘要:本文介绍了安科瑞直流电表在孟加拉某能源公司的应用。主要用于光伏直流柜内,配合分流器对汇流箱的输出电流电压等进行测量,并采集配电现场的开关信号,装置带有RS485接口可以把测量和采集的数据和设备状态上传。 Abstract: T…

正则表达式Regex

是什么:一句话,正则表达式是对字符串执行模式匹配的技术。 从一段字符串中提取出所有英文单词、数字、字母和数字。 如果采用传统方法:将字符串的所有字符分割成单个,根据ASCII码判断,在一定范围内就是字母&#xff…

2707. 字符串中的额外字符(字典树)

哈希表动态规划 将dictionary中的内容存储在hashmap中,方便查找。 然后判断当只有一个字符a的时候,d[1]存在两种情况: 字符在dictionary里,返回0字符不在dictionary里,返回1 之后再有第二个字符b,存在情…

Spring Data Jpa 使用EntityManager执行SQL操作数据

使用EntityManager执行原生SQL语句可以通过createNativeQuery方法实现。以下是一个简单的例子,演示如何使用EntityManager执行SQL语句进行数据库操作。 import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.trans…

docker jenkins NB: JAVA_HOME should point to a JDK not a JRE

jenkins java编译错误: 3.5.4/conf/settings.xml The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE Build step ‘Invoke top-level Maven t…

免费IDEA插件推荐:Apipost-Helper

IDEA插件市场中的API调试插件不是收费(Fast Request )就是不好用(apidoc、apidocx等等)今天给大家介绍一款国产的API调试插件:Apipost-Helper,完全免费且好看好用! 这款插件由Apipost团队开发的…

IDEA git项目 tomcat Tomcat出现404,The requested resource is not available 原因分析

IDEA git项目 tomcat Tomcat出现404,The requested resource is not available 原因分析 前言 刚用 idea 来写java Web项目的时候 经常遇到Tomcat配置相关的问题,其中404 算是比较好解决的问题 目前我吧这几种情况归纳了主要4种情况 1.Project Module…

MySQL深入——9

如何正确的显示随机信息? 我们来模拟在英语单词app当中随机出现三个英语单词的情况,我们首先创建一张表words,然后给这个表当中插入10000条信息进行量化。 select word from words order by rand() limit 3; order by rand&…