Oracle问题之ORA-12560TNS:协议适配器错误

Oracle问题之ORA-12560TNS:协议适配器错误

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

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

  启动OracleOraDb11g_home1TNSlistener服务。
  
  



2.database instance没有起起来。windows平台如下操作:开始---程序---管理工具---服务,打开服务

  面板,启动OracleServiceBOOKSALES, BOOKSALES就是你的database SID    
  



 3.注册表问题。regedit,然后进入HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME

  将该环境变量ORACLE_SID设置为XXXX, XXXX就是你的database SID.
  
  



  



  



  



  或者右击我的电脑,属性--高级--环境变量---系统变量--新建,变量名=oracle_sid,变量值=XXXX, XXXX就是你的database SID.

  或者进入sqlplus前,在command line下输 set oracle_sid=XXXX, XXXX就是你的database SID.

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

二、如果还没有解决的话则会遇到以下问题:

1、执行请求的操作时遇到错误:

 

IO 错误: The Network Adapter could not establish the connection

 

供应商代码 17002

 

2、执行请求的操作时遇到错误:

 

Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

 

供应商代码 12514


三、解决方法如下:

  假如只有一个数据库的话:

  1、找到如下路径:

    D:\install\oracle\oracle-install\product\11.2.0\dbhome_1\NETWORK\ADMIN

    



  2、将文件中的内容修改如下,当然要结合自己的实际情况做简单修改:
     //listener.ora
复制代码
# listener.ora Network Configuration File: D:\install\oracle\oracle-install\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\install\oracle\oracle-install\product<span style=“color: #800080;”>11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = “EXTPROC_DLLS=ONLY:D:\install\oracle\oracle-install\product\11.2.0\dbhome_1\bin\oraclr11.dll”)
)
(SID_DESC =
(SID_NAME = BOOKSALES)
(ORACLE_HOME = D:\install\oracle\oracle-install\product<span style=“color: #800080;”>11.2.0\dbhome_1)
(GLOBAL_DBNAME = BOOKSALES)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = acer)(PORT = 1521))
)
)

ADR_BASE_LISTENER = D:\install\oracle\oracle-install

复制代码

 

     //sqlnet.ora    

复制代码
# sqlnet.ora Network Configuration File: D:\install\oracle\oracle-install\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

This file is actually generated by netca. But if customers choose to

install “Software Only”, this file wont exist and without the native

authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

复制代码

 

     //tnsnames.ora

复制代码
# tnsnames.ora Network Configuration File: D:\install\oracle\oracle-install\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

BOOKSALES =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = BOOKSALES)
)
)

复制代码

 

 

   3、重新启动 tnslistener

   4、测试的时候要注意修改对应数据库的用户名和密码

    Oracle SQL Developer连接的时候也要注意用对应的用户名和密码

    

    

    

 

 

 

 

 

 

 

 

执行请求的操作时遇到错误:

IO 错误: The Network Adapter could not establish the connection

供应商代码 17002

 

 

执行请求的操作时遇到错误:

Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor

供应商代码 12514

 

也是按照上面修改配置文件

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值