当前位置:网站首页>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>
边栏推荐
猜你喜欢

A comprehensive understanding of MOS tubes, an article is enough

技术分享| 小程序实现音视频通话

【VSCode】一文详解vscode下安装vim后无法使用Ctrl+CV复制粘贴 使用Vim插件的配置记录

"Lonely Walking on the Moon" is a powerful medicine, it can't cure the internal friction of happy twist

什么是 DevOps?看这一篇就够了!

手搓一个“七夕限定”,用3D Engine 5分钟实现烟花绽放效果

视觉SLAM十四讲学习笔记 第7讲 视觉里程计

Why is Luo Zhenyu's A-share dream so difficult to fulfill?

What is DevOps?Enough to read this one!

COMSOL空气反应 模型框架
随机推荐
RK1126编译gdb 板子上gdb调试程序
抽奖/秒杀/竞价/评分/权威/投票,技术教你用合适的方法做好活动
两个数组中用第二个数组的Value对比换第一个数组中的Key
Django使用腾讯云发送短信并存入redis
【自动微分实现】反向OO实现自动微分(Pytroch核心机制)
Focusing on data sources, data quality and model performance to build a credit profile of small and micro enterprises
新消费、出海、大健康......电子烟寻找“避风港”
使用SQLServer复制数据库
广告电商系统开发之订单处理
Just a Hook
获取本机IP地址的脚本
【PHP实现微信公众平台开发—基础篇】第1章 课程介绍
Motion Rule (16)-Union Check Basic Questions-Relations
Geoffrey Hinton:深度学习的下一个大事件
Js获取当前页面url参数
“蔚来杯“2022牛客暑期多校训练营5 B、C、F、G、H、K
新SCADA 系统:集成边缘计算、MQTT 和云平台
新 Nsight Graph、Nsight Aftermath 版本中的性能提升和增强功能
“蔚来杯“2022牛客暑期多校训练营2 G、J、K
Cache character stream