当前位置:网站首页>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>
边栏推荐
猜你喜欢
Cool and efficient data visualization big screen, it's really not that difficult to do!丨Geek Planet
来 TDengine 开发者大会,洞悉数据技术发展的未来趋势
手搓一个“七夕限定”,用3D Engine 5分钟实现烟花绽放效果
Small program on how to play in the construction of e-government service platform value
Chinese valentine's day of young people crazy to make money, earn 140000 a week
【黑马早报】尚乘数科上市13天,市值超阿里;北大终止陈春花聘用合同;新东方花近200亿退学费和遣散费;张小泉75%产品贴牌代工...
使用SQLServer复制数据库
跨链桥已成行业最大安全隐患 为什么和怎么办
Practical sharing of distributed link tracking Jaeger + microservice Pig on Rainbond
Focusing on data sources, data quality and model performance to build a credit profile of small and micro enterprises
随机推荐
视觉SLAM十四讲学习笔记 第7讲 视觉里程计
论文翻译:2022_Time-Frequency Attention for Monaural Speech Enhancement
微信小程序使用腾讯云对象储存上传图片
大神们都在用的神器,你和大神只差一个它!!
双目立体视觉笔记(三)三角测量、极线校正
RobotFramework二次开发(一)
Opencv学习之ORB特征提取和匹配
接入华为游戏防沉迷,点击防沉迷弹窗后游戏闪退
绩效考核带给员工的不能只是压力
Do you understand the various configurations in the project?
判断密码是否包含键盘连续字母
String是引用类型
8/3 训练日志 (树状数组+区间覆盖+思维+01字典树)
Programmer Qixi Gift - How to quickly build an exclusive chat room for your girlfriend in 30 minutes
双目立体视觉笔记(二)
Focusing on data sources, data quality and model performance to build a credit profile of small and micro enterprises
分布式链路追踪Jaeger + 微服务Pig在Rainbond上的实践分享
Why is Luo Zhenyu's A-share dream so difficult to fulfill?
Arduino框架下I2S控制ADC采样以及PWM输出示例解析
情人节浪漫3D照片墙【附源码】