10g RAC 采用service达到taf

service由于oracle数据库中的一个关键概念,利用得当,可以轻松地管理数据库,提高数据库的工作效率。

经service。oracle可以实现server side  taf,简单化client维修,下面我们来看看10g rac 如何测试service实现 serve side  taf

使用dbca来配置taf

通过dbca能够很方便的配置server  side taf

至此。service配置完毕,以下我们验证一下

[[email protected] ~]# su - oracle
[[email protected] ~]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 05-AUG-2014 21:46:10

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_NODE1
Version                   TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date                05-AUG-2014 21:26:40
Uptime                    0 days 0 hr. 19 min. 30 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/11.2.0/db/network/log/listener_node1.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.131)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.31)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...
Service "+ASM_XPT" has 1 instance(s).
  Instance "+ASM1", status BLOCKED, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "racdb" has 3 instance(s).
  Instance "racdb", status UNKNOWN, has 1 handler(s) for this service...
  Instance "racdb1", status READY, has 2 handler(s) for this service...
  Instance "racdb2", status READY, has 1 handler(s) for this service...
Service "racdbXDB" has 2 instance(s).
  Instance "racdb1", status READY, has 1 handler(s) for this service...
  Instance "racdb2", status READY, has 1 handler(s) for this service...
Service "racdb_XPT" has 2 instance(s).
  Instance "racdb1", status READY, has 2 handler(s) for this service...
  Instance "racdb2", status READY, has 1 handler(s) for this service...
Service "service1" has 1 instance(s).
  Instance "racdb1", status READY, has 2 handler(s) for this service...
The command completed successfully
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Aug 5 21:46:23 2014

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> show parameter service

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
service_names			     string	 service1
SQL> col name for a20
SQL> col failover_method for a20
SQL> col failover_type for a20
SQL>  select name,failover_method,failover_type from dba_services;

NAME		     FAILOVER_METHOD	  FAILOVER_TYPE
-------------------- -------------------- --------------------
SYS$BACKGROUND
SYS$USERS
seeddataXDB
seeddata.regress.rdb
ms.dev.us.oracle.com

racdbXDB
racdb
service1

7 rows selected.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

[[email protected] ~]$ srvctl config service -d racdb -s service1 -a
service1 PREF: racdb1 AVAIL: racdb2 TAF: basic
[[email protected] ~]$ srvctl config service -d racdb
service1 PREF: racdb1 AVAIL: racdb2

从上面的结果能够看出,通过dbca配置service 的taf,会在ocr中存储taf配置信息(不过taf method),在数据库參数文件里会加入service条目,而且在数据字典中加入对应记录,可是数据字典中的taf信息是空的,须要另外加入。如

SQL> begin
  2  dbms_service.modify_service(
  3  service_name=>'service1',
  4  failover_method=>dbms_service.failover_method_basic,
  5  failover_type => dbms_service.failover_type_select,
  6  failover_retries => 180,
  7  failover_delay => 5
  8  );
  9  end;
 10  /

PL/SQL procedure successfully completed.

SQL> col name for a20
SQL> col failover_method for a20
SQL> col failover_type for a20
SQL> select name,failover_method,failover_type from dba_services;

NAME		     FAILOVER_METHOD	  FAILOVER_TYPE
-------------------- -------------------- --------------------
SYS$BACKGROUND
SYS$USERS
seeddataXDB
seeddata.regress.rdb
ms.dev.us.oracle.com

racdbXDB
racdb
service1	     BASIC		  SELECT

7 rows selected.

另外,也能够使用srvctl来加入service

[[email protected] ~]# srvctl add service -h
Usage: srvctl add service -d <name> -s <service_name> -r "<preferred_list>" [-a "<available_list>"] [-P <TAF_policy>]
    -d <name>           Unique name for the database
    -s <service>        Service name
    -r "<pref_list>"    List of preferred instances
    -a "<avail_list>"   List of available instances
    -P <TAF_policy>     TAF policy (NONE, BASIC, or PRECONNECT)
Usage: srvctl add service -d <name> -s <service_name> -u {-r "<new_pref_inst>" | -a "<new_avail_inst>"}
    -d <name>           Unique name for the database
    -s <service>        Service name
    -u                  Add a new instance to service configuration
    -r <new_pref_inst>  Name of new preferred instance
    -a <new_avail_inst> Name of new available instance
    -h                  Print usage
