ORA-12514 TNS:监听器当前不知道现有服务的连接描述符中请求的服务

时间:2015-10-09 20:30:46

标签: oracle oracle11g tnsnames

我知道这是一个非常受欢迎的问题,之前我遇到过几次但是能够解决它但不是这次。

我确保通过运行

使用正确的服务名称
SQL> select value from v$parameter where name='service_names';

VALUE
--------------------------------------------------------------------------------
XE

我的tnsnames.ora有XE服务名称:

XE =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
     (CONNECT_DATA =
       (SERVER = DEDICATED)
       (SERVICE_NAME = XE)
     )
   )

当我启动监听器时,它似乎识别出该服务:     [root @aa-axm admin] #lsnrctl start

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 09-OCT-2015 12:58:28

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

Starting /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.2.0 - Production
System parameter file is   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/11.2.0/xe/log/diag/tnslsnr/aa-axm/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE))  (SERVICE_NAME=XE))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))(SERVICE_NAME=XE))

Connecting to (DESCRIPTION=(SERVICE_NAME=XE)(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                09-OCT-2015 12:58:28
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/11.2.0/xe/log/diag/tnslsnr/aa-axm/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE))(SERVICE_NAME=XE))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))(SERVICE_NAME=XE))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

然而,我仍然得到了那个爆炸的错误

[root@aa-axm admin]# sqlplus SYSTEM/**********@XE

SQL*Plus: Release 11.2.0.2.0 Production on Fri Oct 9 12:58:36 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

我错过了什么? TIA

1 个答案:

答案 0 :(得分:2)

我最终解决了这个问题

alter system set local_listener='XE' scope=both;
alter system register;

感谢Alex Poole让我走上了正确的道路。