分类: Oracle
2008-04-28 20:17:41
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://102599.blog.51cto.com/92599/36375 |
在ORACLE 9i RAC 环境下,为了做到高可用性,需要对客户端的tnsnames.ora这个文件进行配置,在oracle中这样的配置叫做TAF,这个配置不能使用NETCA配置程序生成。其中ORA是RAC数据库的数据库名,另外,各个不同的节点的实例名分别为ORA1和ORA2,以下配置中的两个连接配置分别互为备份,切换时间为5秒。
以下所示为配置示例。
ORA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.13)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.14)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA)
(INSTANCE_NAME = ORA1)
(INSTANCE_ROLE = PRIMARY)
(FAILOVER_MODE =
(BACKUP = ORA_BACKUP)
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 30)
(DELAY = 5)
)
)
)
ORA_BACKUP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.14)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.13)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA)
(INSTANCE_NAME = ORA2)
(INSTANCE_ROLE = PRIMARY)
(FAILOVER_MODE =
(BACKUP = ORA)
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 30)
(DELAY = 5)
)
)
)
在以上示例中所标红部分为TNS的别名及备份TNS别名,可按用户应用的需要自行修改。
在以上示例中所标蓝部分,分别为RAC数据库的服务名和各节点的实例名,可按节点数量的不同及服务名的不同自行修改。
此配置适用于oracle 9i和oracle 10g。
本文出自 “张飞” 博客,请务必保留此出处http://102599.blog.51cto.com/92599/36375 本文出自 51CTO.COM技术博客 |