手工配置Service的过程中。
正在使用srvctl创建service时间,需要注意TAF政策选择必须是dbms_service套餐配置。下面的例子演示了如何创建一个服务felix_ora:
1.查看现有的创建之前系统service:
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ -----------------------------------------
service_names string felix
SQL>
2.使用srvctl创建felix_ora服务;
[oracle@felix1 ~]$ srvctl add service -d felix -s felix_ora -r felix1 -a felix2 -P BASIC
[oracle@felix1 ~]$
[oracle@felix1 ~]$ srvctl config service -d felix-a
felix_ora PREF: felix1 AVAIL: felix2 TAF: BASIC
[oracle@felix1 ~]$ srvctl status service -d felix
Service felix_ora is not running.
[oracle@felix1 ~]$
3.确认服务创建成功,下面标红部分说明服务已经作为一项CRS Resource注冊到CRS中。可是眼下没有启动。
[oracle@felix1 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.felix.db application 0/0 0/1 ONLINE ONLINE felix1
ora....x1.inst application 0/5 0/0 ONLINE ONLINE felix1
ora....x2.inst application 0/5 0/0 ONLINE ONLINE felix2
ora...._ora.cs application 0/0 0/1 OFFLINE OFFLINE
ora....ix1.srv application 0/0 0/0 OFFLINE OFFLINE
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE felix1
ora....X1.lsnr application 0/5 0/0 ONLINE ONLINE felix1
ora.felix1.gsd application 0/5 0/0 ONLINE ONLINE felix1
ora.felix1.ons application 0/3 0/0 ONLINE ONLINE felix1
ora.felix1.vip application 0/0 0/0 ONLINE ONLINE felix1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE felix2
ora....X2.lsnr application 0/5 0/0 ONLINE ONLINE felix2
ora.felix2.gsd application 0/5 0/0 ONLINE ONLINE felix2
ora.felix2.ons application 0/3 0/0 ONLINE ONLINE felix2
ora.felix2.vip application 0/0 0/0 ONLINE ONLINE felix2
[oracle@felix1 ~]$
4.配置服务自己主动启动
[oracle@felix1 ~]$ srvctl enable service -d felix-s felix_ora
PRKP-1018 : Service felix_ora already enabled.
[oracle@felix1 ~]$
5.启动这个服务
[oracle@felix1 ~]$ srvctl start service -d felix -s felix_ora
[oracle@felix1 ~]$
[oracle@felix1 ~]$ srvctl status service -d felix -s felix_ora
Service felix_ora is running on instance(s) felix1
[oracle@felix1 ~]$
6.确认服务状态。
[oracle@felix2 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.felix.db application 0/0 0/1 ONLINE ONLINE felix1
ora....x1.inst application 0/5 0/0 ONLINE ONLINE felix1
ora....x2.inst application 0/5 0/0 ONLINE ONLINE felix2
ora...._ora.cs application 0/0 0/1 ONLINE ONLINE felix1
ora....ix1.srv application 0/0 0/0 ONLINE ONLINE felix1
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE felix1
ora....X1.lsnr application 0/5 0/0 ONLINE ONLINE felix1
ora.felix1.gsd application 0/5 0/0 ONLINE ONLINE felix1
ora.felix1.ons application 0/3 0/0 ONLINE ONLINE felix1
ora.felix1.vip application 0/0 0/0 ONLINE ONLINE felix1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE felix2
ora....X2.lsnr application 0/5 0/0 ONLINE ONLINE felix2
ora.felix2.gsd application 0/5 0/0 ONLINE ONLINE felix2
ora.felix2.ons application 0/3 0/0 ONLINE ONLINE felix2
ora.felix2.vip application 0/0 0/0 ONLINE ONLINE felix2
[oracle@felix2 ~]$
说明已经所有启动了;
新建的服务会自己主动加入到初始化參数文件里:
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ -----------------------------------------
service_names string felix, felix_ora
SQL>
7.改动service的TAF配置,须要使用dbms_service.modify_service
begin
dbms_service.modify_service(service_name => 'felix_ora',
failover_method =>dbms_service.failover_method_basic,
failover_type =>dbms_service.failover_type_select,
failover_retries => 180,
failover_delay => 5);
end;
/
PL/SQL procedure successfully completed.
8.确认以生效
Set lines 1000 pages 1000
col name for a50
col clb_goal for a15
col FAILOVER_METHOD for a15
col failover_type for a20;
SQL> selectname,failover_method,failover_type,clb_goal from dba_services;
NAME FAILOVER_METHOD FAILOVER_TYPE CLB_GOAL
----------------------------------------------------------------- -------------------- ---------------
SYS$BACKGROUND SHORT
SYS$USERS SHORT
seeddataXDB LONG
seeddata.regress.rdbms.dev.us.oracle.com LONG
felixXDB LONG
felix LONG
taf_server LONG
taf_srvctl LONG
felix_ora BASIC SELECT LONG
9 rows selected.
[oracle@felix1 ~]$ srvctl config service -d felix -a
felix_ora PREF: felix1 AVAIL: felix2 TAF: BASIC
[oracle@felix1 ~]$
【参考说谎RAC--张晓明】
版权声明:本文博客原创文章。博客,未经同意,不得转载。