標籤:tns-12547
使用複製安裝oracle 11g 以後,然後使用cadb建庫報錯:ORA-12547: TNS:lost contact
對於這麼一個不明顯的錯誤,實在很難定位確認問題,網上給了很多建議:
1、缺包,libiao、ksh等
2、設定檔錯誤
3、環境變數不對
4、Oracle目錄許可權不對
5、$ORACLE_HOME/bin/oracle檔案許可權或檔案大小不對
針對以上問題做了比較認真的檢查,都沒有發現問題所在。
同時使用strace對執行sqlplus / as sysdba進行了跟蹤,沒有發現明顯異常。
#strace -f -o /tmp/trace.1.log $ORACLE_HOME/bin/sqlplus / as sysdba
最後把設定檔如/etc/security/limits.conf、/etc/sysctl.conf刪除,並從新配置問題解決。
最後對所有的設定檔進行了對比。
發下原有設定檔/etc/security/limits.conf內容如下:
* soft nofile 65534* hard nofile 65534* soft stack 1024* hard stack 1024* soft nproc 65534* hard nproc 65534oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240oracle soft memlock unlimitedoracle hard memlock unlimited
原來安裝指令碼在修改設定檔的時候是追加的形式,對於原有的*開頭的設定檔不會先刪除,導致如下這一行配置沒有生效
* soft stack 1024 #生效oracle soft stack 10240 #不生效
在使用strace sqlplus / as sysdba跟蹤的時候,發現在開啟一個1.1M的檔案之後拋出異常ORA-12547,原來問題就出在設定檔這裡。
總結:
有時候,因為一些意外的原因,導致我們修改的設定檔並沒有生效,所以我們可以加一個驗證環節,針對這個問題,我們可以使用ulimit -a檢查各個各資源限制情況是否OK。
參考:
https://oracledbamasters.wordpress.com/2014/02/25/ora-12547-tns-lost-contact/
ERROR:
$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:
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
附:詳細報錯日誌
Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 2%
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 4%
DBCA_PROGRESS : 37%
Creating and starting Oracle instance
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 38%
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 40%
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 45%
DBCA_PROGRESS : 50%
DBCA_PROGRESS : 51%
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 56%
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 57%
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 61%
DBCA_PROGRESS : 62%
Completing Database Creation
DBCA_PROGRESS : 66%
DBCA_PROGRESS : 70%
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 73%
DBCA_PROGRESS : 74%
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 85%
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 86%
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact
ORA-12547: TNS:lost contact
DBCA_PROGRESS : 98%
DBCA_PROGRESS : 100%
本文出自 “composer” 部落格,請務必保留此出處http://zuoqujia.blog.51cto.com/9151800/1657148
Oracle 靜默安裝cadb錯誤 TNS-12547: TNS:lost contact