客户端环境:OS:Windows 2003 + ORACLE 10G
1. 在C:\WINDOWS\system32\drivers\etc\hosts加入下面内容:
10.182.4.31 rac1
10.182.4.35 rac2
#Virtual
10.182.4.33 rac1-vip
10.182.4.37 rac2-vip
2. 在tnsnames.ora文件中加入下面的内容:
OAKDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oakdb)
(FAILOVER_MODE =
(TYPE = session)
(METHOD = basic)
(RETIES = 180)
(DELAY = 5)
)
)
)
3.连接测试
C:\>sqlplus system/password@oakdb
SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 11月 5 10:40:56 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
联机到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select instance_name from v$instance;
INSTANCE_NAME
--------------------------------
oakdb2
SQL> exit
已切断与 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options 的联机
C:\>sqlplus system/password@oakdb
SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 11月 5 10:41:27 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
联机到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> select instance_name from v$instance;
INSTANCE_NAME
--------------------------------
oakdb1
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7419833/viewspace-677570/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7419833/viewspace-677570/
5035

被折叠的 条评论
为什么被折叠?



