ORA-12547: TNS:lost contact

This is a quick note to cover ORA-12547: TNS:lost contact error, I would try to include all possible causes of ORA-12547: TNS:lost contact error so that this post itself could assist you in sorting the issue.
1
2
3
4
5
6
7
8
sqlplus / as sysdba
 
SQL*Plus: Release 11.1.0.7.0 - Production on Wed Mar 30 11:59:06 2011
 
Copyright (c) 1982, 2008, Oracle. All rights reserved.
 
ERROR:
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact error could be due to any of the following reasons:-
  • Incorrect permissions on the ORACLE executable.
  • Insufficient ulimit setting for stack.
  • $ORACLE_HOME/rdbms/lib/config.o is 0 bytes.
  • Oracle binaries have not been linked correctly.
  • A missing $ORACLE_HOME/dbs directory.
  • Incorrect kernel parameters settings.
Incorrect permissions on the ORACLE executable
To check where the permission issue lies use strace (One of my favorite troubleshooting tool)
1
strace -f -o /tmp/strace.log $ORACLE_HOME/bin/sqlplus / as sysdba
Then scan the log for EACCES (Permission denied):-
1
2
3
4
21810 open("/apps/oracle/server/11.2.0.4/admin/ORCL/diag/rdbms/orcl/ORCL/alert/log.xml", O_WRONLY|O_CREAT|O_APPEND, 0664) = -1 EACCES (Permission denied)
......
 
21810 open("/apps/oracle/server/11.2.0.4/admin/ORCL/diag/rdbms/orcl/ORCL/trace/alert_ORCL.log", O_WRONLY|O_CREAT|O_APPEND, 0664) = -1 EACCES (Permission denied)
To confirm this check the permission of $ORACLE_HOME/bin/oracle
1
ls -ltr $ORACLE_HOME/bin/oracle
The permission should be -rwsr-s–x,
1
-rwsr-s--x. 1 oracle oinstall 228470203 Dec  3  2014 /apps/oracle/server/11.2.0.4/dbhome_1/bin/oracle
If its different execute below command to fix it:-
1
chmod 6751 oracle
Insufficient ulimit setting for stack
Check the current ulimit setting for stack
1
ulimit -a
Check the install guide for your specific platform and version of Oracle and set the stack appropriately.
$ORACLE_HOME/rdbms/lib/config.o is 0 bytes
Check to ensure the following two files are not 0 bytes:
1
2
$ORACLE_HOME/bin/oracle
$ORACLE_HOME/rdbms/lib/config.o
If yes, rename the following file:
1
2
cd $ORACLE_HOME/rdbms/lib
mv config.o config.o.bad
Then, relink the oracle binary to fix the issue:
1
$ORACLE_HOME/bin/relink oracle
Oracle binaries have not been linked correctly
If relinking the binaries in above step doesn’t fixed the issue then shutdown the database and listener and then issue:-
1
$ORACLE_HOME/bin/relink all
Incorrect kernel parameters settings
Last but not the least this error can be even due to incorrect kernel parameter settings thus if the above mentioned fixes does not resolve your issue please cross check the kernel parameter settings of your env. with the documentation, and amend the configuration in case of any discrepancy and restart the listener.
Hope this helps you in fixing ORA-12547: TNS:lost contact error, in case of any concerns or assistance please feel free to add your comment below and we would respond accordingly.

Comments