sqlplus登录时ORA12547TNSlostcontact[数据库教程]
有一些应用系统的OS用户需要与ORACLE用户具有一样的权限,可以用sqlpus登录并操作数据库。
一般是在安装ORACLE软件时与ORACLE用户一起创建,在创建此类用户时主要需要注意的目录及文件的权限。
安装完成后应用系统用户执行sqlplus命令时报错。
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 28 22:42:57 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
Enter user-name:
ERROR:
ORA-12547: TNS:lost contact
oracle用户是正常的。
[[email protected] bin]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 28 23:19:41 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
根据mos上的文档 Local SQL*Plus Connection and DBCA Fails With: ORA-12547: TNS:Lost Contact (文档 ID 422173.1)
对sqlplus命令跟踪
strace -f -o /tmp/trace.1.log $ORACLE_HOME/bin/sqlplus / as sysdba
在跟踪文件中发现以下错误信息
22232 write(5, "ORA-12753: The Oracle home user "..., 131) = 131
22232 write(5, "
", 1) = 1
22232 write(5, "ORA-27300: OS system dependent o"..., 91) = 91
22232 write(5, "
", 1) = 1
22232 write(5, "ORA-27301: OS failure message: E"..., 38) = 38
22232 write(5, "
", 1) = 1
22232 write(5, "ORA-27302: failure occurred at: "..., 39) = 39
22232 write(5, "
", 1) = 1
22232 write(5, "ORA-27303: additional informatio"..., 94) = 94
应该是$ORACLE_HOME/bin/oracle权限不对
查看了一下权限是775
[[email protected] bin]$ ls -l oracle
-rwxrwxr-x 1 oracle dba 407988856 Jul 28 17:16 oracle
执行以下命令修复后,再次执行正常。
cd $ORACLE_HOME/bin
chmod 6751 oracle
[[email protected] ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 28 23:29:23 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
sqlplus登录时ORA-12547: TNS:lost contact
原文:https://www.cnblogs.com/historynote/p/13394557.html
以上是 sqlplus登录时ORA12547TNSlostcontact[数据库教程] 的全部内容, 来源链接: utcz.com/z/535011.html