Friday, April 26, 2013

ORA-12547: TNS:lost contact

Yesterday I faced a issue in my Oracle database.When I am trying to connect through oracle user( user with which database installed) I am able to connect successfully, but when through a different user of the same group as of oracle user I am getting below mentioned error :-

bash-3.2$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 25 14:47:51 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: amit/amit
ERROR:
ORA-12547: TNS:lost contact

Enter user-name:
bash-3.2$ id
uid=207(amit) gid=205(oinstall) groups=206(dba)
bash-3.2$

But When I am trying to connect through oracle user :-

bash-3.2$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 26 12:37:51 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: amit
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
bash-3.2$ id
uid=212(oracle) gid=205(oinstall) groups=206(dba)
bash-3.2$

I checked all tnsnames.ora , listener.ora, sqlnet.ora , all are fine . Then I checked permission of oracle file in $ORACLE_HOME/bin directory and I get this :-

bash-3.2$ cd $ORACLE_HOME/bin
bash-3.2$ ls -ltr oracle
-rwxr-xr-x    1 oracle   oinstall  271812857 May 29 2012  oracle
bash-3.2$

Change the permission of oracle file with oracle user :-

bash-3.2$ id
uid=212(oracle) gid=205(oinstall) groups=206(dba)
bash-3.2$
bash-3.2$ cd $ORACLE_HOME/bin
bash-3.2$ ls -ltr oracle
-rwxr-xr-x    1 oracle   oinstall  271812857 May 29 2012  oracle

bash-3.2$ chmod 6751 oracle
bash-3.2$ ls -ltr oracle
-rwsr-s--x    1 oracle   oinstall  271812857 May 29 2012  oracle

Now try to connect through amit user 

bash-3.2$ id
uid=207(amit) gid=205(oinstall) groups=206(dba)
bash-3.2$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 26 13:23:54 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: amit
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

Usually this operation solves this problem , still we further investigate permission of other files to avoid further problems. These special rights of Oracle binaries are set by $ORACLE_HOME/root.sh script on Unix/Linux after the Oracle Installation. We can run this script again as root user to set the permissions , if we see more files have wrong permissions or ownership.

I hope this article helped you.

Regards,
Amit Rath

1 comment:

  1. The issue is not resolved even after application of the above listed solutions. Any kind of further help regarding this will be appreciated. Thank You.

    ReplyDelete