日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle11g ora 12545,sqlplus本地登录报错ORA-12545

發(fā)布時(shí)間:2025/3/15 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle11g ora 12545,sqlplus本地登录报错ORA-12545 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

在客戶服務(wù)器上嘗試登錄數(shù)據(jù)庫是碰到錯(cuò)誤。

步驟如下:

> 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.

嘗試連接本地的數(shù)據(jù)庫,結(jié)果出現(xiàn)了ORA-12545錯(cuò)誤,嘗試通過網(wǎng)絡(luò)方式連接,反而沒有碰到問題。這說明數(shù)據(jù)庫本身是正常的,而本地?zé)o法連接,顯示是本地設(shè)置出現(xiàn)了問題。

檢查了環(huán)境變量的設(shè)置,包括ORACLE_SID、ORACLE_HOME和PATH,都未發(fā)現(xiàn)任何異常,再次嘗試連接數(shù)據(jù)庫:

> 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

這次同樣連接到數(shù)據(jù)庫,但是由于連接方式和第一次的不同,通過Oracle提示的信息找到了錯(cuò)誤的原因。

首先嘗試的簡易連接方式是10g的新特性,而且從sqlplus的工具版本信息也可以看得出,sqlplus是10.2.0.1版本的。而連接到數(shù)據(jù)庫后顯示的數(shù)據(jù)庫服務(wù)器版本信息卻是9.2.0.4。

顯然當(dāng)前是通過一個(gè)10.2的sqlplus客戶端,連接到9.2的數(shù)據(jù)庫。那么無論ORACLE_HOME還是PATH都是指向10.2的客戶端的,這就是為什么出現(xiàn)ORA-12545錯(cuò)誤的原因:

[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>

定位問題的原因,解決就很簡單了,設(shè)置ORACLE_HOME和PATH到9.2對應(yīng)的目錄后,在本地sqlplus成功連接數(shù)據(jù)庫。

總結(jié)

以上是生活随笔為你收集整理的oracle11g ora 12545,sqlplus本地登录报错ORA-12545的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。