美文网首页
oracle所在环境Linux更改主机名及ip

oracle所在环境Linux更改主机名及ip

作者: 千叶飞雪 | 来源:发表于2019-06-05 09:20 被阅读0次

    测试环境:redhat 6.5, oracle 11G

    总共要修改3个地方

    1)修改host

    [root@NCDB /]# vi /etc/hosts
    172.0.0.112 NCBD

    127.0.0.1   localhost NCDB localhost4 localhost4.localdomain4
    ::1         localhost NCDB localhost6 localhost6.localdomain6
    172.0.0.112   localhost NCDB localhost4 localhost4.localdomain4
    

    2)修改network

    [root@NCBD /]# vi /etc/sysconfig/network
    HOSTNAME=B=NCDB

    NETWORKING=yes
    HOSTNAME=NCDB
    

    3)修改oracle的listener.ora和tnsnames.ora文件找自己的安装路径

    [oracle@NCDB~]$

    vi /opt/oracle/product/12.2.0/dbhome/network/admin/listener.ora

    (ADDRESS = (PROTOCOL = TCP)(HOST = NCDB)(PORT = 1521))

    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = NCDB)(PORT = 1521))
        )
      )
    
    SID_LIST_LISTENER =
     (SID_LIST =
       (SID_DESC =
       (GLOBAL_DBNAME = orcl)
       (SID_NAME = orcl)
       )
     )
    

    tnsnames.ora文件修改
    vi /opt/oracle/product/12.2.0/dbhome/network/admin/tnsnames.ora
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.0.0.112)(PORT = 1521))

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

    重启oracle服务和监听

    相关文章

      网友评论

          本文标题:oracle所在环境Linux更改主机名及ip

          本文链接:https://www.haomeiwen.com/subject/nvfjxctx.html