ORA-12547: TNS:lost contact

碰到这个ORA-12547: TNS:lost contact的问题,翻了很多资料和METALINK,总结了一下原因:

1 是由于rpm包没有安装,对于我们的生产环境,此包是安装的。

admin@p1b:/home/admin>rpm -q glibc-devel

glibc-devel-2.5-58.el5_6.4

glibc-devel-2.5-58.el5_6.4

admin@p1b:/home/admin>rpm -q libaio

libaio-0.3.106-5

libaio-0.3.106-5

admin@p1b:/home/admin>

 

2 是因为权限不足,

linux 5.3 64位

oracle 11G R2

grid ,oracle用户使用sqlplus 连接无异常 但是其他用户使用sqlplus 连接时,报

ORA-12547 : TNS:lost contact 错误

由于数据库之前转移过目录,查看发现目录下

/data2/oracle/product/11.2.0/bin/

-rwxr-x--x 1 oracle oinstall 210824714 Jun 26 16:33 oracle 权限有问题,更改权限

chmod 6751 oracle

再次连接数据库,正常

 

-rwsr-s--x 1 oracle oinstall 210824714 Jun 26 16:33 oracle

我们的数据库是

admin@p1b.ora.sd.aliyun.com:/home/admin>ls -lsr $ORACLE_HOME/bin/oracle

223748 -rwsr-s--x 1 oracle asmadmin 228886426 Aug 19 02:26 /opt/11202/oracle/11.2.0/alibank/bin/oracle

--属组应该是oinstall 而不是asmadmin

 

oracle metalink中的解决方法:

Solution

To implement the solution, please execute the following steps:

1.
This could be due to kernel parameters settings
Please check the notes below that provide the required settings for kernel parameters

2.
This could be due to Incorrect permissions on the ORACLE.exe
The 'ls' command should show permissions 6751 (as follows)

Please check the following:

$ cd $ORACLE_HOME/bin
$ ls -l oracle

The output should be
-rwsr-s--x 1 oracle dba

If not then please execute the following
$ chmod 6751 oracle

Please also verify if the following are correct

echo $ORACLE_HOME
echo $ORACLE_SID
echo $LD_LIBRARY_PATH
echo $PATH

3.
If the above does not resolve I suggest that you shutdown the database and listener and then
"relink all"

对于生产库,relink all 有点危险,第一种在线安装rpm包,也需要考虑其对生产环境的影响。