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

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


场景

数据库---Oracle 12c;系统---Linux CentOS 7;PLSQL放在windows7下,是一个免安装版的;因之前能连接上服务器A上的数据库,现在有需求连接到服务器B上的数据库,所以直接把tnsnames.ora文件里的信息修改一下。

解决
(1)第一怀疑监听器没有启动,把监听器重启一下
停止:$ lsnrctl stop
启动:$ lsnrctl start
查看状态:$ lsnrctl stat
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 24-JUL-2017 17:22:13

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=CO12)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                24-JUL-2017 16:39:06
Uptime                    0 days 0 hr. 43 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1/db1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/CO12/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=CO12)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl12c.us.oracle.com" has 1 instance(s).
  Instance "orcl12c", status READY, has 1 handler(s) for this service...
Service "orcl12cXDB.us.oracle.com" has 1 instance(s).
  Instance "orcl12c", status READY, has 1 handler(s) for this service...
The command completed successfully

重启后仍然连接不上;

(2)windows机器访问服务器的端口是否通
cmd --- telnet IP 1521
检查后是通的;

(3)查看tnsnames.ora文件
orcl12c =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.100 )(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME =orcl12c.us.oracle.com)
    )
  )

SERVICE_NAME = orcl12c这个是原来写的,因为上一个能连上的就是直接写实例名,但这个服务器的连接不上;刚刚查看监听的时候
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=CO12)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl12c.us.oracle.com" has 1 instance(s).
然后尝试把SERVICE_NAME换成orcl12c.us.oracle.com,再次使用客户端连接,连接上了。


你可能感兴趣的:(Oracle报错)