ORA-12560: TNS:protocol adapter error(TNS:协议适配器错误)
来源:互联网 发布:php个人简历 编辑:程序博客网 时间:2024/05/22 16:53
这种问题一般是因为客户端不知道要连那个instance或者不知道要使用哪个TNS Alias
可能的原因1.服务没有起来
下边是Tom的一个Test Case来说明OracleServiceSID服务没有起来的话,是会引起ORA-12560错误的。
C:\Documents and Settings\tkyte>sqlplus scott/tigerSQL*Plus: Release 10.1.0.4.0 - Production on Thu Sep 6 15:43:55 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsscott%ORA10GR1> exitDisconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsC:\Documents and Settings\tkyte>net stop oracleserviceora10gr1The OracleServiceORA10GR1 service is stopping.........The OracleServiceORA10GR1 service was stopped successfully.C:\Documents and Settings\tkyte>sqlplus scott/tigerSQL*Plus: Release 10.1.0.4.0 - Production on Thu Sep 6 15:44:35 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.ERROR:ORA-12560: TNS:protocol adapter errorEnter user-name:ERROR:ORA-12560: TNS:protocol adapter errorEnter user-name:ERROR:ORA-12560: TNS:protocol adapter errorSP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*PlusC:\Documents and Settings\tkyte>net start oracleserviceora10gr1The OracleServiceORA10GR1 service is starting..........The OracleServiceORA10GR1 service was started successfully.C:\Documents and Settings\tkyte>sqlplus scott/tigerSQL*Plus: Release 10.1.0.4.0 - Production on Thu Sep 6 15:45:12 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsscott%ORA10GR1>
修改方法:控制面板>管理工具>服务里边把OracleServiceSID起起来
可能的原因2.ORACLE_SID环境变量没有指定(最常见引起ORA-12560问题的原因)
检查方法,命令行(cmd)下,
C:\Documents and Settings\ptian>set oracle_sid
ORACLE_SID=test
ORACLE_SID=test
ORACLE_SID是sqlplus默认连接的数据库instance,即sqlplus user/pwd连接的instance,如果不指定sqlplus里连接的时候就需要明确@你的instance,eg,sqlplus user/pwd@instance.
修改方法:在注册表中,HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb10g_home1\ORACLE_SID 需指向你的Instance(eg.orcl);或者在系统的环境变量里加ORACLE_SID项,值为Instance的SID。
可能的原因3.TNS_ADMIN环境变量没有指定
检查方法,命令行(cmd)下,
C:\Documents and Settings\ptian>set TNS_ADMIN
TNS_ADMIN=D:\oracle\product\10.1.0\Db_1\NETWORK\ADMIN
TNS_ADMIN=D:\oracle\product\10.1.0\Db_1\NETWORK\ADMIN
TNS_ADMIN应该返回你的tnsnames.ora所在的目录
修改方法:可以在注册表HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0\TNS_ADMIN或者环境变量中指定。
可能的原因4.ORACLE_HOME环境变量没有指定
和上边的方法类似,检查Oracle_Home环境变量
可能的原因5.tnsnames.ora文件内容不对
A sample:
TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ptian-cn.cn.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
)
)
Possible fixes for the TNS-12560 include:
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ptian-cn.cn.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
)
)
Possible fixes for the TNS-12560 include:
转载请注明出处:http://blog.csdn.net/pan_tian/article/details/7699469
======EOF======
- ORA-12560: TNS: TNS:protocol adapter error 协议适配器错误
- ORA-12560: TNS:protocol adapter error(TNS:协议适配器错误)
- ORA-12560: TNS:protocol adapter error(TNS:协议适配器错误)
- ORA-12560: TNS:protocol adapter error(TNS:协议适配器错误)
- ORA-12560: TNS:protocol adapter error(TNS:协议适配器错误)
- 协议适配器错误(ORA-12560: TNS:protocol adapter error)
- 【转】协议适配器错误(ORA-12560: TNS:protocol adapter error)
- ERROR - ORA-12560: TNS:protocol adapter error?
- ORA-12560: TNS:protocol adapter error
- linux ORA-12560: TNS:protocol adapter error
- ORA-12560 TNS:protocol adapter error
- ORA-12560: TNS:protocol adapter error
- ERROR: ORA-12560: TNS: 协议适配器错误--解决办法
- Oracle ERROR: ORA-12560: TNS: 协议适配器错误
- TNS-12560: TNS:protocol adapter error
- TNS-12560: TNS:protocol adapter error 小记
- TNS-12560: TNS:protocol adapter error
- TNS-12560: TNS:protocol adapter error
- grep命令使用
- 债券逆回购 上海深圳市场 操作指南
- 'undefined reference to `__ctype_tolower' 或 '__ctype_b'
- 快速排序
- APCS,ARM 过程调用标准(ARM)
- ORA-12560: TNS:protocol adapter error(TNS:协议适配器错误)
- replace限制文本框只能输入数字,数字和字母等的正则表达式
- 虚基类
- RMS配置
- objective-C 2.0 动态的调用以NSString表示的方法。
- c++头文件 include保护符
- cookie的使用
- Oracle 实例创建和基础配置指南
- tomcat 7+Apache Solr 3.6 部署