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

前言: 作为运维保障,都无法准确预估硬件宕机的突发阶段,其生产数据实时在产出,那作为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
找到:   #   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
修改为: 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= oracle
    ORACLE_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 will 
  • 19
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

蚊子不吸吸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值