楼主: yxh200

关于Oracle10g RAC的一点疑惑

[复制链接]
论坛徽章:
17
ITPUB元老
日期:2005-02-28 12:57:00ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32ITPUB十周年纪念徽章
日期:2011-11-01 16:19:412011新春纪念徽章
日期:2011-02-18 11:43:32ITPUB9周年纪念徽章
日期:2010-10-08 09:28:532010新春纪念徽章
日期:2010-03-01 11:05:01祖国60周年纪念徽章
日期:2009-10-09 08:28:00ITPUB8周年纪念徽章
日期:2009-09-27 10:21:222009新春纪念徽章
日期:2009-01-04 14:52:28奥运会纪念徽章:射击
日期:2008-10-24 13:23:42
11#
发表于 2005-3-4 10:49 | 只看该作者
关键是你要在客户端设置连接到两个VIP地址,这样才能failover。

使用道具 举报

回复
论坛徽章:
0
12#
 楼主| 发表于 2005-3-4 11:33 | 只看该作者
那你们在客户端设置连接到两个VIP地址,一般还要再安装什么软件保证能够failover

使用道具 举报

回复
论坛徽章:
0
13#
 楼主| 发表于 2005-3-4 11:34 | 只看该作者
能不能给我推荐一个,谢谢!!

使用道具 举报

回复
论坛徽章:
0
14#
 楼主| 发表于 2005-3-4 12:16 | 只看该作者

使用道具 举报

回复
论坛徽章:
168
马上加薪
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:10:582012新春纪念徽章
日期:2012-01-04 11:49:54蜘蛛蛋
日期:2011-12-05 16:08:56ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41设计板块每日发贴之星
日期:2011-07-22 01:01:02ITPUB官方微博粉丝徽章
日期:2011-06-30 12:30:16管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:33
15#
发表于 2005-3-4 12:56 | 只看该作者
For Example:

This is a four nodes cluster setup.  The configuration is as follows.  If you  
replace your hostname, service_name, sid_name, instance_name and $ORACLE_HOME
in the example files, you should be able to configure a successful setup.   

       hostname  service name  sid name  instance_name  ORACLE_HOME
       ========  ============  ========  =============  =====================
node1   hprac-22      rac         rac1         rac1     /oracle/9iship/rac901
node2   hprac-23      rac         rac2         rac2     /oracle/9iship/rac901
node3   hprac-24      rac         rac3         rac3     /oracle/9iship/rac901
node4   hprac-25      rac         rac4         rac4     /oracle/9iship/rac901


All 4 nodes init.ora file have the following parameters:
remote_listener='LISTENERS_RAC'
rac1.local_listener="LISTENER_rac1�
rac2.local_listener="LISTENER_rac2"
rac3.local_listener="LISTENER_rac3"
rac4.local_listener="LISTENER_rac4"
# dispatchers="(pro=ipc)(dis=0)"
db_name='rac'
rac1.instance_name='rac1'
rac2.instance_name='rac2'
rac3.instance_name='rac3'
rac4.instance_name='rac4'

Since service_names is not specified in the init.ora file, it defaults to  
db_name.db_domain.  Each node should list it's own host name and instance_name.   
With the above setup, after you start the instance, when checking the sql  
session from node1, you will find the following info.   


SQL> show parameter db_name
NAME                        TYPE      VALUE
--------------------------- --------- -----------------------------------------
db_name                     string    rac

SQL> show parameter db_domain
NAME                        TYPE      VALUE
--------------------------- --------- -----------------------------------------
db_domain                   string

SQL> show parameter service_names
NAME                        TYPE      VALUE
--------------------------- --------- -----------------------------------------
service_names               string    rac

SQL> show parameter instance_name
NAME                        TYPE      VALUE
--------------------------- --------- -----------------------------------------
instance_name               string    rac1

SQL> show parameter listener
NAME                    TYPE      VALUE
---------------------- -----     ----------------------------------------------
local_listener         string    LISTENER_rac1
mts_listener_address   string
mts_multiple_listeners boolean   FALSE
remote_listener        string    LISTENERS_RAC


hprac-22 listener.ora file
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
      )
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/9iship/rac901)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (ORACLE_HOME = /oracle/9iship/rac901)
      (SID_NAME = rac1)
    )
  )


hprac-22 ~ hprac-25 and client side tnsnames.ora file

LISTENERS_RAC =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    )
  )

RAC1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (INSTANCE_NAME = rac1)
    )
  )

RAC2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (INSTANCE_NAME = rac2)
    )
  )

RAC3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (INSTANCE_NAME = rac3)
    )
  )

RAC4 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (INSTANCE_NAME = rac4)
    )
  )

RAC =
  (DESCRIPTION =
    (LOAD_BALANCE = yes)
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
    )
  )

failover =
  (DESCRIPTION =
    (enable=broken)
    (LOAD_BALANCE = yes)
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (failover_mode=(type=select)(method=basic))
    )
  )

