ITPub博客

首页 > Linux操作系统 > Linux操作系统 > How to redirect the TAF Service to preferred node?

How to redirect the TAF Service to preferred node?

原创 Linux操作系统 作者:oracle_ace 时间:2008-05-15 21:18:03 0 删除 编辑

As we know If a node in the RAC environment is crashed or shutdown abnormally.We can adopt to use the DBCA to generate a TAF service to achieve the failover between two or more nodes in the Real application cluster environment. For example i have two nodes rac environment with a created  TAF service named "IRMDBTEST' before(RAC1 with preferred mode,RAC2 with available mode). Suppose RAC1 is crashed in some time and another nodes(rac2)  will take over the request from client. After RAC1 is turned back, TAF service will not automaticly redirec the preferred instance. So we have to deal with this matter by ousrselves.

But how to do it?

In RAC1
---------
rac1-> crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.irmdb.db   application    ONLINE    ONLINE    rac2       
ora....b1.inst application    OFFLINE   OFFLINE              
ora....b2.inst application    ONLINE    ONLINE    rac2       
ora....test.cs application    ONLINE    ONLINE    rac1       
ora....db1.srv application    ONLINE    ONLINE    rac2       
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2  
 
rac1-> srvctl start instance -d irmdb -i irmdb1

rac1-> sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 15 21:25:35 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn system/passw0rd@irmdbtest;
Connected.
SQL> select instance_name,instance_number,host_name,status from v$instance;

INSTANCE_NAME    INSTANCE_NUMBER
---------------- ---------------
HOST_NAME                                                        STATUS
---------------------------------------------------------------- ------------
irmdb2                         2
rac2.cn.ibm.com                                                  OPEN

SQL> show parameter service_name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      irmdb.cn.ibm.com, irmdbtest

SQL> quit;

rac1-> export ORACLE_SID=irmdb1
rac1-> sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 15 21:27:17 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn / as sysdba;
Connected.
SQL> show parameter service_name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      irmdb.cn.ibm.com

In RAC2:
---------
rac2-> export ORACLE_SID=irmdb2
rac2-> sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 15 21:28:20 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn / as sysdba;
Connected.
SQL> show parameter service_name;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      irmdb.cn.ibm.com, irmdbtest

--how to switch to irmdb1?

rac1-> srvctl relocate service -d irmdb -s irmdbtest -i irmdb2 -t irmdb1

rac1-> sqlplus /nolog

SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 15 21:30:31 2008

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> conn system/passw0rd@irmdb1
Connected.
SQL> show parameter service;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      irmdb.cn.ibm.com, irmdbtest
SQL> conn system/passw0rd@irmdb2
Connected.
SQL> show parameter service;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      irmdb.cn.ibm.com

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12361284/viewspace-269237/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-12-10

  • 博文量
    284
  • 访问量
    865724