今天弄了一上午没弄出来打开sqldeveloper后出现一个错误
Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl后来在网上找了很多说把listener.ora改,我看他那配置不一样,试了,也不管用各位大吓教教我
listener.ora# listener.ora Network Configuration File: C:\app\wang\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )tnsnames.ora# tnsnames.ora Network Configuration File: C:\app\wang\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.102)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
sqlnet.ora
# sqlnet.ora Network Configuration File: C:\app\wang\product\11.1.0\db_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)

解决方案 »

  1.   

    确认你的服务名和示例名都是“orcl”?可以用sqlplus登录进去看一下
      

  2.   

    实例是server_name= orcl 那个 sid_name  不太清楚
      

  3.   

    为什么两个地方的 host 写得不一样呢,Listener 配置在 localhost 时应该会有一个警告。因为 localhost 在不同的机器上解释的结果会有不同,所以会有警告。用 Configuration Assistant 重新配置一下,用 Net Manager 也有测试配置的功能。
      

  4.   

    谢谢,已经弄好了,我用Configuration Assistant 重新配置了实例,一人二十,接分了