# For hprac-22 only
LISTENER_rac1 =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
  )

# For hprac-23 only
LISTENER_rac2 =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
  )

# For hprac-24 only
LISTENER_rac3 =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
  )

# For hprac-25 only
LISTENER_rac4 =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
  )


Remarks:
1) LISTENERS_RAC, LISTENER_rac1, LISTENER_rac2, LISTENER_rac3, LISTENER_rac4,  
is the net_service_name (connect descriptor) for remote_listener and  
local_listener.  On the client side, you do not need these net_service_name.
2) failover is the net_service_name for transparent application failover (TAF)
testing.
3) RAC is the net_service_name for client side load balance, if you do not  
need to configure TAF.

There are few different ways to set up client side connect time load balance.   
Here is another alternative:

4) RAC_alternative =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (LOAD_BALANCE = yes)
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
    )
  )
Note:  The (load_balance=yes) instructs Net to progress through the list of  
listener addresses in a random sequence, balancing the load on the various  
listeners.  When set to OFF, instructs Net to try the addresses sequentially  
until one succeeds.  This parameter must be correctly coded in your net  
service name (connect descriptor).  By default, this parameter is set to ON  
for DESCRIPTION_LISTs.  Load balancing can be specified for an ADDRESS_LIST or  
associated with a set of ADDRESSes or set DESCRIPTIONs. If you use ADDRESS_LIST,
(load_balance=yes) should be within the (ADDRESS_LIST=) portion.  If you do  
not use ADDRESS_LIST, (load_balance=yes) should be within the (description=)
portion.  We recommend not to use this (ADDRESS_LIST=) clause.

5) (failover=on) is default for ADDRESS_LISTs, DESCRIPTION_LISTs, and a set of
DESCRIPTIONs., therefore, you do not have to specify.  This is for  
connect-time-failover, please do not confuse it with transparent application  
failover (TAF).   
6) (failover_mode=): The FAILOVER_MODE parameter must be included in the  
CONNECT_DATA portion of a net_service_name.   
7) There is no (backup=failover) in (failover_mode=), this implies  
(failover_mode=(type=select)(method=basic)(backup=failover)), which means  
whenever failover occurs, the connected session will failover to the  
net_service_name failover again.  A backup should be specified when using  
PRECONNECT to pre-establish connections.  For details of TAF, please refer to  
Oracle official documentations.

9i的配置,10g类似.

使用道具 举报

回复
论坛徽章:
0
16#
 楼主| 发表于 2005-3-4 13:27 | 只看该作者
谢谢!!我马上试试!!

使用道具 举报

回复
论坛徽章:
4
授权会员
日期:2005-10-30 17:05:33ITPUB元老
日期:2006-01-04 23:54:55会员2006贡献徽章
日期:2006-04-17 13:46:34生肖徽章2007版:鸡
日期:2008-01-02 17:35:53
17#
发表于 2005-3-4 13:29 | 只看该作者
最初由 husthxd 发布
[B]For Example:

This is a four nodes cluster setup.  The configuration is as follows.  If you  
replace your hostname, service_name, sid_name, instance_name and $ORACLE_HOME
in the example files, you should be able to configure a successful setup.   

       hostname  service name  sid name  instance_name  ORACLE_HOME
       ========  ============  ========  =============  =====================
node1   hprac-22      rac         rac1         rac1     /oracle/9iship/rac901
node2   hprac-23      rac         rac2         rac2     /oracle/9iship/rac901
node3   hprac-24      rac         rac3         rac3     /oracle/9iship/rac901
node4   hprac-25      rac         rac4         rac4     /oracle/9iship/rac901


All 4 nodes init.ora file have the following parameters:
remote_listener='LISTENERS_RAC'
rac1.local_listener="LISTENER_rac1�
rac2.local_listener="LISTENER_rac2"
rac3.local_listener="LISTENER_rac3"
rac4.local_listener="LISTENER_rac4"
# dispatchers="(pro=ipc)(dis=0)"
db_name='rac'
rac1.instance_name='rac1'
rac2.instance_name='rac2'
rac3.instance_name='rac3'
rac4.instance_name='rac4'

Since service_names is not specified in the init.ora file, it defaults to  
db_name.db_domain.  Each node should list it's own host name and instance_name.   
With the above setup, after you start the instance, when checking the sql  
session from node1, you will find the following info.   


SQL> show parameter db_name
NAME                        TYPE      VALUE
--------------------------- --------- -----------------------------------------
db_name                     string    rac

SQL> show parameter db_domain
NAME                        TYPE      VALUE
--------------------------- --------- -----------------------------------------
db_domain                   string

SQL> show parameter service_names
NAME                        TYPE      VALUE
--------------------------- --------- -----------------------------------------
service_names               string    rac

