ON: Oracle 11.2.0.4.0 ,Single Instance,Windows 2008 64bit,
新搭建的数据库环境,通过TNS连接数据库时报:ORA-12514 TNS:监听程序当前无法识别连接描述符中请求的服务。
看错误应该是与监听程序有关,可能实例未能自动注册到监听程序中去。检查监听状态,该服务器采用了默认监听程序LISTENER
C:\Users\Administrator>lsnrctl status
LSNRCTL for 64-bit Windows: Version 11.2.0.4.0 - Production on 25-5月 -2015 09:2
8:48
Copyright (c) 1991, 2013, Oracle. All rights reserved.
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=WIN-NOG7OAI559N.cae.com)(PO
RT=1521)))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 64-bit Windows: Version 11.2.0.4.0 - Produ
ction
启动日期 25-5月 -2015 09:28:36
正常运行时间 0 天 0 小时 0 分 15 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
监听程序参数文件 d:\app\Administrator\product\11.2.0\dbhome_1\network\a
dmin\listener.ora
监听程序日志文件 d:\app\Administrator\diag\tnslsnr\WIN-NOG7OAI559N\list
ener\alert\log.xml
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=WIN-NOG7OAI559N)(PORT=1521))
)
服务摘要..
服务 "CLRExtProc" 包含 1 个实例。
实例 "CLRExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
确实可以看到监听程序中不包含目标实例名称。
既然自动注册不太稳定、靠谱,我们就将其设置为静态注册,以后不管实例启动与否,实例将永远注册在监听程序中。
修改listener.ora文件:
# listener.ora Network Configuration File: d:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = d:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:d:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC = >>>>>>>>>>>>>>>>>>>>>>增加的新条目
(SID_NAME = EDIDB)
(ORACLE_HOME = d:\app\Administrator\product\11.2.0\dbhome_1)
(GLOBAL_DBNAME = EDIDB)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 156.1.1.61)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = d:\app\Administrator
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">再次重启监听程序:</span>
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">lsnrctl stop</span>
C:\Users\Administrator>lsnrctl status
LSNRCTL for 64-bit Windows: Version 11.2.0.4.0 - Production on 25-5月 -2015 09:3
1:34
Copyright (c) 1991, 2013, Oracle. All rights reserved.
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 64-bit Windows: Version 11.2.0.4.0 - Produ
ction
启动日期 25-5月 -2015 09:31:28
正常运行时间 0 天 0 小时 0 分 10 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
监听程序参数文件 d:\app\Administrator\product\11.2.0\dbhome_1\network\a
dmin\listener.ora
监听程序日志文件 d:\app\Administrator\diag\tnslsnr\WIN-NOG7OAI559N\list
ener\alert\log.xml
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
服务摘要..
服务 "CLRExtProc" 包含 1 个实例。
实例 "CLRExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "EDIDB" 包含 1 个实例。 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>实例EDIDB已经注册到监听程序中,状态为UNKNOWN表示为静态注册。
实例 "EDIDB", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功