日期:2014-05-17  浏览次数:20865 次

oracle监听器问题 菜鸟跪求高手解答
最近在学习用oracle 10g 本地装了个,能连上别人的但自己的登陆不上,报如下错误:listener does not currently know of service requested in connect descriptor

tnsnames.ora如下:
# tnsnames.ora Network Configuration File: C:\oracle\product\10.1.0\Db_4\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
  (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
  )
  (CONNECT_DATA =
  (SID = PLSExtProc)
  (PRESENTATION = RO)
  )
  )

ORCL =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  (CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = orcl)
  )
  )

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 = ORCL 
  (ORACLE_HOME = C:/oracle/product/10.2.0/db_4)
  (PROGRAM = extproc)
  )
  (SID_DESC =
  (GLOBAL_DBNAME = ORCL 
  (ORACLE_HOME = C:/oracle/product/10.2.0/db_4)
  (SID_NAME = ORCL 
  )
  )



------解决方案--------------------
检查数据库服务是否已启动。

另:
你的
# LISTENER.ORA Network Configuration File: /oracle/9.2.0/network/admin/listener.
ora

这个注释路径是9i ?
后面的内容你是复制到listener.ora文件中的吗 ?
检查你的监听是否正常?

oracle@SZDB:~> lsnrctl status cnmmbo

LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 10-SEP-2011 14:39:15

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.7.2)(PORT=1910))(CONNECT_DATA=(SERVICE_NAME=CNMMBO)))
STATUS of the LISTENER
------------------------
Alias listener_CNMMBO
Version TNSLSNR for Linux: Version 10.2.0.3.0 - Production
Start Date 24-AUG-2011 09:16:43
Uptime 17 days 5 hr. 22 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /users/oracle/OraHome10g/network/admin/listener.ora
Listener Log File /users/oracle/OraHome10g/network/log/listener_cnmmbo.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.7.2)(PORT=1910)))
Services Summary...
Service "CNMMBO" has 1 instance(s).
Instance "CNMMBO", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
详细参考:配置ORACLE 客户端连接到数据库