现象:本地需要修改监听为localhost --》win+r--》 sqlplus system/123@xxdb 可以登陆,远程客户端不能登陆;需要将监听修改为IP地址,重启监听;远程可以访问,plsql:192.168.0.111:50000/xxdb,账号:system密码123
解决方案:将tnsnames.ora的HOST改为ip,将listener.ora的HOST改为本机计算机名称。
配置完重启服务OracleServicexxdb
# tnsnames.ora Network Configuration File: d:apporclproduct12.1.0dbhome_1
etworkadmin nsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
xxdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT =1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.111)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = xxdb)
)
)
listener.ora 配置完重启监听
# listener.ora Network Configuration File: d:apporclproduct12.1.0dbhome_1
etworkadminlistener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = d:apporclproduct12.1.0dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:d:apporclproduct12.1.0dbhome_1inoraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = pc138)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
配置完成登陆提示 tns连接超时解决方案:
windows servers 2012控制面板--》系统和安全--》Windows防火墙--》高级设置--》左侧 选择 入站规则--》右侧 新建入站规则
规则类型选端口--》TCP 特定端口填1521--》下一步下一步默认,然后填上名称。