问题描述
我当前在Windows 2012环境中运行Oracle 11g.
I am currently running Oracle 11g on a Windows 2012 Environment.
我最近添加了另一个NIC以进行故障转移,但是我不确定如何处理我的listener.ora文件和tnsnames.ora文件.有人可以提供指导吗?作为参考,我正在使用的当前IP为192.168.0.52,我要添加的第二个NIC的IP为192.168.0.53.
I recently added another NIC to allow for failover, however I am not sure as to what to do with my listener.ora file and my tnsnames.ora file. Could someone offer guidance? For reference, the current IP I am using is 192.168.0.52 and the IP of the second NIC that I would like to add has the IP of 192.168.0.53.
下面是我的listener.ora文件:
Below is my listener.ora file:
# listener.ora Network Configuration File: D:\app\Administrator\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\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
)
)
ADR_BASE_LISTENER = D:\app\Administrator
下面是我的tnsnames.ora文件:
Below is my tnsnames.ora file:
# tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
感谢您的所有帮助!
推荐答案
好,您可以在listener.ora
中指定多个ADDRESS
条目:
Well, you can specify multiple ADDRESS
entries in the listener.ora
:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.53)(PORT = 1521))
)
)
在tnsnames.ora
中:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.52)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.53)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
当我为侦听器指定多个地址时,它将在列出的所有接口上侦听.当tnsnames中的至少一个地址可以连接时-它就连接了.我有11g可用于在客户端和服务器端进行测试.我检查了文档( tnsnames.ora中有多个地址列表),并指出可以在tnsnames.ora
中明确指定参数(FAILOVER=on)
.
When I specify multiple addresses for listener, it listens on all interfaces listed. And when at least one address in tnsnames can be connected to -- it connects. I have 11g available for testing both on the client-side and on the server-side. I checked the documentation (Multiple Address Lists in tnsnames.ora) and it states that parameter (FAILOVER=on)
can be specified in tnsnames.ora
explicitly.
这篇关于需要为第二个NIC添加Oracle侦听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!