当前位置:网站首页>sqlplus报错ORA-12547: TNS:lost contact解决
sqlplus报错ORA-12547: TNS:lost contact解决
2022-08-04 12:49:00 【墨天轮】
Oracle 19c RAC for Linux二节点sqlplus登录数据库报错ORA-12547: TNS:lost contact
1. 报错
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 31 22:27:49 2022
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
2. strace定位
[[email protected] ~]$ strace -T -f sqlplus / as sysdba
execve("/u01/app/oracle/product/19.0.0/dbhome_1/bin/sqlplus", ["sqlplus", "/", "as", "sysdba"], 0x7fffabe7fc98 /* 21 vars */) = 0 <0.000209>
brk(NULL) = 0x81c000 <0.000013>
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5895224000 <0.000069>
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) <0.000127>
...省略部分
[pid 7656] close(5) = 0 <0.000022>
[pid 7656] stat("/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/log", {st_mode=S_IFDIR|0755, st_size=8192, ...}) = 0 <0.000005>
[pid 7656] stat("/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/log/honor2_ora_7656.trc", 0x7ffc3952ff20) = -1 ENOENT (No such file or directory) <0.000033>
[pid 7656] open("/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/log/honor2_ora_7656.trc", O_WRONLY|O_CREAT|O_EXCL, 0660) = 5 <0.000082>
[pid 7656] lstat("/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/log/honor2_ora_7656.trc", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0 <0.000053>
...省略部分
[pid 7656] write(5, "ORA-12753: The Oracle home user "..., 131) = 131 <0.000003>
[pid 7656] write(5, "\n", 1) = 1 <0.000002>
[pid 7656] write(5, "ORA-27300: OS system dependent o"..., 91) = 91 <0.000004>
[pid 7656] write(5, "\n", 1) = 1 <0.000004>
[pid 7656] write(5, "ORA-27301: OS failure message: E"..., 38) = 38 <0.000002>
[pid 7656] write(5, "\n", 1) = 1 <0.000002>
[pid 7656] write(5, "ORA-27302: failure occurred at: "..., 39) = 39 <0.000003>
[pid 7656] write(5, "\n", 1) = 1 <0.000025>
[pid 7656] write(5, "ORA-27303: additional informatio"..., 96) = 96 <0.000003>
...省略部分
write(1, "ORA-12547: TNS:lost contact\n", 28ORA-12547: TNS:lost contact
) = 28 <0.000004>
...省略部分
从上面strace输出可以看出:
生成了trc文件
[[email protected] ~]$ cat /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/log/honor2_ora_7656.trc
Dump file /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/log/honor2_ora_7656.trc
Build label: RDBMS_19.3.0.0.0DBRU_LINUX.X64_190417Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Build label: RDBMS_19.3.0.0.0DBRU_LINUX.X64_190417
ORACLE_HOME: /u01/app/oracle/product/19.0.0/dbhome_1
System name: Linux
Node name: rac02
Release: 5.4.17-2102.201.3.el7uek.x86_64
Version: #2 SMP Fri Apr 23 09:05:55 PDT 2021
Machine: x86_64
Storage: ?
Instance name: honor2
Redo thread mounted by this instance: 0 <none>
Oracle process number: 0
Unix process pid: 7656, image:
*** 2022-07-31T22:14:54.619409+08:00
ORA-12753: The Oracle home user ID does not match the effective user ID of the local client which connected to the Oracle instance.
ORA-27300: OS system dependent operation:check $ORACLE_HOME ownership failed with status: 0
ORA-27301: OS failure message: Error 0
ORA-27302: failure occurred at: spstp:4
ORA-27303: additional information: ORACLE_HOME uid does not match euid. uid: 54322 euid: 54321
报错ORA-12753、ORA-27300、ORA-27301、ORA-27302、ORA-27303
[[email protected] ~]$ oerr ora 12753
12753,00000, "The Oracle home user ID does not match the effective user ID of the local client which connected to the Oracle instance."
// *Document: YES
// *Cause: The user ID that is the owner of the Oracle home directory was not
// the same as the effective user ID of the local client that connected
// to the Oracle instance.
// *Action: Run the local client that connects to Oracle instance with the same
// user ID as the owner of the Oracle home.
3. 解决
从上面报错已经可以看出原因,由于ORACLE_HOME目录属主与客户端有效用户ID不同,我们去检查一下
[[email protected] ~]$ cd $ORACLE_HOME
[[email protected] dbhome_1]$ ls -ld ../dbhome_1/
drwxrwxr-x. 69 grid oinstall 4096 Jul 24 01:11 ../dbhome_1/
2. 找到原因,解决就很简单了,修改属主即可
[[email protected] log]# cd /u01/app/oracle/product/19.0.0/
[[email protected] 19.0.0]# chown oracle:oinstall dbhome_1/
[[email protected] 19.0.0]# su - oracle
Last login: Sun Jul 31 22:42:02 CST 2022 on pts/4
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 31 22:43:35 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
边栏推荐
猜你喜欢
基于双层共识控制的直流微电网优化调度(Matlab代码实现)
PMP每日一练 | 考试不迷路-8.4(包含敏捷+多选)
全面认识MOS管,一篇文章就够了
03 多线程与高并发 - ReentrantLock 源码解析
分布式链路追踪Jaeger + 微服务Pig在Rainbond上的实践分享
新 Nsight Graph、Nsight Aftermath 版本中的性能提升和增强功能
TensorFlow学习记录(三):高阶操作 & 神经网络与全连接层
ShanDong Multi-University Training #4 A、B、C、G
跨链桥已成行业最大安全隐患 为什么和怎么办
Cool and efficient data visualization big screen, it's really not that difficult to do!丨Geek Planet
随机推荐
抽奖/秒杀/竞价/评分/权威/投票,技术教你用合适的方法做好活动
Ultra-QuickSort
03 多线程与高并发 - ReentrantLock 源码解析
ReentrantLock 原理
正确使用Impala的invalidate metadata与refresh语句
【PHP实现微信公众平台开发—基础篇】第1章 课程介绍
广告电商系统开发
聚焦数据来源、数据质量和模型性能构建小微企业信用画像
Unity 3D模型展示框架篇之资源打包、加载、热更(Addressable Asset System | 简称AA)
持续交付(二)PipeLine基本使用
罗振宇的A股梦,咋这么难圆?
MySQL - Explain explanation
动规(16)-并查集基础题——格子游戏
LeetCode_299_猜数字游戏
A Collection of Flutter Tutorials (2022 Edition)
绩效考核带给员工的不能只是压力
数据中台建设(九):数据中台资产运营机制
1314元的七夕礼盒,收割了多少直男?
Chinese valentine's day of young people crazy to make money, earn 140000 a week
“蔚来杯“2022牛客暑期多校训练营3 C