RAC 11.2.0.3 維護命令(三) SRVCTL管理services
一,建立服務
在例項1建立服務 team1
[oracle@node1 ~]$ srvctl add service -d PROD -s team1 -r "PROD1"
[oracle@node1 ~]$
[oracle@node1 ~]$ srvctl config database -d PROD
Database unique name: PROD
Database name:
Oracle home: /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: PROD
Database instances: PROD1,PROD2
Disk Groups: DATA,ARCH
Mount point paths:
Services: team1
Type: RAC
Database is administrator managed
在例項2建立服務team2
[oracle@node1 ~]$ srvctl add service -d PROD -s team2 -r "PROD2"
[oracle@node1 ~]$
[oracle@node1 ~]$ srvctl config database -d PROD
Database unique name: PROD
Database name:
Oracle home: /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: PROD
Database instances: PROD1,PROD2
Disk Groups: DATA,ARCH
Mount point paths:
Services: team1,team2
Type: RAC
Database is administrator managed
二,檢視服務狀態
剛剛建立好的服務team1, team2為離線狀態
[grid@node1 ~]$ crsctl status res ora.prod.team1.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team1.svc
1 OFFLINE OFFLINE
[grid@node1 ~]$ crsctl status res ora.prod.team2.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team2.svc
1 OFFLINE OFFLINE
三,啟動服務
啟動新建服務team1, team2
[grid@node1 ~]$ srvctl start service -d PROD -s team1
[grid@node1 ~]$ crsctl status res ora.prod.team1.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team1.svc
1 ONLINE ONLINE node1
[grid@node1 ~]$ srvctl start service -d PROD -s team2
[grid@node1 ~]$ crsctl status res ora.prod.team2.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team2.svc
1 ONLINE ONLINE node2
四,停止服務
停止新建服務team1, team2
[grid@node1 ~]$ srvctl stop service -d PROD -s team1
[grid@node1 ~]$ crsctl status res ora.prod.team1.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team1.svc
1 OFFLINE OFFLINE
[grid@node1 ~]$ srvctl stop service -d PROD -s team2
[grid@node1 ~]$ crsctl status res ora.prod.team2.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team2.svc
1 OFFLINE OFFLINE
五,禁用服務
[grid@node1 ~]$ srvctl disable service -d PROD -s team1
[grid@node1 ~]$ srvctl config service -d PROD
Service name: team1
Service is disabled
Server pool: PROD_team1
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: NONE
Edition:
Preferred instances: PROD1
Available instances:
Service name: team2
Service is enabled
Server pool: PROD_team2
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: NONE
Edition:
Preferred instances: PROD2
六,啟用服務
[grid@node1 ~]$ srvctl enable service -d PROD -s team1
[grid@node1 ~]$ srvctl config service -d PROD
Service name: team1
Service is enabled
Server pool: PROD_team1
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: NONE
Edition:
Preferred instances: PROD1
Available instances:
Service name: team2
Service is enabled
Server pool: PROD_team2
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: NONE
Edition:
Preferred instances: PROD2
Available instances:
七,檢視服務狀態
[grid@node1 ~]$ srvctl status service -d PROD
Service team1 is not running.
Service team2 is not running.
八,再次啟動服務team1,team2
[grid@node1 ~]$ srvctl start service -d prod -s team1
[grid@node1 ~]$ srvctl start service -d prod -s team2
[grid@node1 ~]$ srvctl status service -d PROD
Service team1 is running on instance(s) PROD1
Service team2 is running on instance(s) PROD2
透過資料字典檢視服務狀態
SYS@PROD1> col name format a20
SYS@PROD1> col network_name for a20
SYS@PROD1> select inst_id,service_id,name,network_name from gv$services;
INST_ID SERVICE_ID NAME NETWORK_NAME
---------- ---------- -------------------- --------------------
1 3 team1 team1
1 5 PRODXDB PRODXDB
1 6 PROD PROD
1 1 SYS$BACKGROUND
1 2 SYS$USERS
2 4 team2 team2
2 5 PRODXDB PRODXDB
2 6 PROD PROD
2 1 SYS$BACKGROUND
2 2 SYS$USERS
建立資料庫會預設建立與全域性資料庫同名的Service名稱,PROD。在查詢結果中可以看到例項1,例項2都有一個相同名字的服務PROD。team1,team2為手工建立。
在例項1建立服務 team1
[oracle@node1 ~]$ srvctl add service -d PROD -s team1 -r "PROD1"
[oracle@node1 ~]$
[oracle@node1 ~]$ srvctl config database -d PROD
Database unique name: PROD
Database name:
Oracle home: /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: PROD
Database instances: PROD1,PROD2
Disk Groups: DATA,ARCH
Mount point paths:
Services: team1
Type: RAC
Database is administrator managed
在例項2建立服務team2
[oracle@node1 ~]$ srvctl add service -d PROD -s team2 -r "PROD2"
[oracle@node1 ~]$
[oracle@node1 ~]$ srvctl config database -d PROD
Database unique name: PROD
Database name:
Oracle home: /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: PROD
Database instances: PROD1,PROD2
Disk Groups: DATA,ARCH
Mount point paths:
Services: team1,team2
Type: RAC
Database is administrator managed
二,檢視服務狀態
剛剛建立好的服務team1, team2為離線狀態
[grid@node1 ~]$ crsctl status res ora.prod.team1.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team1.svc
1 OFFLINE OFFLINE
[grid@node1 ~]$ crsctl status res ora.prod.team2.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team2.svc
1 OFFLINE OFFLINE
三,啟動服務
啟動新建服務team1, team2
[grid@node1 ~]$ srvctl start service -d PROD -s team1
[grid@node1 ~]$ crsctl status res ora.prod.team1.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team1.svc
1 ONLINE ONLINE node1
[grid@node1 ~]$ srvctl start service -d PROD -s team2
[grid@node1 ~]$ crsctl status res ora.prod.team2.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team2.svc
1 ONLINE ONLINE node2
四,停止服務
停止新建服務team1, team2
[grid@node1 ~]$ srvctl stop service -d PROD -s team1
[grid@node1 ~]$ crsctl status res ora.prod.team1.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team1.svc
1 OFFLINE OFFLINE
[grid@node1 ~]$ srvctl stop service -d PROD -s team2
[grid@node1 ~]$ crsctl status res ora.prod.team2.svc -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.team2.svc
1 OFFLINE OFFLINE
五,禁用服務
[grid@node1 ~]$ srvctl disable service -d PROD -s team1
[grid@node1 ~]$ srvctl config service -d PROD
Service name: team1
Service is disabled
Server pool: PROD_team1
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: NONE
Edition:
Preferred instances: PROD1
Available instances:
Service name: team2
Service is enabled
Server pool: PROD_team2
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: NONE
Edition:
Preferred instances: PROD2
六,啟用服務
[grid@node1 ~]$ srvctl enable service -d PROD -s team1
[grid@node1 ~]$ srvctl config service -d PROD
Service name: team1
Service is enabled
Server pool: PROD_team1
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: NONE
Edition:
Preferred instances: PROD1
Available instances:
Service name: team2
Service is enabled
Server pool: PROD_team2
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: NONE
Edition:
Preferred instances: PROD2
Available instances:
七,檢視服務狀態
[grid@node1 ~]$ srvctl status service -d PROD
Service team1 is not running.
Service team2 is not running.
八,再次啟動服務team1,team2
[grid@node1 ~]$ srvctl start service -d prod -s team1
[grid@node1 ~]$ srvctl start service -d prod -s team2
[grid@node1 ~]$ srvctl status service -d PROD
Service team1 is running on instance(s) PROD1
Service team2 is running on instance(s) PROD2
透過資料字典檢視服務狀態
SYS@PROD1> col name format a20
SYS@PROD1> col network_name for a20
SYS@PROD1> select inst_id,service_id,name,network_name from gv$services;
INST_ID SERVICE_ID NAME NETWORK_NAME
---------- ---------- -------------------- --------------------
1 3 team1 team1
1 5 PRODXDB PRODXDB
1 6 PROD PROD
1 1 SYS$BACKGROUND
1 2 SYS$USERS
2 4 team2 team2
2 5 PRODXDB PRODXDB
2 6 PROD PROD
2 1 SYS$BACKGROUND
2 2 SYS$USERS
建立資料庫會預設建立與全域性資料庫同名的Service名稱,PROD。在查詢結果中可以看到例項1,例項2都有一個相同名字的服務PROD。team1,team2為手工建立。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29047826/viewspace-1219610/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RAC 11.2.0.3 維護命令 (二)
- RAC 11.2.0.3 維護命令 (一)
- RAC維護管理命令
- RAC維護命令
- Oracle RAC維護命令Oracle
- RAC日常維護命令
- rac維護基本命令
- rac 命令 srvctl 報錯
- rac叢集日常維護命令
- rac常用維護工具和命令
- Oracle RAC維護命令集Oracle
- Oracle RAC日常基本維護命令Oracle
- 11G RAC OLR維護命令
- 【轉】Oracle RAC日常基本維護命令Oracle
- Oracle RAC 常用維護工具和命令Oracle
- RAC中的srvctl和crs命令
- 使用srvctl管理RAC資料庫資料庫
- 10G RAC: srvctl 命令總結
- RAC 11.2.0.3 管理OLR檔案
- RAC 11.2.0.3 管理OCR檔案
- ORACLE-RAC的CRS維護命令總結Oracle
- Oracle 10g RAC 相關維護命令Oracle 10g
- 【轉載】Oracle RAC 常用維護工具和命令Oracle
- RAC維護工具
- RAC常用開啟關閉命令 – SRVCTL用法
- RAC之srvctl 命令不能用的問題
- oracle 10g rac srvctl 命令總結Oracle 10g
- RAC: SRVCTL and VIPCA 命令報錯解決方法PCA
- RAC 11.2.0.3 ASM管理 (一) 引數ASM
- Oracle RAC中Srvctl命令詳細說明(轉)Oracle
- Oracle RAC 日常維護Oracle
- Oracle11g RAC常用操作 (維護及管理)Oracle
- oracle rac管理維護筆記_轉自網友Oracle筆記
- RAC常用開啟關閉命令 - CRSCTL和SRVCTL 用法
- (轉)ORACLE RAC 中 SRVCTL 命令詳細說明文件Oracle
- rac維護工具集系列(三)--叢集層crsctl系列
- OCR維護命令
- Oracle11g RAC下ASM 的管理與維護OracleASM