協議適配器錯誤(ORA-12560: TNS:protocol adapter error)

Environment(環境)〗

   OSWINDOWS XP

   DBORACLE 10.2

Symptom(現象) 

啓動sqlplus,然後登陸數據庫,出現錯誤,具體信息如下:

C:/Documents and Settings/netshong>sqlplus

SQL*Plus: Release10.2.0.1.0 - Production on星期一724 13:46:02 2006

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

請輸入用戶名: sys as SYSDBA

輸入口令:

ERROR:

ORA-12560: TNS:協議適配器錯誤

Cause(原因)〗

   這是由於環境變量ORACLE_SID沒有設置或者設置錯誤所造成的。在啓動sqlplus以前,我們在DOS窗口的命令行執行了這樣的命令:set Oracle_sid=BBC。這個命令設置的SIDBBC)不存在,所以造成了ORA-12560錯誤。

Action(方法) 

n        方法一:設置正確的ORACLE_SID,然後登錄數據庫。

Step01設置ORACLE_SID

C:/> set ORACLE_SID=wm

wm是實例(instance)的名字。

Step02登錄數據庫。

C:/Documents and Settings/netshong>sqlplus

SQL*Plus: Release10.2.0.1.0 - Production on Sun Nov 19 06:23:52 2006

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

Enter user-name: sys as SYSDBA

Enter password:

Connected to:

Oracle Database10gEnterpriseEdition Release10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL>

成功登陸數據庫。

n        方法二:連接數據庫時,使用網絡服務名(Net Service Name)

C:/Documents and Settings/netshong>sqlplus

SQL*Plus: Release10.2.0.1.0 - Production on Mon Sep 4 09:37:15 2006

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

Enter user-name: sys@wm as SYSDBA

Enter password:

Connected to:

Oracle Database10gEnterpriseEdition Release10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL>

這裏使用網絡服務名(Net Service Name)wm連接數據庫,網絡服務名(Net Service Name)wm是在ORACLE網絡中進行配置的。

轉載自:http://lvming1000.blog.163.com/blog/static/1168600200910711633810/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章