Linux下修改Oracle監聽地址

來源:互聯網
上載者:User

Linux下修改Oracle監聽地址

如果你的伺服器換了ip怎麼辦?
如果你的伺服器換了名字怎麼辦?
以前的小夥伴怎麼辦?
以前的老客戶怎麼辦?
沒關係,簡單教你修改監聽地址,老朋友隨便找!
想要修改監聽地址首先要找到兩個檔案,確定兩樣東西!
第一 你的主機名稱字?
第二 你的IP地址?
第三 你的listener.ora在哪裡?
第四 你的tnsnames.ora在哪裡?

原來的檔案監聽的是localhost,這個名字在/etc/hosts中會被映射成Ip地址127.0.0.1

lisenter.ora 目錄在

/opt/Oracle/11g/network/admin

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.111.123)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /opt/oracle

tnsnames.ora

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

對應的把localhost換成自己的IP就可以了。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.