阿里云服务器配置oracle监听

为了能让oracle可以被内网与外网访问需要修改三个文件

1./u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora


# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 主机名)(PORT = 1521))
    )
  )
ADR_BASE_LISTENER = /u01/app/oracle



HOST修改为主机名

2./u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora


# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

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

HOST修改为实例名 可以供内网访问

lsnrctl stop 关闭监听

lsnrctl start 启动监听


如果内网可以访问,外网不能访问需要第三步

3.etc/hosts

检查主机名与当前主机名是否一致 正确的配置需要  主机名=listener.ora的主机名=hosts的主机名


如果配置了第三步需要重启服务器

你可能感兴趣的:(oracle,数据库,阿里云)