服务器: winXP/Open Suse 
 数据库: Oracle10g,  ,本机连接。   
    
 ORA-12514: TNS:listener does not currently know of service requested in connect 又遇到了ora-12514: TNS: 监听程序无法识别连接描述符中请求的服务
    
  尝试了一下办法解决:   
  1.打开tnsnames.ora文件。发现文件并没有破坏。listener.ora文件也核对过多次,都无问题。   
    
  2.在windows服务里停止oracle的一切服务,然后重新启动,问题依然存在   
    
  3.监听器、Net服务名等都多次重新配置,测试连接都可以成功。   
    
  4.IP、主机名都试了,都不行   
    
  真的不知道是啥问题了。
  已经研究了2、3天,实在没辙了,高手指点一下吧,感激万分!  
  故在此,希望大家提供出现ORA-12514的一切可能原因和解决方法!  分不够的话,我再开一帖!

解决方案 »

  1.   

    listener.ora、tnsnames.ora两个文件的配置我就没贴出来了!
     这里只是希望大家提供:出现ORA-12514的一切可能原因和解决方法!
      

  2.   

    你先在cmd命令中lsnrctl stat看一下监听是否启动;
    如果启动了,在cmd中set oracle_sid=serversid后看看能否登陆。
      

  3.   

    正确启动监听的前提下,
    检查tnsnames设置,并使用相应的连接字符串格式。
      

  4.   

    可首先使用/本机格式登陆测试,排除是否连接串与tnsnames相关设置问题。
      

  5.   

    重启一下你的服务,等个5分钟左右,若登录仍然有该提示,那你就要考虑你的用户角色了。
    如果是你新建的用户,即使你 grant "DBA" to user 了,仍然要用 normal 角色登录。
      

  6.   

    尝试在listener.ora文件中替换成如下配置:
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = D:\oracle\product)
          (PROGRAM = extproc)
        )
        (SID_DESC =       (GLOBAL_DBNAME = ORACLE)   ----实例名      (ORACLE_HOME =  D:\oracle\product)  —oracle安装目录         (SID_NAME = ORACLE) )
    )
    然后重启oracle的tnslistener服务。
      

  7.   

    从错误信息上分析,可能是连接使用的 orcl_sid 与在侦听器上注册的不一致。运行 lsnrctl status 检查一下侦听器上注册的 orcl_sid,
    通过此 orcl_sid 直接使用 sqlplus system/password@servername:1521/orcl_sid 连接一下,看看是否成功。
      

  8.   

    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.官方给出的关于ORA-12514的错误原因以及解决办法。原因简单来说可能有以下几种:
    一、连接描述符给出的服务尚未在监听器中进行动态注册。
    二、可能是先启动了监听器,后启动了数据库服务。
    三、也有可能是服务未在监听器中进行静态注册。解决方法上面也说了很多了,就麻烦LZ一个个去尝试了。另外,我想楼主尝试把lsnrctl status的执行结果贴出来。这样就更方便大家分析具体是什么原因导致ORA-12514错误出现。
      

  9.   

    都没有解决??贴出来你的listener.ora、tnsnames.ora最好。
      

  10.   

    tnsping 检查 tnsname 解析的正确性。
     如果失败,检查 tnsname.ora 中的设置。
    lsnrctl service 检查 oracle 实例是否成功注册到 listener 上,并且正常运行。
     如果失败,检查 listener.ora 中的设置,使用 alter system register 手动注册。