ITPub博客

首页 > 数据库 > Oracle > 连接数据库提示ora-12547

连接数据库提示ora-12547

Oracle 作者:gycixput 时间:2014-06-25 11:01:17 0 删除 编辑

In this Document

Symptoms
Cause
Solution
References

APPLIES TO:

Oracle Net Services - Version 10.1.0.2 to 11.2.0.4 [Release 10.1 to 11.2]
HP-UX PA-RISC (64-bit)
Linux x86-64
Linux x86
Oracle Solaris on x86 (32-bit)

SYMPTOMS

- Not able to make a local connection.
- Getting the following error when trying to connect using Sql*Plus

ERROR:
----------------
ORA-12547: TNS:lost contact

For example:

$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

CAUSE

This could be due to

  1. to kernel parameters settings
  2. Incorrect permissions on the ORACLE executable
  3. Insufficient ulimit setting for stack
  4. $ORACLE_HOME/rdbms/lib/config.o is 0 bytes
  5. Oracle binaries have not been linked correctly
  6. A missing $ORACLE_HOME/dbs directory
    Note that creating an empty dbs directory already solves this error and you can for instance shutdown the instance. However, you will obviously not be able to restart because of the missing parameter file. So, the dbs directory needs to be fully restored.

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
Note 169706.1 Oracle Database on AIX,HP-UX,Linux,MacOSX,Solaris,Tru64

2.  This could be due to incorrect permissions on the ORACLE.exe

Optionally, if you collect the OS trace with:

$strace -f -o /tmp/trace.1.log $ORACLE_HOME/bin/sqlplus / as sysdba


You may see some (Permission denied) in the trace.1.log like the following:

21810 open("/oracle/PROD/db/tech_st/11.1.0/admin/PROD_erptest/diag/rdbms/prod/PROD/alert/log.xml", O_WRONLY|O_CREAT|O_APPEND, 0664) = -1 EACCES (Permission denied)
......

21810 open("/oracle/PROD/db/tech_st/11.1.0/admin/PROD_erptest/diag/rdbms/prod/PROD/trace/alert_PROD.log", O_WRONLY|O_CREAT|O_APPEND, 0664) = -1 EACCES (Permission denied)


The 'ls' command should show permissions 6751 (as follows)

Please check permissions by running:

$ cd $ORACLE_HOME/bin
$ ls -l oracle


The output should show the correct permission which is:

-rwsr-s--x 1 oracle dba


If not, then please execute the following to correct the permissions:

$ cd $ORACLE_HOME/bin
$ chmod 6751 oracle
$ ls -l oracle


Please also verify if the following are correct:

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

3. Check the current ulimit setting for stack

ulimit -a

Check the install guide for your specific platform and version of Oracle and set the stack appropriately.

4.  Check to ensure the following two files are not 0 bytes:

$ORACLE_HOME/bin/oracle
$ORACLE_HOME/rdbms/lib/config.o


If yes, rename the following file:

% cd $ORACLE_HOME/rdbms/lib
% mv config.o config.o.bad


Then, relink the oracle binary:

% relink oracle


5. If the above does not resolve I suggest that you shutdown the database and listener and then
"relink all"
Note 131321.1 How to Relink Oracle Database Software on UNIX

422173.1

REFERENCES

NOTE:555565.1 - Troubleshooting ORA-12547 TNS: Lost Contact
NOTE:131321.1 - How to Relink Oracle Database Software on UNIX
NOTE:169706.1 - Oracle Database (RDBMS) on Unix AIX,HP-UX,Linux,Mac OS X,Solaris,Tru64 Unix Operating Systems Installation and Configuration Requirements Quick Reference (8.0.5 to 11.2)
NOTE:188149.1 - How to Display and Change UNIX Process Resource Limits

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24585765/viewspace-1193194/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-11-05

  • 博文量
    69
  • 访问量
    212867