ORA-12560: TNS: 协议适配器错误

系统管理员 2022-08-02 04:41 310阅读 0赞

在用命令行登录oracle时, 报出了”ORA-12560: TNS: 协议适配器错误”错误消息

  1. C:\Users\pansanday>sqlplus / as sysdba
  2. SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 7 7 23:03:40 2015
  3. Copyright (c) 1982, 2005, Oracle. All rights reserved.
  4. ERROR:
  5. ORA-12560: TNS: 协议适配器错误
  6. 请输入用户名: sys as sysdba
  7. 输入口令:
  8. ERROR:
  9. ORA-12560: TNS: 协议适配器错误
  10. 请输入用户名: scott
  11. 输入口令:
  12. ERROR:
  13. ORA-12560: TNS: 协议适配器错误
  14. SP2-0157: 3 次尝试之后无法连接到 ORACLE, 退出 SQL*Plus

在服务中检查了一下服务, OracleServiceORCL, OracleOraDb10g_home1TNSListener, OracleOraDb10g_home1iSQL*Plus三个服务都启动正常

在网上搜索了一下, 意识到可能是因为系统中有多个实例(SID), 在登录时, oracle无法判断是登录的哪一个实例(或者是因为其他几个实例都没有启动), 从而导致了这个问题

解决方案:

在登录前, 设置一下要登录的实例: set oracle_sid=ORCL

  1. D:\Program Files\PowerCmd>set oracle_sid=ORCL
  2. D:\Program Files\PowerCmd>sqlplus / as sysdba
  3. SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 7 7 23:15:21 2015
  4. Copyright (c) 1982, 2005, Oracle. All rights reserved.
  5. Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
  6. With the Partitioning, OLAP and Data Mining options
  7. SQL> select * from dual;
  8. D
  9. -
  10. X

至此, 问题得到解决.

发表评论

表情:
评论列表 (有 0 条评论,310人围观)

还没有评论,来说两句吧...

相关阅读