[[email protected] ~]# srvctl add service -d racdb -s service2 -r racdb1 -a racdb2 -P BASIC
PRKH-1014 : Current user root is not the same as oracle owner oracle of oracle home /u01/app/oracle/product/11.2.0/db.
[[email protected] ~]# su - oracle
[[email protected] ~]$ srvctl add service -d racdb -s service2 -r racdb1 -a racdb2 -P BASIC
[[email protected] ~]$ srvctl config service -d racdb -a
service1 PREF: racdb1 AVAIL: racdb2 TAF: basic
service2 PREF: racdb1 AVAIL: racdb2 TAF: BASIC
[[email protected] ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Tue Aug 5 22:16:43 2014

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> show parameter service

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
service_names			     string	 service1, racdb
SQL> select name from dba_services;

NAME
----------------------------------------------------------------
SYS$BACKGROUND
SYS$USERS
seeddataXDB
seeddata.regress.rdbms.dev.us.oracle.com
racdbXDB
racdb
service1

7 rows selected.

从这里。能够看出通过srvct加入的service不会在数据库參数和数据字典中加入对应的信息

版权声明:本文博主原创文章,博客,未经同意不得转载。

时间: 2024-10-13 20:35:26

10g RAC 采用service达到taf的相关文章

10g RAC 使用service实现taf

service作为oracle数据库中的关键概念之一,利用得当,可以方便数据库的管理,提高数据库的执行效率. 通过service,oracle可以实现server side  taf,简化对客户端的维护量,下面我们看一下在10g rac 怎样实验service实现 serve side  taf 使用dbca来配置taf 通过dbca可以非常方便的配置server  side taf 至此,service配置完成,下面我们验证一下 [[email protected] ~]# su - orac

【转】Oracle 10g RAC TAF

本人转自:http://www.cnblogs.com/future2012lg/archive/2013/10/12/3365978.html Oracle RAC 同一时候具备HA(High Availiablity) 和LB(LoadBalance). 而其高可用性的基础就是Failover(故障转移). 它指集群中不论什么一个节点 的故障都不会影响用户的使用,连接到故障节点的用户会被自己主动转移到健康节点,从用户感受而言, 是感觉不到这样的切换. Oracle 10g RAC 的Fail

RedHat EL5 安装Oracle 10g RAC之--CRS 安装

RedHat EL5 安装Oracle 10g RAC之--CRS 安装 系统环境: 操作系统:RedHat EL5 Cluster: Oracle CRS 10.2.0.1.0 Oracle:  Oracle 10.2.0.1.0 如图所示:RAC 系统架构 二.CRS 安装   Cluster Ready Service是Oracle 构建RAC,负责集群资源管理的软件,在搭建RAC中必须首先安装. 安装需采用图形化方式,以Oracle用户的身份安装(在node1上): 注意:修改安装配置文

Oracle 10g RAC修改IP/VIP地址示例

一.准备工作 1. 数据库信息 操作系统版本  : OEL5.4 x64   数据库版本    : Oracle 10.2.0.5 x64 RAC 2. IP地址对应信息 说明: 服务器主机名不能更改,如确实要改名,需要重装CRS解决,还不如重新安装呢.   本文环境是10g rac+ocfs+asm,心跳地址不变,IP地址因环境限制暂时采用同一个网段,不同的IP地址,但是过程与不同网段改名一致. 原IP地址:    192.168.0.6         node1         修改为:

RedHat EL5 安装Oracle 10g RAC之--系统环境配置(1)

RedHat EL5 安装Oracle 10g RAC之--系统环境配置(1) 系统环境: 操作系统:RedHat EL5 Cluster: Oracle CRS 10.2.0.1.0 Oracle:  Oracle 10.2.0.1.0 如图所示:RAC 系统架构 一.操作系统环境 1.网络配置(在所有节点) [[email protected] ~]# cat /etc/hosts # Do not remove the following line, or various programs

RedHat EL5 安装Oracle 10g RAC之--系统环境配置(2)

RedHat EL5 安装Oracle 10g RAC之--系统环境配置(2) 系统环境: 操作系统:RedHat EL5 Cluster: Oracle CRS 10.2.0.1.0 Oracle:  Oracle 10.2.0.1.0 如图所示:RAC 系统架构 6.通过SSH配置主机间的信任关系 node1: [[email protected] ~]$ mkdir .ssh [[email protected] ~]$ ssh-keygen -t rsa Generating publi

Oracle 10g RAC启动与关闭命令

一. 检查共享设备 一般情况下, 存放OCR 和 Voting Disk 的OCFS2 或者raw 都是自动启动的. 如果他们没有启动,RAC 肯定是启动不了的. 1.1 如果使用ocfs2的,检查ocfs2 状态 /etc/init.d/o2cb status 在挂载之前,/etc/init.d/o2cb status 显示为Checking O2CB heartbeat: Not active. 在格式化和挂载文件系统之前,应验证 O2CB 在两个节点上均联机:O2CB 心跳当前没有 活动,

AIX 5.3下Oracle 10g RAC 启动故障--CRS启动失败

AIX 5.3下Oracle 10g RAC 启动故障--CRS启动失败 系统环境: 操作系统: AIX 5300-09 集群软件: CRS 10.2.0.1 数据库:   Oracle 10.2.0.1                     系统架构图 故障现象: 系统重启后,在节点上CRS 启动失败或CRS服务启动成功,CRS Resource无法ONLINE. [[email protected] racg] cat /etc/hosts 127.0.0.1              

oracle 10g rac 修改public ip、vip和private ip

oracle 10g rac 修改public ip.vip和private ip [TOC] 1.IP地址规划 Hostname 当前IP 修改后IP Public IP node1 192.168.56.20 192.168.100.20 Public IP node2 192.168.56.21 192.168.100.21 VIP node1-vip 192.168.56.98 192.168.100.98 VIP node2-vip 192.168.56.99 192.168.100.