sqlplus登錄時ORA-12547: TNS:lost contact


有一些應用系統的OS用戶需要與ORACLE用戶具有一樣的權限,可以用sqlpus登錄並操作數據庫。

一般是在安裝ORACLE軟件時與ORACLE用戶一起創建,在創建此類用戶時主要需要注意的目錄及文件的權限。

安裝完成后應用系統用戶執行sqlplus命令時報錯。

[scmadmin@app11 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 28 22:42:57 2020

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

ERROR:
ORA-12547: TNS:lost contact


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

oracle用戶是正常的。

[oracle@app11 bin]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 28 23:19:41 2020

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

Connected to an idle instance.

SQL> 

根據mos上的文檔 Local SQL*Plus Connection and DBCA Fails With: ORA-12547: TNS:Lost Contact (文檔 ID 422173.1)

對sqlplus命令跟蹤

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

在跟蹤文件中發現以下錯誤信息

22232 write(5, "ORA-12753: The Oracle home user "..., 131) = 131
22232 write(5, "\n", 1) = 1
22232 write(5, "ORA-27300: OS system dependent o"..., 91) = 91
22232 write(5, "\n", 1) = 1
22232 write(5, "ORA-27301: OS failure message: E"..., 38) = 38
22232 write(5, "\n", 1) = 1
22232 write(5, "ORA-27302: failure occurred at: "..., 39) = 39
22232 write(5, "\n", 1) = 1
22232 write(5, "ORA-27303: additional informatio"..., 94) = 94

應該是$ORACLE_HOME/bin/oracle權限不對

查看了一下權限是775

[scmadmin@app11 bin]$ ls -l oracle
-rwxrwxr-x 1 oracle dba 407988856 Jul 28 17:16 oracle

執行以下命令修復后,再次執行正常。

cd $ORACLE_HOME/bin
chmod 6751 oracle

 

[scmadmin@app11 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 28 23:29:23 2020

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

Connected to an idle instance.

SQL>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM