ORA-12560: TNS: 协议适配器错误的解决方法

ORA-12560: TNS: 协议适配器错误的解决方法

【转】http://hi.baidu.com/fox0623/blog/item/8b6fc903ce322881d53f7c77.html

 

造成ORA-12560: TNS: 协议适配器错误的问题的原因有个:

1.监听服务没有起起来。windows平台个一如下操作:开始---程序---管理工具---服务,打开服务面板,启动oraclehome92TNSlistener服务。

2.database instance没有起起来。windows平台如下操作:开始---程序---管理工具---服务,打开服务面板,启动oracleserviceXXXX,XXXX就是你的database SID.

3.注册表问题。regedit,然后进入HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/HOME0将该环境变量ORACLE_SID设置为XXXX,XXXX就是你的database SID.或者右几我的电脑,属性--高级--环境变量---系统变量--新建,变量名=oracle_sid,变量值=XXXX,XXXX就是你的database SID.或者进入sqlplus前,在command line下输set oracle_sid=XXXX,XXXX就是你的database SID.

经过以上步骤,就可以解决问题。

=======================================
TNS: 协议适配器错误的问题的原因有三个:
1.监听服务没有起起来。windows平台个一如下操作:开始---程序---管理工具---服务,打开服务面板
,启动oraclehome92TNSlistener服务。
2.database instance没有起起来。windows平台如下操作:开始---程序---管理工具
---服务,打开服务面板,启动oracleserviceXXXX,XXXX就是你的database SID.
3.注册表问题。regedit,然后进入HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/HOME0将该
环境变量ORACLE_SID设置为XXXX,XXXX就是你的database SID.或者右几我的电脑,属性--高级--环境变量---系统变量--新建,变量名=oracle_sid,变量值=XXXX,XXXX就是你的database SID.或者进入sqlplus前,在command line下输set oracle_sid=XXXX,XXXX就是你的database SID.
经过以上步骤,就可以解决问题

1、ORA-12541:TNS:没有监听器
  原因:没有启动监听器或者监听器损坏。如果是前者,使用命令net start
OracleOraHome81TNSListener(名字可能有出入)即可;如果是后者,则使用“Net8 Configuration

Assistant”工具向导之“监听程序配置”增加一个监听器即可(基本不用写任何信息,一路OK。在添加之前可能需要把所有的监听器先删除!)
2、ORA-12500:TNS:监听程序无法启动专用服务器进程或ORA-12560:TNS:协议适
配器错误
  原因:ORACLE的数据库服务没有启动。使用命令net start ORACLESERVICEORADB
(ORADB为数据库名字)即可。如果仍没有解决,请继续向下看。

3、如果数据库服务启动失败,则很有可能是其注册表项值损坏,最好的做法是以下两步:
  1)ORADIM -DELETE -SID oradb 删除数据库服务项
  2)ORADIM -NEW -SID oradb 新增数据库服务项
  注:这个过程中如果出错,就重启计算机!
4、ORA-12154:TNS:能解析服务名
  原因:ORACLE的网络服务名没有正确配置。请使用“Net8 Configuration
Assistant”工具向导之“本地网络服务名配置”配置TNS即可。如果仍没有解决,请继续向下看。
5、ORA-1034 :TNS:ORACLE不可用
  原因:ORACLE的数据库服务正确启动,但是数据库没有打开!
  使用命令:
  1)svrmgrl 启动服务管理器
  2)connect internal 以internal身份登陆
  3)startup 打开数据库
6、ORA-12560:TNS:协议适配器错误(顽固性的)
  原因:未知。
  解决:必杀技--打开“Windows任务管理器”,杀死ORACLE.exe及ORADIM.exe进
程,书写自己的

ora_startup.bat,执行之!
PS:
1、我的ora_startup.bat:
net start OracleOraHome81TNSListener
net start ORACLESERVICEORADB
svrmgrl 一般情况下不用,不过有时少不了它的,具体步骤见第5步。
2、我的ora_shutdown.bat:
net stop OracleOraHome81TNSListener
net stop ORACLESERVICEORADB

  ORACLE_HOME=/u01/app/oracle/product/8.1.6
  export ORACLE_HOME/ 包括Oracle软件的目录 /
  LD_LIBRARY_PATH=/u01/app/oracle/product/8.1.6/lib;
  export LD_LIBRARY_PATH
  ORACLE_BASE=/u01/app/oracle
  export ORACLE_BASE/ 包括Oracle软件的目录和管理软件的目录 /
  ORACLE_SID=ORCL
  export ORACLE_SID/ 缺省数据库的标识 /
  ORACLE_TERM=vt100
   export ORACLE_TERM
  ORA_NLS33=/u01/app/oracle/product/8.1.6/
  ocommon/nls/admin/data
  export ORA_NLS33 / 语言支持 /
  PATH=$PATH: /u01/app/oracle/product/8.1.6/bin
  export PATH

 


=============================================
ORA-12560 STARTING LISTENER ON NT - TROUBLESHOOTING
---------------------------------------------------

ORA-12560: TNS Protocol adapter error
Cause: A generic protocol adapter error occurred.
Action: Check addresses used for proper protocol specification. Before reporting this error, look at the error stack and check for lower level transport errors.For further details, turn on tracing and reexecute the operation. Turn off tracing when the operation is complete.

This is a high level error just reporting an error occurred in the actual transport layer. Look at the next error down the stack and process that.


1.- Starting Listener with TCP/IP Protocol
   
    Problem:
    You start the TNS Listener from command line and the TCP/IP address fails with a TNS-12560.

    Solution:
    Check if Microsoft Winsock Proxy(WSP) Client is enabled on the Windows NT Server, if that is the case then go to windows Control
