您好,登錄后才能下訂單哦!
Oracle 11gR2 RAC集群服務啟動與關閉是怎樣的,針對這個問題,這篇文章詳細介紹了相對應的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
Oracle 11gR2 RAC集群服務啟動與關閉總結
關閉過程(CRS集群關閉->關閉數(shù)據(jù)庫)
1.關閉數(shù)據(jù)庫:
用oracl用戶執(zhí)行srvctl命令
語法:srvctl stop database -d dbname [-o immediate]
作用:可以一次性關閉dbname的所有實例
[oracle@rac1 ~]$ srvctl stop database -d racdb -停止所有節(jié)點上的實例
然后查看狀態(tài):
[oracle@rac1 ~]$ srvctl status database -d racdb
Instance rac1 is not running on node rac1
Instance rac2 is not running on node race
2.停止HAS(High Availability Services),必須以root用戶操作
[root@rac1 oracle]# cd /u01/grid/11.2.0/grid/bin
[root@rac1 bin]# ./crsctl stop has -f
[root@rac1 bin]# ./crsctl stop crs -f
本命令只能關閉當前節(jié)點的CRS服務,因此需要在RAC的所有節(jié)點上執(zhí)行,啟動也一樣。has與crs等同
3.停止節(jié)點集群服務,必須以root用戶:
[root@rac1 oracle]# cd /u01/grid/11.2.0/grid/bin
[root@rac1 bin]# ./crsctl stop cluster ----停止本節(jié)點集群服務
[root@rac1 bin]# ./crsctl stop cluster -all ---停止所有節(jié)點服務
也可以如下控制所停節(jié)點:
[root@rac1 bin]# crsctl stop cluster -n rac1 rac2
CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.cssd' on 'rac2' succeeded
省略日志輸出
你如果想一條命令把所有的進程全部停止可以使用上述命令。如果不指定參數(shù)的話對當前節(jié)點有效,如果指定參數(shù)的話對相關參數(shù)節(jié)點有效。
4.檢查集群進程狀態(tài)
[root@rac1 bin]# crsctl check cluster
詳細輸出
[root@rac1 bin]# crs_stat -t -v
只檢查本節(jié)點的集群狀態(tài)
[root@rac1 bin]# crsctl check crs
啟動過程(CRS集群啟動->啟動數(shù)據(jù)庫)
1.啟動HAS
單一節(jié)點啟動
[root@rac2 ~]# crsctl start has
[root@rac2 ~]# crsctl start crs
[root@rac2 ~]# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
所有節(jié)點啟動
[root@rac1 bin]# crsctl start cluster -n rac1 rac2
CRS-4123: Oracle High Availability Services has been started.
[root@rac1 bin]# crsctl start cluster -all
[root@rac2 ~]# crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
此命令會在后臺啟動所有RAC CRS相關進程
[root@rac2 ~]# crs_stat -t -v
CRS-0184: Cannot communicate with the CRS daemon.
因為start has啟動的crs進程比較多因此會啟動的比較慢,我的機器等待了5分鐘,在沒有完全啟動成功之前會報上述錯誤,需要耐心等待一段時間后執(zhí)行下面命令即可查看到所有CRS相關進程服務已經(jīng)啟動。
[root@rac2 ~]# crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac2
ora....N2.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1
ora....N3.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1
ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac1
ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE rac1
ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2
ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac2
ora....ry.acfs ora....fs.type 0/5 0/ ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac2
ora.scan2.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac1
ora.scan3.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac1
說明:
英文解釋
ora.gsd is OFFLINE by default ifthere is no 9i database in the cluster.
ora.oc4j is OFFLINE in 11.2.0.1 as DatabaseWorkload Management(DBWLM) is unavailable. these can be ignored in11gR2 RAC.
中文解釋
ora.gsd是集群服務中用于與9i數(shù)據(jù)庫進行通信的一個進程,在當前版本中為了向后兼容才保存下來,狀態(tài)為OFFLINE不影響CRS的正常運行與性能,我們忽略即可
ora.oc4j是在11.2.0.2以上版本中有效的服務進程,用于DBWLM的資源管理,因此在11.2.0.1以下版本并沒有使用
2.啟動數(shù)據(jù)庫:
oracl用戶執(zhí)行srvctl命令:
語法:srvctl start|stop|status database -d dbname [-o immediate]
作用:可以一次性啟動dbname的所有實例
[oracle@rac1 ~]$ srvctl start database -d racdb -啟動所有節(jié)點上的實例
然后查看狀態(tài):
[oracle@rac1 ~]$ srvctl status database -d racdb
3.詳細輸出資源全名稱并檢查狀態(tài)
crsctl status resource -t
crsctl status resource
4.常用srvctl命令
指定dbname上某個實例
srvctl start|stop|status instance -d <dbname> -i <instance_name>
5.顯示RAC下所有實例配置與狀態(tài)
srvctl status|config database -d <dbname>
6.顯示所有節(jié)點的應用服務(VIP,GSD,listener,ONS)
srvctl start|stop|status nodeapps -n<node_name>
7.ASM進程服務管理
srvctl start|stop|status|config asm -n <nodename>[-i <asm_inst_name>] [-o<oracle_home>]
srvctl config asm -a
srvctl status asm -a
6.可以獲取所有的環(huán)境信息:
srvctl getenv database -d <dbname> [-i<instance_name>]
7.設置全局環(huán)境和變量:
srvctl setenv database -d<dbname> -t LANG=en
8.在OCR中刪除已有的數(shù)據(jù)庫信息
srvctl remove database -d <dbname>
9.向OCR中添加一個數(shù)據(jù)庫的實例:
srvctl add instance -d <dbname> -i<instance_name> -n <node1>
srvctl add instance -d <dbname> -i<instance_name> -n <node2>
10.檢查監(jiān)聽的狀態(tài)
srvctl status listener
srvctl config listener -a
SCAN配置信息
srvctl config scan
SCAN listener狀態(tài)信息
srvctl status scan
小結:crsctl命令是一個集群級別命令,可以對所有集群資源進行統(tǒng)一啟動、停止等管理操作
srvctl命令是一個服務級別命令,可以對單一服務資源進行統(tǒng)一啟動、停止等管理操作
附:srvctl命令啟動與停止的詳細幫助
[root@rac2 ~]# srvctl start -h
The SRVCTL start command starts, Oracle Clusterware enabled, non-running objects.
Usage: srvctl start database -d <db_unique_name> [-o <start_options>] [-n <node>]
Usage: srvctl start instance -d <db_unique_name> {-n <node_name> [-i <inst_name>] | -i <inst_name_list>} [-o <start_options>]
Usage: srvctl start service -d <db_unique_name> [-s "<service_name_list>" [-n <node_name> | -i <inst_name>] ] [-o <start_options>]
Usage: srvctl start nodeapps [-n <node_name>] [-g] [-v]
Usage: srvctl start vip { -n <node_name> | -i <vip_name> } [-v]
Usage: srvctl start asm [-n <node_name>] [-o <start_options>]
Usage: srvctl start listener [-l <lsnr_name>] [-n <node_name>]
Usage: srvctl start scan [-i <ordinal_number>] [-n <node_name>]
Usage: srvctl start scan_listener [-n <node_name>] [-i <ordinal_number>]
Usage: srvctl start oc4j [-v]
Usage: srvctl start home -o <oracle_home> -s <state_file> -n <node_name>
Usage: srvctl start filesystem -d <volume_device> [-n <node_name>]
Usage: srvctl start diskgroup -g <dg_name> [-n "<node_list>"]
Usage: srvctl start gns [-l <log_level>] [-n <node_name>] [-v]
Usage: srvctl start cvu [-n <node_name>]
For detailed help on each command and object and its options use:
srvctl <command> <object> -h
[root@rac2 ~]# srvctl stop -h
The SRVCTL stop command stops, Oracle Clusterware enabled, starting or running objects.
Usage: srvctl stop database -d <db_unique_name> [-o <stop_options>] [-f]
Usage: srvctl stop instance -d <db_unique_name> {-n <node_name> | -i <inst_name_list>} [-o <stop_options>] [-f]
Usage: srvctl stop service -d <db_unique_name> [-s "<service_name_list>" [-n <node_name> | -i <inst_name>] ] [-f]
Usage: srvctl stop nodeapps [-n <node_name>] [-g] [-f] [-r] [-v]
Usage: srvctl stop vip { -n <node_name> | -i <vip_name> } [-f] [-r] [-v]
Usage: srvctl stop asm [-n <node_name>] [-o <stop_options>] [-f]
Usage: srvctl stop listener [-l <lsnr_name>] [-n <node_name>] [-f]
Usage: srvctl stop scan [-i <ordinal_number>] [-f]
Usage: srvctl stop scan_listener [-i <ordinal_number>] [-f]
Usage: srvctl stop oc4j [-f] [-v]
Usage: srvctl stop home -o <oracle_home> -s <state_file> -n <node_name> [-t <stop_options>] [-f]
Usage: srvctl stop filesystem -d <volume_device> [-n <node_name>] [-f]
Usage: srvctl stop diskgroup -g <dg_name> [-n "<node_list>"] [-f]
Usage: srvctl stop gns [-n <node_name>] [-f] [-v]
Usage: srvctl stop cvu [-f]
For detailed help on each command and object and its options use:
srvctl <command> <object> -h
關于Oracle 11gR2 RAC集群服務啟動與關閉是怎樣的問題的解答就分享到這里了,希望以上內容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關注億速云行業(yè)資訊頻道了解更多相關知識。
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內容。