配置双监听
公司的oracle数据库服务器,客户想要在自己的服务器上登陆,但是ip段不同,就在数据库服务器又加了个网卡,配置了相同的ip段,这就需要两个监听,一个原来的监听继续使用,新添加一个监听指定新的IP为客户使用。
1首先使用oracle配置和移植工具目录下Net Configuration Assistant创建新的监听,配置端口号为1522,一直next到配置完成。
2修改D:\app\admin\product\11.2.0\dbhome_1\NETWORK\ADMIN路径下listener.ora文件内容
# listener.ora Network Configuration File: D:\app\admin\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\admin\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\admin\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(GLOBAL_DBANAME = orcl)
(ORACLE_HOME = D:\app\admin\product\11.2.0\dbhome_1)
(SID_NAME = orcl)
)
)
SID_LIST_LISTENER2 =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\app\admin\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\admin\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(GLOBAL_DBANAME = orcl)
(ORACLE_HOME = D:\app\admin\product\11.2.0\dbhome_1)
(SID_NAME = orcl)
)
)LISTENER2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.0.199)(PORT = 1522))
)
)
ADR_BASE_LISTENER2 = D:\app\admin
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.123)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\admin
新添加的网卡IP为192.168.0.199(举例的IP),则修改红色标示的IP部分,添加完监听,此部分原为计算机名。红色部分SID_LIST_LISTENER2,是手动自己添加的。
3在cmd下执行lsnrctl start listener2,启动后配置的监听listener2。
OK,可以使用新的网卡IP进行连接。