【转】协议适配器错误(ORA-12560: TNS:protocol adapter error)

Environment(环境)〗

   OSWINDOWS XP

   DBORACLE 10.2

Symptom(现象) 

启动sqlplus,然后登陆数据库,出现错误,具体信息如下:

C:Documents and Settings etshong>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 etshong>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 etshong>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/

阅读(746) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
原文地址:https://www.cnblogs.com/black/p/5171947.html