ERROR - ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务

  这几天在公司培训,发现有些同事在新建一个数据库后,会出现监听程序当前无法识别连接描述符中请求的服务这个错误。整了半天,然后在google上面查了一下,原因是 listener.ora中没有指定监听,我们可以在listener.ora文件中指定监听的实例名,这样该问题应该可以连接, 具体解决方案如下。
  找到自己的oracle安装目录下面的 listener.ora文件,一般在D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN下面,原始文件内容可能如下: # listener.ora Network Configuration File: d:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = d:\oracle\product\10.2.0\db_1)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = china-6fe00d4af)(PORT = 1521))
    )
  )
这时我们需要把我们自己的数据库配置到里面去,即修改后的文件内容如下:
# listener.ora Network Configuration File: d:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = d:\oracle\product\10.2.0\db_1)
      (PROGRAM = extproc)
    )
   (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = d:\oracle\product\10.2.0\db_1)
      (PROGRAM = orcl)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = china-6fe00d4af)(PORT = 1521))
    )
  ) 
修改完以上内容后,就重启数据库监听程序,然后重新登录就ok了。

你可能感兴趣的:(oracle,error,职场,ORA-12514,连接,-,休闲)