SQL> show parameter instance_name
NAME                        TYPE      VALUE
--------------------------- --------- -----------------------------------------
instance_name               string    rac1

SQL> show parameter listener
NAME                    TYPE      VALUE
---------------------- -----     ----------------------------------------------
local_listener         string    LISTENER_rac1
mts_listener_address   string
mts_multiple_listeners boolean   FALSE
remote_listener        string    LISTENERS_RAC


hprac-22 listener.ora file
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
      )
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/9iship/rac901)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (ORACLE_HOME = /oracle/9iship/rac901)
      (SID_NAME = rac1)
    )
  )


hprac-22 ~ hprac-25 and client side tnsnames.ora file

LISTENERS_RAC =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    )
  )

RAC1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (INSTANCE_NAME = rac1)
    )
  )

RAC2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (INSTANCE_NAME = rac2)
    )
  )

RAC3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (INSTANCE_NAME = rac3)
    )
  )

RAC4 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (INSTANCE_NAME = rac4)
    )
  )

RAC =
  (DESCRIPTION =
    (LOAD_BALANCE = yes)
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
    )
  )

failover =
  (DESCRIPTION =
    (enable=broken)
    (LOAD_BALANCE = yes)
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
      (failover_mode=(type=select)(method=basic))
    )
  )

# For hprac-22 only
LISTENER_rac1 =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
  )

# For hprac-23 only
LISTENER_rac2 =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
  )

# For hprac-24 only
LISTENER_rac3 =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
  )

# For hprac-25 only
LISTENER_rac4 =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
  )


Remarks:
1) LISTENERS_RAC, LISTENER_rac1, LISTENER_rac2, LISTENER_rac3, LISTENER_rac4,  
is the net_service_name (connect descriptor) for remote_listener and  
local_listener.  On the client side, you do not need these net_service_name.
2) failover is the net_service_name for transparent application failover (TAF)
testing.
3) RAC is the net_service_name for client side load balance, if you do not  
need to configure TAF.

There are few different ways to set up client side connect time load balance.   
Here is another alternative:

4) RAC_alternative =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (LOAD_BALANCE = yes)
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-22)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-23)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-24)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = hprac-25)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = rac)
    )
  )
Note:  The (load_balance=yes) instructs Net to progress through the list of  
listener addresses in a random sequence, balancing the load on the various  
listeners.  When set to OFF, instructs Net to try the addresses sequentially  
until one succeeds.  This parameter must be correctly coded in your net  
service name (connect descriptor).  By default, this parameter is set to ON  
for DESCRIPTION_LISTs.  Load balancing can be specified for an ADDRESS_LIST or  
associated with a set of ADDRESSes or set DESCRIPTIONs. If you use ADDRESS_LIST,
(load_balance=yes) should be within the (ADDRESS_LIST=) portion.  If you do  
not use ADDRESS_LIST, (load_balance=yes) should be within the (description=)
portion.  We recommend not to use this (ADDRESS_LIST=) clause.

5) (failover=on) is default for ADDRESS_LISTs, DESCRIPTION_LISTs, and a set of
DESCRIPTIONs., therefore, you do not have to specify.  This is for  
connect-time-failover, please do not confuse it with transparent application  
failover (TAF).   
6) (failover_mode=): The FAILOVER_MODE parameter must be included in the  
CONNECT_DATA portion of a net_service_name.   
7) There is no (backup=failover) in (failover_mode=), this implies  
(failover_mode=(type=select)(method=basic)(backup=failover)), which means  
whenever failover occurs, the connected session will failover to the  
net_service_name failover again.  A backup should be specified when using  
PRECONNECT to pre-establish connections.  For details of TAF, please refer to  
Oracle official documentations.

9i的配置,10g类似. [/B]


9i和10g不一样,
10g为了实现完全脱离ha,所以所有外界连接都是通过vip的.

使用道具 举报

回复
论坛徽章:
0
18#
 楼主| 发表于 2005-3-4 14:41 | 只看该作者
阿,这位大哥,你能不能说得清楚一点啊,具体应该怎么做?

使用道具 举报

回复
论坛徽章:
0
19#
 楼主| 发表于 2005-3-4 16:09 | 只看该作者

使用道具 举报

回复
论坛徽章:
168
马上加薪
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:10:582012新春纪念徽章
日期:2012-01-04 11:49:54蜘蛛蛋
日期:2011-12-05 16:08:56ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41设计板块每日发贴之星
日期:2011-07-22 01:01:02ITPUB官方微博粉丝徽章
日期:2011-06-30 12:30:16管理团队成员
日期:2011-05-07 01:45:082011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:33
20#
发表于 2005-3-4 16:41 | 只看该作者
最初由 shimu 发布
[B]

9i和10g不一样,
10g为了实现完全脱离ha,所以所有外界连接都是通过vip的. [/B]


感觉10g的rac跟9i的rac基本上是换汤不换药.

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表