Panel, click WSP icon and select the disable Proxy Client option.

    Explanation:
    The Winsock application may fail to bind to a specific port on a Proxy Server computer when the Winsock is running Proxy Client.

2.- TNS-12560 TNS-512 Starting the listener.

    Problem:
    You try to start up the listener and receive the following error stack:
    TNS-12542: TNS:address already in use
     TNS-12560: TNS Protocol adapter error
      TNS-00512: Address already in use
       32-bit Windows Error: 48: Unknown error

    Error: TNS 512
    Text:   Address already in use
    --------------------------------------------
    Cause: Specified listener address is already being used.
    Action: Start your listener with an unused address.

    Generally this problem may ocurr for a incorrect setting in the listener.ora. Some causes of this problems may be:
   
    a.- Some defined address in the listeners.ora is been used. Make sure other listeners are not running. Either listener.log and screen
output appear the address with problem.
       
    b.- Just for 8i: in windows NT the algorithm to acquire
        the address has change, please check the Note 69026.1: Oracle 8i and socket LISTEN operations.

   Explanation:
   The listener will try to acquire the address in exclusive mode, if this
is been used then the process to get it will fail.
   
3.- Starting the listener the errors ORA-12203,ORA-12560, NL-462 or NL-427 may be raised.

    Problem:
    You try to start up the listener and receive the following errors
    ORA-12203,ORA-12560, NL-462 or NL-427.

    Solution:
    Recreate the listener.ora file.

    Explanation:
    Some corruption in the listener.ora may get unable to the tnslsnr to work adequatly.


4.- Failed to start service, TNS-12560, TNS-00530 when create new listener services

    Problem:
    To recreate Oracle TNS listener service on Windows NT, you delete the service entry in registry. When using lsnrctl to start the listener, you get the following errors:

    LSNRCTL> start
    Starting tnslsnr: please wait...

    Failed to start service, error 3.

    TNS-00530: Protocol adapter error

    The Listener service is not recreated and the Listener would not start.
    You are using a valid listener.ora file and protocol adapters.


    Solution:
    After you delete the Listener service from registry, you have to reboot
NT for it to take effect. Then you can use lsnrctl to start the Listener, which would re-create the listener service.


    Explanation:
    The Listener service is marked 'disabled', but it still exists after
you delete the service from registry.

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
TNS-12541: TNS: 无监听程序 TNS-12560: TNS: 协议适配器错误 TNS-00511: 无监听程序 文章转自:http://www.luocs.com/archives/464.html 此文版权归作者 – yaogang所有,转载请注明yaogang©www.luocs.com。 Luocs说:这是我一个朋友的一个监听器问题解决案例,这是昨天发生的事情,我一直跟朋友一起Troubleshooting,折腾了半天最后是BUG所致。再次汗颜,Windows平台惹不起啊!好,那么下面开始分享我朋友的案例! 环境描述: OS : Windows Server 2008 64Bit (做了HA) DB : 11.1.0.7.0 排错过程: 前天应用不能访问数据库了 (后台应用能访问数据库),故障发生。 马上登录到服务器里查看监听状态,发现有TNS-12541 ,TNS-12560错误 Luocs补充:我跟朋友要了错误代码,但他没有保存,就直接贴图。 从计算器的管理 –> 服务选项 –> 检查oracle 监听服务程序,发现该服务已经停止。 手动把监听服务启动,这时候服务状态上显示为已启动,但在CMD窗口执行lsnrctl status的时候依然返回错误信息: C:\>lsnrctl status LSNRCTL for 64-bit Windows: Version 11.1.0.7.0 - Production on 12-11月-2012 18:1 8:32 Copyright (c) 1991, 2008, Oracle. All rights reserved. 正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.203.218)(PORT=1521))) TNS-12541: TNS: 无监听程序 TNS-12560: TNS: 协议适配器错误 TNS-00511: 无监听程序 64-bit Windows Error: 61: Unknown error 正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) 过段时间回显非常慢。 然后我检查了下告警日志,大量的ora错误 Fatal NI connect error 12170. VERSION INFORMATION: TNS for 64-bit Windows: Version 11.1.0.7.0 - Production Oracle Bequeath NT Protocol Adapter for 64-bit Windows: Version 11.1.0.7.0 - Production Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 11.1.0.7.0 - Production Time: 12-11月-2012 15:23:33 Tracing not turned on. Tns error struct: ns main err code: 12535 TNS-12535: TNS: 操作超时 ns secondary err code: 12560 nt main err code: 0 nt secondary err code: 0 nt OS err code: 0 Client address: ORA-609 : opiodr aborting process unknown ospid (4116_6104) 这时候朋友怀疑是不是监听器配置问题,就把原先的监听器删除重建了下,问题依然。 网上有个解决TNS-12535错误的案例,平台和版本都很类似,如下: 1、在 sqlnet.ora文件中 增加如下行: DIAG_ADR_ENABLED = OFF 2、在listener.ora文件中增加如下行: DIAG_ADR_ENABLED_ = OFF 如何监听是listener时,则前面的名称为:DIAG_ADR_ENABLED_LISTENER = OFF 3、重新启动windows服务管理中的监听程序.先停止,然后再重新启动. 4、检查结果.发现可以了,返回的值在10毫秒.有时为0毫秒.成功!! 但这并不是问题发生原因,在继续排查过程中偶然发现监听日志大小居然为4G。然后把这现象告诉了Luocs。 过了一会儿,Luocs回应是

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值