Issue / Oracle error
SQL*Plus: Release 10.2.0.5.0 - Production on Wed May 18 09:32:35 2011
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
ORA-12547: TNS :lost contact when try to connect to Oracle.
I saw that TNS connection issue along with ORA-12547 Oracle error several times, usually when trying to connect to Oracle database server on Unix / Linux host with an OS user that does not belong to oinstall group (Oracle binaries owner group). In this case, interesting enough that local TNS connection to database (when using tnsnames alias) works fine:
and only local BEQ protocol connection through an Oracle error ORA-12547:
ORA-12547: TNS:lost contact
There can be different reasons of this issue, but usually the problem is in wrong privileges/ownership of some Oracle binaries located in $ORACLE_HOME/bin directory. Perhaps, Oracle database binaries were installed / linked not correctly or something or somebody has changed the files’ ownership.
- Ensure the DB is up and running and you can connect locally AS SYSDBA to the database using Oracle binaries owner (usually oracle:oinstall Unix / Linux user). If it does not work, probably you encounter a different problem.
- Check privileges of an Oracle file on Unix / Linux host where database is running:
- Change permissions as below:
- Usually the above operation should fix the issue but I suggest continue investigating privileges of other files to avoid further possible problems. As the matter of fact these special rights of Oracle binaries are set by $ORACLE_HOME/root.sh script on Unix / Linux after the Oracle installation. You can run the script again as root user, if you see more files have wrong permissions or ownership (make backup before, just in case). For that I provide as an example 2 lists of oracle binary files in $ORACLE_HOME/bin directory with correct rights below.
ls -ltr oracle
-rwxr-xr-x 1 oracle oinstall 136803483 Mar 16 20:32 oracle
chmod 6751 oracle
ls -ltr oracle
-rwsr-s--x 1 oracle oinstall 136803483 Mar 16 20:32 oracle