最近装了Oracle 10g,当我用pl/sql去连接的时候,经常报listener does not currently know of service requested in connect descriptor错误,有时候是好的,有时候会有错误。当发生错误的时候我重启了oracle服务和oracle监听,还是没用,重启一下电脑或许会好,或许不会好;有时候现在不行,过会去连接有可以了;有时候现在时好的,当我重启电脑后,又不行了。我真的搞不懂这是怎么回事,有些人说重启下监听和服务就可以了,但是我的怎么却不行呢?出现这样的情况我觉得跟tnsnames.ora和listener.ora应该没关系吧,因为有时候是可以的,但是我还是贴出来让各位大虾看看,希望能够帮偶解决下
tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = F:\oracle\product\10.1.0\Db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
)
------解决方案--------------------
ORA-12514: TNS:监听程序当前无法识别连接描述符中请求的服务
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Cause:
The listener received a request to establish a connection to a database or other service. The connect descriptor received by the listener specified a service name for a service (usually a database service) that either has not yet dynamically registered with the listener or has not been statically configured for the listener. This may be a temporary condition such as after the listener has started, but before the database instance has registered with the listener.
Action:
- Wait a moment and try to connect a second time.
- Check which services are currently known by the listener by executing: lsnrctl services <listener name>
- Check that the SERVICE_NAME parameter in the connect descriptor of the net service name used specifies a service known by the listener.
- If an easy connect naming connect identifier was used, check that the service name specified is a service known by the listener.
- Check for an event in the listener.log file.
------解决方案--------------------
顶下..........
------解决方案--------------------
对比下面的配置,添加一项估计就可以了。
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /usr/u01/app/oracle/product/10.2.0.1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /usr/u01/app/oracle/product/10.2.0.1)
)
)
------解决方案--------------------
service_name是否正确?
把server上的参数列出来
------解决方案--------------------
用netca重新建下监听,
排除环境变量导致找不到tnsnames.ora的原因。
修改下listener.ora
标准的Listener.ora格式如下
[oracle@xtxgk1 admin]$ more listener.ora
# LISTENER.ORA Network Configuration File: /oracle/9.2.0/network/admin/listener.
ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = xtxgk)
(ORACLE_HOME = /oracle/product/10.2.0/db_1)