zoukankan      html  css  js  c++  java
  • Oracle修改监听IP地址

    oracle 11g断网安装时,没有检测net的功能,所以安装完后,netstat -an 发现自动监听的是127.0.0.1:1521,这样安装完成后,其他的主机根本无法连接,是什么原因呢?

    排错后发现,是主机名的问题:

    1 在cmd中,输入hostname 发现主机名

    2 在文件夹:c:windowssystem32driversetc  修改hosts文件:

    源文件为:

    # Copyright (c) 1993-2009 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host
    
    # localhost name resolution is handled within DNS itself.
    #    127.0.0.1       localhost
    #    ::1             localhost
    ....此处添加 主机IP       主机名

    在最后一行加入

     本机IP    主机名
    

    保存即可

    使用lsnrctl stat查看监听状态
    此时监听的还是 127.0.0.1:1521这个IP
     
     
    修改监听文件 listener.ora 文件在 D:appAdministratorproduct11.2.0dbhome_1 etworkadmin 目录下,注释部分的主机名原为Localhost
    # listener.ora Network Configuration File: D:appAdministratorproduct11.2.0dbhome_1
    etworkadminlistener.ora
    # Generated by Oracle configuration tools.
     
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = CLRExtProc)
          (ORACLE_HOME = D:appAdministratorproduct11.2.0dbhome_1)
          (PROGRAM = extproc)
          (ENVS = "EXTPROC_DLLS=ONLY:D:appAdministratorproduct11.2.0dbhome_1inoraclr11.dll")
        )
      )
     
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-ASA0GB1AV61)(PORT = 1521))//WIN-ASA0GB1AV61原为localhost
    ) ) ADR_BASE_LISTENER = D:appAdministrator

     

    把其中的localhost换成自己的主机名
     
    再修改主机名文件 tnsnames.ora
     
    # tnsnames.ora Network Configuration File: D:appAdministratorproduct11.2.0dbhome_1
    etworkadmin	nsnames.ora
    # Generated by Oracle configuration tools.
     
    LISTENER_ORCL =
      (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-ASA0GB1AV61)(PORT = 1521))//WIN..原为localhost
     
     
    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
        )
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
        )
      )
     
    ORCL =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-ASA0GB1AV61)(PORT = 1521))//WIN..原为localhost
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl)
        )
      )
    同样把localhost换成自己的主机名
    再用lsnrctl.ora检测,发现监听IP地址变为:192.168.1.251:1521 0.0.0.0 (192.168.1.251为本主机IP)
     
    成功!
  • 相关阅读:
    [Functional Programming] Running though a serial number prediction functions for tagging, pairing the result into object
    [Angular] Communicate with Angular Elements using Inputs and Events
    [Tools] Target specific browsers with babel-preset-env and the babel pollyfill (browserslist)
    [Webpack] Externalize Dependencies to be Loaded via CDN with webpack
    [Webpack] Analyze a Production JavaScript Bundle with webpack-bundle-analyzer
    [Algorithm] Largest sum of non-adjacent numbers
    [Angular] Use ngx-build-plus to compile Angular Elements
    [Algorithm] Search for matching words
    Is life always hard?
    poj3177 Redundant Paths
  • 原文地址:https://www.cnblogs.com/xing901022/p/3327857.html
Copyright © 2011-2022 走看看