记一次asm磁盘异机挂载出现 ORA-12547 的问题
参考:DB started by sqlplus cannot be stopped by srvctl( ORA-12547 ), and vice versa (Doc ID 2612663.1)
问题场景:客户更换了rac数据库主机,然后将原来的asm磁盘挂载到了新主机上,用新主机挂起。
下面是我注册时候的命令:
srvctl add database -d *** -o /u01/app/oracle/product/19/db_1/ -c RAC -p *** -pwfile ***
srvctl add instance -d racdb -i racdb1 -n racdb1
srvctl add instance -d racdb -i racdb2 -n racdb2
注册后的数据库的情况:
[oracle@oadb1 ~]$ srvctl config database -d ***
数据库唯一名称: ***
数据库名:
Oracle 主目录: /u01/app/oracle/product/19/db_1/
Oracle 用户: oracle
Spfile: +DATA/DB_UNKNOWN/PARAMETERFILE/SPFILE.298.1170321729
口令文件: +data/***adg/passwordfile/orapw***
域:
启动选项: open
停止选项: immediate
数据库角色: PRIMARY
管理策略: AUTOMATIC
服务器池:
磁盘组:
装载点路径:
服务:
类型: RAC
启动并行:
停止并行:
OSDBA 组: dba
OSOPER 组: oper
数据库实例: ***1,***2
已配置的节点: oadb1,oadb2
CSS 关键型: no
CPU 计数: 0
内存目标: 0
最大内存: 0
数据库服务的默认网络编号:
数据库是管理员管理的
问题现象:
使用srvctl启动数据库(开机自启)后,sqlplus / as sysdba登录报ORA-12547,并且$ORACLE_HOME/bin/oracle 之类的文件均未做改动权限正常。
如果使用sqlplus启动实例,则使用srvctl停止实例将失败报错:ORA-12547
[oracle@host1:/home/oracle]$sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Nov 15 12:57:46 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@host1:/home/oracle]$srvctl stop database -d racdb
PRCD-1334 : failed to stop database racdb
PRCD-1124 : Failed to stop database racdb and its services
PRCD-1131 : Failed to stop database racdb and its services on nodes
PRCR-1133 : Failed to stop database racdb and its running services
PRCR-1132 : Failed to stop resources using a filter
ORA-12547: TNS:lost contact
CRS-2675: Stop of 'ora.racdb.db' on 'host1' failed
如果使用srvctl启动数据库使用sqlplus / as sysdba 登录报错:
[oracle@host1:/home/oracle]$sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Nov 14 17:45:21 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
ERROR:
ORA-12547: TNS:lost contact
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
问题原因:
srvctl add database -d *** -o /u01/app/oracle/product/19/db_1/ 我们在注册数据库的时候多了一个/号(11g是没问题的)
处理办法:
srvctl stop database -d racdb
srvctl modify database -d racdb -o /u01/app/oracle/product/19.0.0/db_1
srvctl start database -d racdb