• 如何配置oracle数据库的连接


    解决oracle数据库“监听程序当前无法识别连接描述符中请求的服务”

    今晚搞了几个小时的oracle配置,现在终于连上了,同时也发现好多人每次重装系统后都得重装oracle,现将我如何处理这一类问题的方法分享如下,嘿嘿,屡试不爽的,更重要的是不用修改ip,直接用本地连接localhost,不论是否联网都可以这样配置!

    我的oracle安装路径在F盘的app文件夹下,

    首先找到F:\app\Administrator\product\11.1.0\db_1\NETWORK\ADMIN下的listener.ora和tnsnames.ora这两个文件,用记事本打开就可以

    用下面的这些代码替换listener.ora中原有的代码

    注:路径要是自己的安装路径

    # listener.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.

    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = F:\app\Administrator\product\11.1.0\db_1)
          (PROGRAM = extproc)
        )
         (SID_DESC =
          (GLOBAL_DBNAME = orcl)
          (ORACLE_HOME = F:\app\Administrator\product\11.1.0\db_1)
          (SID_NAME = orcl)
        )
     
      )

    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        )
      )

    # tnsnames.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.

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

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

     用下面的这些代码替换tnsnames.ora 中原有的代码

    # tnsnames.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.

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

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

    替换完成之后重启oracle数据库服务就可以了

  • 相关阅读:
    11.4 iftop:动态显示网络接口流量信息
    10.2-3 ifup&ifdown:激活与禁用网络接口
    10.1 ifconfig:配置或显示网络接口信息
    10.16-17 mailq&mail:显示邮件传输队列&发送邮件
    10.13 nc:多功能网络工具
    Matplotlib_常用图表
    urlrrtrieve()实例_下载微博短视频
    ulrlib案例-爬取百度贴吧
    Scrapy-Spider
    Scrapy-架构
  • 原文地址:https://www.cnblogs.com/gxpblogs/p/3067844.html
Copyright © 2020-2023  润新知