问题描述:安装Oracle 19c 本地测试,服务通过rancher部署,发现不能访问本地数据库。本地通过telnet 127.0.0.1 1521 能通。服务中使用的电脑的另外一个IP:192.168.138.1,发现端口不通讯。
问题解决:
开始以为是因为连接VPN导致,关闭VPN后还是访问不通讯。于是本地启动了另外个服务,通过IP+端口访问没有问题,那应该就是Oracle配置问题。将配置文件D:\Oracle\19c\WINDOWS.X64_193000_db_home\network\admin\listener.ora
修改
原来:
# listener.ora Network Configuration File: D:\Oracle\19c\WINDOWS.X64_193000_db_home\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\Oracle\19c\WINDOWS.X64_193000_db_home)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\19c\WINDOWS.X64_193000_db_home\bin\oraclr19.dll")
)
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = D:\Oracle\19c\WINDOWS.X64_193000_db_home)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\19c\WINDOWS.X64_193000_db_home\bin\oraclr19.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LOCALHOST)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
修改 HOST = LOCALHOST 为本机的名称
# listener.ora Network Configuration File: D:\Oracle\19c\WINDOWS.X64_193000_db_home\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\Oracle\19c\WINDOWS.X64_193000_db_home)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\19c\WINDOWS.X64_193000_db_home\bin\oraclr19.dll")
)
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = D:\Oracle\19c\WINDOWS.X64_193000_db_home)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\19c\WINDOWS.X64_193000_db_home\bin\oraclr19.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-SSEHJKD)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
重启Oracle网络服务
任务管理器 -> 服务 --> OracleOraDB19Home1TNSListener
windows 查看本机名称
ipconifg /all