1、修改service_names:
SYS@crm3eop2> alter system set service_names='crm3eop_taf' sid='crm3eop2' scope=spfile; System altered. Elapsed: 00:00:00.02 |
Usage: srvctl add service -d <db_unique_name> -s <service_name> {-r "<preferred_list>" [-a "<available_list>"] [-P {BASIC | NONE | PRECONNECT}] | -g <pool_name> [-c {UNIFORM | SINGLETON}] } [-k <net_num>] [-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 <failover_retries>] [-w <failover_delay>] [-t <edition>] [-f] -d <db_unique_name> Unique name for the database -s <service> Service name -r "<preferred_list>" Comma separated list of preferred instances -a "<available_list>" Comma separated list of available instances -g <pool_name> 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 <net_num> network number (default number is 1) -P {NONE | BASIC | PRECONNECT} TAF policy specification -l <role> Role of the service (primary, physical_standby, logical_standby, snapshot_standby) -y <policy> Management policy for the service (AUTOMATIC or MANUAL) -e <Failover type> Failover type (NONE, SESSION, or SELECT) -m <Failover method> Failover method (NONE or BASIC) -w <integer> Failover delay -z <integer> Failover retries -t <edition> Edition (or "" for empty edition value) -j <clb_goal> Connection Load Balancing Goal (SHORT or LONG). Default is LONG. -B <Runtime Load Balancing Goal> Runtime Load Balancing Goal (SERVICE_TIME, THROUGHPUT, or NONE) -x <Distributed Transaction Processing> Distributed Transaction Processing (TRUE or FALSE) -q <AQ HA notifications> AQ HA notifications (TRUE or FALSE) Usage: srvctl add service -d <db_unique_name> -s <service_name> -u {-r "<new_pref_inst>" | -a "<new_avail_inst>"} [-f] -d <db_unique_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 -f Force the add operation even though a listener is not configured for a network -h Print usage |
2、添加服务:
grid@acctdb1:/export/home/grid $srvctl add service -d crm3eop -s crm3eop_taf -r crm3eop2 -a crm3eop1 -P basic -e select -m basic -z 180 -w 5 PRCD-1248 : User is not authorized to create service crm3eop_taf for database crm3eop PRKH-1014 : Current user "grid" is not the oracle owner user "oracle" of oracle home "/u01/app/oracle/product/11.2.0/db_1" grid@acctdb1:/export/home/grid $logout acctdb1:/root # acctdb1:/root # su - oracle You have logged onto a secured server..All accesses logged You have new mail. oracle@acctdb1:/export/home/oracle $cd /u01/app/oracle/product/11.2.0/db_1 oracle@acctdb1:/u01/app/oracle/product/11.2.0/db_1 $cd bin oracle@acctdb1:/u01/app/oracle/product/11.2.0/db_1/bin $./srvctl add service -d crm3eop -s crm3eop_taf -r crm3eop2 -a crm3eop1 -P basic -e select -m basic -z 180 -w 5 |
-d 数据库 -s 服务名 -r 优先节点 -a 次要节点 -P basic -e select -m basic -z 180 -w 5
3、启动服务
grid@acctdb1:/export/home/grid $srvctl start service -d crm3eop
4、查看服务
grid@acctdb1:/export/home/grid $crsctl stat res -t 。。。。。。。。。。 ora.crm3eop.crm3eop_taf.svc 。。。。。。。。。。 |
5、查看配置:
grid@acctdb1:/export/home/grid $srvctl config service -d crm3eop -a Warning:-a option has been deprecated and will be ignored. Service name: crm3eop_taf Service is enabled Server pool: crm3eop_crm3eop_taf 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 Edition: Preferred instances: crm3eop2 Available instances: crm3eop1 grid@acctdb1:/export/home/grid $ |
6、删除服务:srvctl remove service -d rac -s rac_taf
7、更改服务连接实例:
srvctl relocate service -d crm3eop -s crm3eop2 -i crm3eop1 -t ngrewdb1 -f
[grid@rac1 ~]$ srvctl relocate service -help Temporarily relocates service from one node of the cluster to another. Usage: srvctl relocate service -d <db_unique_name> -s <service_name> {-i <old_inst_name> -t <new_inst_name> | -c <current_node> -n <target_node>} [-f] |