这篇文章给大家介绍Oracle 11g RAC如何手动添加service,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
11.2.0.4 RAC
dbname:XXXXXXDB
添加服务:
ordXX:ordXX
orXX:orXX
dsXX:dsXX
[oracle@jdordXX2 ~]$ srvctl add service -h
Adds a service configuration to the Oracle Clusterware.
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
[oracle@jdordXX2 ~]$ srvctl add service -d XXXXXXDB -s ordXX -r XXXXXXDB1 -a XXXXXXDB2 -P basic -e select -m basic -z 180 -w 5
[oracle@jdordXX2 ~]$ srvctl add service -d XXXXXXDB -s dsXX -r XXXXXXDB1 -a XXXXXXDB2 -P basic -e select -m basic -z 180 -w 5
[oracle@jdordXX2 ~]$ srvctl start service -d XXXXXXDB -s ordXX
[oracle@jdordXX2 ~]$ srvctl start service -d XXXXXXDB -s dsXX
[oracle@jdordXX2 ~]$ srvctl add service -d XXXXXXDB -s orXX -r XXXXXXDB1 -a XXXXXXDB2 -P basic -e select -m basic -z 180 -w 5
[oracle@jdordXX2 ~]$ srvctl start service -d XXXXXXDB -s orXX
[oracle@jdordXX1 ~]$ srvctl relocate service -d XXXXXXDB -s Gaoyc -i XXXXXXDB1 -t XXXXXXDB2
[oracle@jdordXX2 ~]$ srvctl add service -d XXXXXXDB -s Gaoyc -r XXXXXXDB1,XXXXXXDB2 -P basic -e select -m basic -z 180 -w 5
[oracle@jdordXX1 ~]$ srvctl add service -d XXXXXXDB -s Gaoyc -r "XXXXXXDB1,XXXXXXDB2" -a "XXXXXXDB2,XXXXXXDB1" -P basic -e select -m basic -z 180 -w 5
PRKO-2102 : Failed to create server pool XXXXXXDB_Gaoyc: PRCS-1009 : Failed to create server pool ora.XXXXXXDB_Gaoyc
PRCR-1071 : Failed to register or update server pool ora.XXXXXXDB_Gaoyc
CRS-2714: 'jdordXX2' is specified multiple times in 'SERVER_NAMES' of 'ora.XXXXXXDB_Gaoyc'
##-r参数和-a参数不允许重复
[oracle@jdordXX1 ~]$ srvctl add service -d XXXXXXDB -s Gaoyc -r "XXXXXXDB1,XXXXXXDB2" -P basic -e select -m basic -z 180 -w 5
[oracle@jdordXX1 ~]$ srvctl remove service -d XXXXXXDB -s Gaoyc
[oracle@jdordXX1 ~]$
[oracle@jdordXX1 ~]$ srvctl relocate service -h
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]
-d <db_unique_name> Unique name for the database
-s <service> Service name
-i <old_inst> Old instance name
-t <new_inst> New instance name
-c <current_node> Node name to relocate service from
-n <target_node> Node name to relocate service to
-f Disconnect all sessions during stop or relocate service operations
-h Print usages
[grid@jdordXX1 ~]$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE jdordXX1
ONLINE ONLINE jdordXX2
ora.LISTENER.lsnr
ONLINE ONLINE jdordXX1
ONLINE ONLINE jdordXX2
ora.asm
ONLINE ONLINE jdordXX1 Started
ONLINE ONLINE jdordXX2 Started
ora.gsd
OFFLINE OFFLINE jdordXX1
OFFLINE OFFLINE jdordXX2
ora.net1.network
ONLINE ONLINE jdordXX1
ONLINE ONLINE jdordXX2
ora.ons
ONLINE ONLINE jdordXX1
ONLINE ONLINE jdordXX2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE jdordXX1
ora.cvu
1 ONLINE ONLINE jdordXX1
ora.jdordXX1.vip
1 ONLINE ONLINE jdordXX1
ora.jdordXX2.vip
1 ONLINE ONLINE jdordXX2
ora.oc4j
1 ONLINE ONLINE jdordXX1
ora.XXXXXXDB.db
1 ONLINE ONLINE jdordXX1 Open
2 ONLINE ONLINE jdordXX2 Open
ora.XXXXXXDB.dsXX.svc
1 ONLINE ONLINE jdordXX1
ora.XXXXXXDB.ordXX.svc
1 ONLINE ONLINE jdordXX1
ora.scan1.vip
1 ONLINE ONLINE jdordXX1
[grid@jdordXX1 ~]$
[grid@jdordXX1 ~]$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE jdordXX1
ONLINE ONLINE jdordXX2
ora.LISTENER.lsnr
ONLINE ONLINE jdordXX1
ONLINE ONLINE jdordXX2
ora.asm
ONLINE ONLINE jdordXX1 Started
ONLINE ONLINE jdordXX2 Started
ora.gsd
OFFLINE OFFLINE jdordXX1
OFFLINE OFFLINE jdordXX2
ora.net1.network
ONLINE ONLINE jdordXX1
ONLINE ONLINE jdordXX2
ora.ons
ONLINE ONLINE jdordXX1
ONLINE ONLINE jdordXX2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE jdordXX1
ora.cvu
1 ONLINE ONLINE jdordXX1
ora.jdordXX1.vip
1 ONLINE ONLINE jdordXX1
ora.jdordXX2.vip
1 ONLINE ONLINE jdordXX2
ora.oc4j
1 ONLINE ONLINE jdordXX1
ora.XXXXXXDB.db
1 ONLINE ONLINE jdordXX1 Open
2 ONLINE ONLINE jdordXX2 Open
ora.XXXXXXDB.funtune.svc
1 ONLINE ONLINE jdordXX1
2 ONLINE ONLINE jdordXX2
ora.scan1.vip
1 ONLINE ONLINE jdordXX1
[oracle@jdordXX2 ~]$ srvctl remove service -d XXXXXXDB -s funtune
PRCR-1025 : Resource ora.XXXXXXDB.funtune.svc is still running
[oracle@jdordXX2 ~]$ srvctl stop service -d XXXXXXDB -s funtune;
[oracle@jdordXX2 ~]$ srvctl remove service -d XXXXXXDB -s funtune
[oracle@jdordXX2 ~]$ srvctl config service -d XXXXXXDB -s ordXX
Service name: ordXX
Service is enabled
Server pool: XXXXXXDB_ordXX
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: XXXXXXDB1
Available instances: XXXXXXDB2
[oracle@jdordXX2 ~]$ srvctl remove service -d XXXXXXDB -s ordXX
[oracle@jdordXX2 ~]$ srvctl add service -d XXXXXXDB -s ordXX -r XXXXXXDB1 -a XXXXXXDB2 -P basic -e select -m basic -z 180 -w 5
[oracle@jdordXX2 ~]$ srvctl config service -d XXXXXXDB -s ordXX
Service name: ordXX
Service is enabled
Server pool: XXXXXXDB_ordXX
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: XXXXXXDB1
Available instances: XXXXXXDB2
关于Oracle 11g RAC如何手动添加service就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/203746.html