小秋的家

home

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  1 Posts :: 91 Stories :: 17 Comments :: 0 Trackbacks

       今天打开eclipse,一连接数据库结果就报错,错误如下:
        Could not obtain connection metadata
        java.sql.SQLException: Listener refused the connection with the following error:
        ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
        The Connection descriptor used by the client was:
        localhost:1521:orcl    
        奇怪了,我就换了一个jdk版本啊....到处找毛病,怎么都没解决掉...结果当我打开plsql,结果才发现plsql也连接不上,提示oracle 监听程序无法识别连接描述中请求的服务..
        于是在google的到处寻找问题所在,终于让我给解决了,解决方法如下:
        打开network/admin/listener.ora文件,把下面这段话加进去:
         (SID_DESC =
           (GLOBAL_DBNAME = ORCL)
           (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)   
           (SID_NAME = ORCL)
          )
        加进去后完整的如下:
        SID_LIST_LISTENER =
          (SID_LIST =
            (SID_DESC =
              (SID_NAME = PLSExtProc)
                  (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
                  (PROGRAM = extproc)
              )
             SID_DESC =
               (GLOBAL_DBNAME = ORCL)
                   (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)   
                   (SID_NAME = ORCL)
              )
  )
        保存,再重新启动监听器,OK,一切OK....但是到现在我也不知道用的好好的oracle突然间出问题了...

       

posted on 2009-05-12 13:41 棋剑小秋 阅读(4266) 评论(0)  编辑  收藏 所属分类: 数据库

只有注册用户登录后才能发表评论。


网站导航: