11gR2维护service

11gR2维护service

 

1、添加service

[root@H096 bin]# su - oracle

[oracle@H096 ~]$ srvctl add service -h

Adds a service configuration to the Oracle Clusterware.

Usage: srvctl add service -d -s {-r "" [-a ""] [-P {BASIC | NONE | PRECONNECT}] | -g [-c {UNIFORM. SINGLETON}] } [-k   ] [-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]] [-y {AUTOMATIC | MANUAL}] [-q {TRUE|FALSE}] [-x {TRUE|FALSE}] [-j {SHORT|LONG}] [-B {NONE|SERVICE_TIME|THROUGHPUT}] [-e {NONE|SESSION|SELECT}] [-m {NONE|BASIC}] [-z ] [-w ] [-t ] [-f]
    -d       Unique name for the database
    -s              Service name
    -r ""    Comma separated list of preferred instances
    -a ""    Comma separated list of available instances
    -g            Server pool name
    -c {UNIFORM. SINGLETON} Service runs on every active server in the server pool hosting this service (UNIFORM) or just one server (SINGLETON)
    -k              network number (default number is 1)
    -P {NONE | BASIC | PRECONNECT}        TAF policy specification
    -l                 Role of the service (primary, physical_standby, logical_standby, snapshot_standby)
    -y               Management policy for the service (AUTOMATIC or MANUAL)
    -e        Failover type (NONE, SESSION, or SELECT)
    -m      Failover method (NONE or BASIC)
    -w              Failover delay
    -z              Failover retries
    -t              Edition (or "" for empty edition value)
    -j   Connection Load Balancing Goal (SHORT or LONG). Default is LONG.
    -B      Runtime Load Balancing Goal (SERVICE_TIME, THROUGHPUT, or NONE)
    -x   Distributed Transaction Processing (TRUE or FALSE)
    -q AQ HA notifications (TRUE or FALSE)
Usage: srvctl add service -d -s -u {-r "" | -a ""} [-f]
    -d       Unique name for the database
    -s              Service name
    -u                       Add a new instance to service configuration
    -r        Name of new preferred instance
    -a       Name of new available instance
    -f                       Force the add operation even though a listener is not configured for a network
    -h                       Print usage

[oracle@H096:/home/oracle]$srvctl add service -d test -s srv_test -r test1 -a test2,test3 -P basic -e select -m basic -z 180 -w 5


2、查看service状态和属性

[oracle@H096:/home/oracle]$crs_stat |grep svc
NAME=ora.test.srv_test.svc

[oracle@H096:/home/oracle]$srvctl start service -d test -s srv_test
[oracle@H096:/home/oracle]$crsctl status resource ora.test.srv_test.svc -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.test.srv_test.svc
      1        ONLINE  ONLINE       h096

SQL> select name, failover_method, failover_type, goal, clb_goal from dba_services

NAME      FAILOVER_M FAILOVER_T GOAL     CLB_G
---------------------------------------- ---------- ---------- ------------ -----
SYS$BACKGROUND             NONE     SHORT
SYS$USERS             NONE     SHORT
test             LONG
srv_test     BASIC     SELECT     NONE     LONG


[oracle@H096:/home/oracle]$srvctl status service -d test
Service srv_test is running on instance(s) test1
[oracle@H096:/home/oracle]$srvctl config service -d test -s srv_test
Service name: srv_test
Service is enabled
Server pool: test_srv_test
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: SELECT
Failover method: BASIC
TAF failover retries: 180
TAF failover delay: 5
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Preferred instances: test1
Available instances: test2,test3
[oracle@H096:/home/oracle]$lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 22-AUG-2013 16:10:34

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                21-AUG-2013 17:11:19
Uptime                    0 days 22 hr. 59 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/grid/diag/tnslsnr/H096/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.205.109)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.205.110)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM5", status READY, has 1 handler(s) for this service...
Service "srv_test" has 1 instance(s).
  Instance "test1", status READY, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
  Instance "test1", status READY, has 1 handler(s) for this service...
The command completed successfully


3、修改服务

--srvctl modify service -d test -s srv_test -r test2 -a test1 -P basic -e select -m basic -z 100 -w 2


4、删除服务

--srvctl remove service -d test -s srv_test -f
[oracle@H096:/home/oracle]$srvctl remove service -h

Removes the service from Oracle Clusterware management.

Usage: srvctl remove service -d -s [-i ] [-f]
    -d       Unique name for the database
    -s              Service name
    -i                 Instance name
    -f                       Force remove
    -h                       Print usage

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

转载于:http://blog.itpub.net/24996904/viewspace-769063/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值