oracle11g ora 12545,sqlplus本地登录报错ORA-12545
在客戶服務器上嘗試登錄數據庫是碰到錯誤。
步驟如下:
> sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production ON Thu Nov 17 17:24:16 2011
Copyright (c) 1982, 2005, Oracle. ALL rights reserved.
SQL> conn / AS sysdba
ERROR:
ORA-12545: CONNECT failed because target host OR object does NOT exist
SQL> conn USER/password
ERROR:
ORA-12545: CONNECT failed because target host OR object does NOT exist
SQL> conn USER/password@100.300.100.200/db
Connected.
> sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 17 17:24:16 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdba
ERROR:
ORA-12545: Connect failed because target host or object does not exist
SQL> conn user/password
ERROR:
ORA-12545: Connect failed because target host or object does not exist
SQL> conn user/password@100.300.100.200/db
Connected.
嘗試連接本地的數據庫,結果出現了ORA-12545錯誤,嘗試通過網絡方式連接,反而沒有碰到問題。這說明數據庫本身是正常的,而本地無法連接,顯示是本地設置出現了問題。
檢查了環境變量的設置,包括ORACLE_SID、ORACLE_HOME和PATH,都未發現任何異常,再次嘗試連接數據庫:
> sqlplus USER/password@100.300.100.200/db
SQL*Plus: Release 10.2.0.1.0 - Production ON Thu Nov 17 17:26:54 2011
Copyright (c) 1982, 2005, Oracle. ALL rights reserved.
Connected TO:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
WITH the Partitioning, OLAP AND Oracle DATA Mining options
JServer Release 9.2.0.4.0 - Production
SQL> exit
Disconnected FROM Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
WITH the Partitioning, OLAP AND Oracle DATA Mining options
JServer Release 9.2.0.4.0 - Production
> sqlplus user/password@100.300.100.200/db
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 17 17:26:54 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
這次同樣連接到數據庫,但是由于連接方式和第一次的不同,通過Oracle提示的信息找到了錯誤的原因。
首先嘗試的簡易連接方式是10g的新特性,而且從sqlplus的工具版本信息也可以看得出,sqlplus是10.2.0.1版本的。而連接到數據庫后顯示的數據庫服務器版本信息卻是9.2.0.4。
顯然當前是通過一個10.2的sqlplus客戶端,連接到9.2的數據庫。那么無論ORACLE_HOME還是PATH都是指向10.2的客戶端的,這就是為什么出現ORA-12545錯誤的原因:
[DEV]dev:/app/oracle/product
> export ORACLE_HOME=/app/oracle/product/920
[DEV]dev:/app/oracle/product
> export PATH=$ORACLE_HOME/bin:$PATH
[DEV]dev:/app/oracle/product
> sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.4.0 - Production ON Thu Nov 17 17:28:41 2011
Copyright (c) 1982, 2002, Oracle Corporation. ALL rights reserved.
Connected TO:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
WITH the Partitioning, OLAP AND Oracle DATA Mining options
JServer Release 9.2.0.4.0 - Production
SQL>
[DEV]dev:/app/oracle/product
> export ORACLE_HOME=/app/oracle/product/920
[DEV]dev:/app/oracle/product
> export PATH=$ORACLE_HOME/bin:$PATH
[DEV]dev:/app/oracle/product
> sqlplus '/ as sysdba'
SQL*Plus: Release 9.2.0.4.0 - Production on Thu Nov 17 17:28:41 2011
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
SQL>
定位問題的原因,解決就很簡單了,設置ORACLE_HOME和PATH到9.2對應的目錄后,在本地sqlplus成功連接數據庫。
總結
以上是生活随笔為你收集整理的oracle11g ora 12545,sqlplus本地登录报错ORA-12545的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle 强制恢复,oracle数据
- 下一篇: oracle 提示i386,新手请教:R