童年原是一生最美妙的阶段,那时的孩子是一朵花,也是一颗果子,是一片懵懵懂懂的聪明,一种永远不息的活动,一股强烈的欲望。——巴尔扎克
现在位置:首页 > 资源宝库 > 技术教程 > Oracle rac sqlplus启动不了数据库但是数据库状态却是running

Oracle rac sqlplus启动不了数据库但是数据库状态却是running

绿色资源网  技术教程  2021-9-29  62  0评论
    <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-1a85854398.css">

Oracle rac dataguard sqlplus启动不了数据库

1.问题描述

使用srvctl命令查看集群节点的数据库状态都是正常的running状态。

[oracle@stbrac2 dbs]$ srvctl status database -d stbrac
Instance stbrac1 is running on node stbrac1
Instance stbrac2 is running on node stbrac2

使用crsctl 命令查询集群的各个服务也是显示正常的。

[oracle@stbrac2 dbs]$ crsctl status res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       stbrac1                  STABLE
               ONLINE  ONLINE       stbrac2                  STABLE
ora.DATA.dg
               ONLINE  ONLINE       stbrac1                  STABLE
               ONLINE  ONLINE       stbrac2                  STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       stbrac1                  STABLE
               ONLINE  ONLINE       stbrac2                  STABLE
ora.OCR.dg
               ONLINE  ONLINE       stbrac1                  STABLE
               ONLINE  ONLINE       stbrac2                  STABLE
ora.chad
               ONLINE  ONLINE       stbrac1                  STABLE
               ONLINE  ONLINE       stbrac2                  STABLE
ora.net1.network
               ONLINE  ONLINE       stbrac1                  STABLE
               ONLINE  ONLINE       stbrac2                  STABLE
ora.ons
               ONLINE  ONLINE       stbrac1                  STABLE
               ONLINE  ONLINE       stbrac2                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       stbrac1                  STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       stbrac1                  169.254.142.38 10.0.
                                                             0.81,STABLE
ora.asm
      1        ONLINE  ONLINE       stbrac1                  Started,STABLE
      2        ONLINE  ONLINE       stbrac2                  Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       stbrac1                  STABLE
ora.mgmtdb
      1        ONLINE  ONLINE       stbrac1                  Open,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       stbrac1                  STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       stbrac1                  STABLE
ora.stbrac.db
      1        ONLINE  INTERMEDIATE stbrac1                  Mounted (Closed),HOM
                                                             E=/u01/app/oracle/pr
                                                             oduct/12.2.0/dbhome_
                                                             1,STABLE
      2        ONLINE  INTERMEDIATE stbrac2                  Mounted (Closed),HOM
                                                             E=/u01/app/oracle/pr
                                                             oduct/12.2.0/dbhome_
                                                             1,STABLE
ora.stbrac1.vip
      1        ONLINE  ONLINE       stbrac1                  STABLE
ora.stbrac2.vip
      1        ONLINE  ONLINE       stbrac2                  STABLE
--------------------------------------------------------------------------------

使用sqlplus命令进入到客户端控制台,确显示Connected to an idle instance.

[oracle@stbrac2 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sun Sep 26 07:18:09 2021

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/12.2.0/dbhome_1/dbs/initrac2.ora'
SQL> show parameter dg_broker
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
SQL> 

2.解决办法

执行startup nomount命令后报错找不到‘/u01/app/oracle/product/12.2.0/dbhome_1/dbs/initrac2.ora’参数文件。由于这台机器是dataguard的rac备机,服务名应该是stbrac2,但是这里提示是initrac2.ora文件不存在,因此我怀疑是ORACLE_SID设置错了。

export ORACLE_SID=stbrac2

修改完ORACLE_SID环境变量后重新进入sqlplus发现正常了。

[oracle@stbrac2 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sun Sep 26 10:12:44 2021

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show parameter dg_broker

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1               string      +DATA/STBRAC/DGCONFIG/dr1stbra
                                                 c.dat
dg_broker_config_file2               string      +DATA/STBRAC/DGCONFIG/dr2stbra
                                                 c.dat
dg_broker_start                      boolean     TRUE
SQL> 
            <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/markdown_views-d7a94ec6ab.css" rel="stylesheet">
评论一下 分享本文 联系站长
绿色资源网
看完文章就评论一下!
挤眼 亲亲 咆哮 开心 想想 可怜 糗大了 委屈 哈哈 小声点 右哼哼 左哼哼 疑问 坏笑 赚钱啦 悲伤 耍酷 勾引 厉害 握手 耶 嘻嘻 害羞 鼓掌 馋嘴 抓狂 抱抱 围观 威武 给力
提交评论

清空信息
关闭评论