RAC的客户端tnsnames.ora配置
RAC的client端tnsnames.ora配置什么情况下可以用IP,什么情况下需要用一个name,然后在hosts文件中注明name与ip的关系?
例如:
test1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.2)(PORT = 1521))
(LOAD_BALANCE = no)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = basic)
(RETRIES = 180)
(DELAY = 5)
)
)
)
test2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.2)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac_vip1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac_vip2)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVICE_NAME = test)
(failover_mode =
(type = select)
(method = basic)
(retries = 180)
(delay = 5)
)
)
)
test3 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac_vip1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac_vip2)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVICE_NAME = test)
(failover_mode =
(type = select)
(method = basic)
(retries = 180)
(delay = 5)
)
)
)
hosts文件中:
rac_vip1 1.1.1.1
rac_vip2 1.1.1.2
以上三种的适应场景是什么呢?谢谢!
另外,
test =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 1.1.1.2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
)
)
这种格式是说不用LB,只用Failover?
[解决办法]
rac的客户端,tns里面只配置vip或者vip对应的hostname(当然你非要配置实际IP也可以)
hosts文件里要把ip,vip写上
只写vip会有问题,你可以试试hosts里只写IP,然后 多次 conn xxx/xxx@xxx看是什么情况
[解决办法]
居然不让编辑。。。
写vip或者name一般没有分别,写name的无非本地hosts文件解析成vip
写真实IP的话,会造成单点故障的时候,客户端断掉,失去RAC的意义