您好,登錄后才能下訂單哦!
生產環境Oracle RAC集群測試最佳方法(支持Oracle 11g/12c/18c/19c RAC安裝后期測試過程)
一、Oracle RAC集群測試背景
某中大型制造業公司,由于要新上項目,建設了一套業務系統-ERP系統,這套系統的數據庫環境是Oracle RAC(RHEL Linux7+Oracle11gR2 RAC)架構 ,根據風哥提供的建設方案項目已經建設完成。
這套ERP系統的RAC集群數據庫在上線之前,我們需要對RAC集群做一些功能測試,這個測試方法適用于Oracle11g/12c,也適用于oracle18c/19c,關于更多生產技術交流,請加入QQ群:787523185
二、Oracle RAC集群的介紹
在測試之前,這里風哥給大家介紹一下Oracle RAC是什么:Oracle 真正應用集群技術(Oracle Real Application Cluster )是Oracle 9i及以后版本,Oracle 9i之前叫OPS集群。Oracle RAC主要支持Oracle9i、10g、11g、12c版本(18c,19c)。 在Oracle RAC環境下,Oracle集群提供了集群軟件和存儲管理軟件,集群軟件CRS/GRID,存儲管理軟件ASM(自動存儲管理),多個節點共享一份數據。
ORACLE RAC架構如下:
其中Oracle RAC在物理架構上,硬件設備主要包括如下部分:
服務器、共享存儲設備(共享存儲,光纖交換機,HBA卡,光纖線)、網絡設備(網絡交換機,光纖交換機,網線)
1)服務器
我們稱這個服務器為“數據庫服務器”,“數據庫主機”,在RAC的術語中我們又稱其為“節點”,服務器的配置應該相同,cpu,內存等。
2)網絡設備
每臺服務器上至少兩塊物理網卡,分別用于主機間私有通信和對外公用通信,也可以有多快網卡,進行網卡綁定,實現網卡的冗余。
私有通信的網卡叫private NIC,對應的IP為private IP。
公用通信的網卡叫public NIC,對應的IP為public IP。
3)共享存儲設備
共享存儲是整個RAC架構中的核心
每臺服務器至少一塊/兩塊HBA卡,用于共享存儲的連接。
可以用光纖線直連存儲,也可以通過光纖交換機,我們建議使用光纖交換機。
RAC是一個典型的“多實例,單數據庫”架構,被所有節點共享,并行訪問。
數據庫數據文件,控制文件,參數文件,聯機重做日志文件,甚至歸檔日志文件都放在共享存儲
上,并保證可以被所有節點同時訪問。IO性能要求比較高,一般用光纖線連接。
另外Oracle RAC還有兩種集群模式:
Oracle? RAC 同時具備HA(High Availiablity) 、LB(LoadBalance)。
1)Failover(故障轉移):
它指集群中任何一個節點的故障都不會影響用戶的使用,連接到故障節點的用戶會被自動轉移到健康節點,從用戶感受而言, 是感覺不到這種切換。
2)LoadBalance(負載均衡):
就是把負載平均的分配到集群中的各個節點,從而提高整體的吞吐能力。
三、Oracle RAC集群功能測試
序號 | OracleRAC測試項目 | OracleRAC測試方法 | OracleRAC正確結果 | OracleRAC測試結果 |
1 | 檢查數據庫的版本和補丁 | select?*?from?v$version; | Oracle?11/12c相應版本 | 是否正常: |
2 | 數據庫啟動和關閉 | startup | 能正常啟動和關閉 | 是否正常: |
Shutdown?immediate | ||||
3 | 邏輯備份 | exp,expdp | 導出成功 | 是否正常: |
4 | 字符集 | select?name,value$?from | ZHS16GBK??、?UTF8 | 是否正常: |
props$ | ||||
where?name?like | ||||
'%CHARACTERSET%'; | ||||
5 | 創建/刪除 | create?tablespace?fgedudata01 | 創建成功 | 是否正常: |
表空間 | datafile?'+fgedudata1’? | 刪除成功 | ||
size?10m?autoextend?off; | ||||
drop?tablespace?fgedudata01 | ||||
including?contents?and?files; | ||||
6 | 創建/刪除用戶 | create?user?fgedu?identified | 創建成功 | 是否正常: |
?by?test?default?tablespace | 刪除成功 | |||
fgedudata01?temporary?tablespace?temp; | ||||
drop?user?fgedu?cascade; | ||||
7 | 創建/刪除表 | create?table?fgedu.itpux | 創建成功 | 是否正常: |
(name?varchar2(10),id?number); | 刪除成功 | |||
drop?table?fgedu.itpux; | ||||
8 | 插入/刪除數據 | Insert?into?fgedu.itpux?values('itpux01',’1); | 插入成功 | 是否正常: |
Commit; | 刪除成功 | |||
Delete?from?fgedu.itpux | ||||
Commit; | ||||
9 | 客戶端連接到 | sqlplus?“sys/oracle@itpuxdb?as?sysdba”; | 連接成功 | 是否正常: |
數據庫 | ||||
10 | 修改數據庫為歸檔模式 | Alter?system?set?db_recovery_file_dest='+dgrecover'?scope=spfile; | 歸檔模式 | 是否正常: |
alter?system?set?db_recovery_file_dest_size=200G?scope=spfile; | ||||
Srvctl?stop?database?-d?fgerpdb | ||||
Sqlplus?“/as?sysdba” | ||||
Startup?mount; | ||||
Alter?database?archivelog; | ||||
Shutdown?immediate | ||||
Srvctl?start?database?-d?fgerpdb |
四、Oracle RAC集群負載測試
序號 | OracleRAC測試內容 | OracleRAC測試方法 | OracleRAC正確結果 | OracleRAC測試結果 |
1 | 客戶端連接數據庫(RAC方式) | sqlplus?“sys/itpux123@itpuxdb?as?sysdba”; | 連接成功,并且每次連接有可能分布到不同的實例上 | 是否正常: |
select?instance_name?from?v$instance; | ||||
2 | CRS正常啟動關閉 | crsctl?start?crs | 能正常啟動和關閉 | 是否正常: |
crsctl?stop?crs | ||||
3 | 網絡連接中斷(public網絡) | 拔掉節點一public網卡的網線 | 本節點實例正常,vip漂移到節點二,listener,ons,network服務offline,原先連接到節點一的連接自動連接至節點二 | 是否正常: |
4 | 網絡連接恢復(public網絡) | 插回節點一public網卡的網線 | vip漂移回節點一,listener,ons,network服務自動onlien,crs資源恢復正常 | 是否正常: |
5 | 網絡連接中斷(private網絡) | 拔掉節點一private網卡的網線 | 節點二重啟,crs資源offline,vip漂移到節點一,原先連接到節點二的連接自動連接至節點1 | 是否正常: |
6 | 網絡連接恢復(private網絡) | 插回節點一private網卡的網線,使用crsctl?start?crs啟動crs | 節點二的vip漂移回節點二,節點二crs資源恢復正常 | 是否正常: |
7 | 網絡連接中斷(public網絡) | 拔掉節點二public網卡的網線 | 本節點實例正常,vip漂移到節點一,listener,ons,network服務offline,原先連接到節點二的連接自動連接至節點一 | 是否正常: |
8 | 網絡連接恢復(public網絡) | 插回節點二public網卡的網線 | vip漂移回節點二,listener,ons,network服務自動onlien,crs資源恢復正常 | 是否正常: |
9 | 網絡連接中斷(private網絡) | 拔掉節點二private網卡的網線 | 節點二重啟,crs資源offline,vip漂移到節點一,原先連接到節點二的連接自動連接至節點1 | 是否正常: |
10 | 網絡連接恢復(private網絡) | 插回節點二private網卡的網線,使用crsctl?start?crs啟動crs | 節點二的vip漂移回節點二,節點二crs資源恢復正常 | 是否正常: |
11 | 負載均衡 | 開啟多個數據庫連接 | 多次連接應分布在兩個節點 | 是否正常: |
12 | 透明故障切換 | 使用RAC的方式連接數據庫 | 連接不中斷,查詢繼續并自動切換至另一實例 | 是否正常: |
select?instance_name?from?v$instance; | ||||
關閉當前實例后 | ||||
select?instance_name?from?v$instance; | ||||
13 | 正常維護,正常關閉節點1 | Crsctl?stop?crs | Scan?vip,vip漂移到節點二,原先連接到節點一的連接自動連接至節點二 | 是否正常: |
14 | 正常維護,正常關閉節點2 | Crsctl?stop?crs | vip漂移到節點一,原先連接到節點二的連接自動連接至節點一 | 是否正常: |
針對測試列表中的第1點:客戶端連接到數據庫(RAC負載均衡測試)
Oracle 客戶端的tnsnames.ora模式如下:只需要配置scan對應的name或ip地址即可,如下所示:
fgerpdb?= ??(DESCRIPTION?= ????(ADDRESS_LIST?= ??????(ADDRESS?=?(PROTOCOL?=?TCP)(HOST?=?www.fgedu.net.cn)(PORT?=?1521)) ????) ????(CONNECT_DATA?= ??????(SERVER?=?DEDICATED) ??????(SERVICE_NAME?=?fgerpdb) ????) ??)
最終Oracle RAC的測試效果如下:
針對測試列表中的第12點:客戶端連接到數據庫(RAC透明切換測試),
客戶端tnsnames.ora配置
fgerpdbtaf=? ?(DESCRIPTION?=? ??(ADDRESS?=?(PROTOCOL?=?TCP)(HOST?=?www.fgedu.net.cn)(PORT?=?1521)) ??(LOAD_BALANCE?=?YES) ??(CONNECT_DATA?=? ???(SERVER?=?DEDICATED) ???(SERVICE_NAME?=?fgerpdb) ???(FAILOVER_MODE?=? ???(TYPE?=?SELECT)(METHOD?=?BASIC)(RETRIES?=?180)(DELAY?=?5) ???) ??) ?)
tnsping fgerpdbtaf? 測試連通性
連通ok后,再用第12點的方式測試透明故障切換
五、Oracle RAC集群維護命令
5.1.Oracle RAC常用命令工具
以下內容是風哥推薦大家需要熟悉的常用命令,日常工作中需要經常參考來使用。
$?srvctl?-h Usage:?srvctl?[-V] Usage:?srvctl?add?database?-d?<db_unique_name>?-o?<oracle_home>?[-m?<domain_name>]?[-p?<spfile>]?[-r?{PRIMARY?|?PHYSICAL_STANDBY?|?LOGICAL_STANDBY?|?SNAPSHOT_STANDBY}]?[-s?<start_options>]?[-t?<stop_options>]?[-n?<db_name>]?[-y?{AUTOMATIC?|?MANUAL}]?[-g?"<serverpool_list>"]?[-x?<node_name>]?[-a?"<diskgroup_list>"] Usage:?srvctl?config?database?[-d?<db_unique_name>?[-a]?] Usage:?srvctl?start?database?-d?<db_unique_name>?[-o?<start_options>] Usage:?srvctl?stop?database?-d?<db_unique_name>?[-o?<stop_options>]?[-f] Usage:?srvctl?status?database?-d?<db_unique_name>?[-f]?[-v] Usage:?srvctl?enable?database?-d?<db_unique_name>?[-n?<node_name>] Usage:?srvctl?disable?database?-d?<db_unique_name>?[-n?<node_name>] Usage:?srvctl?modify?database?-d?<db_unique_name>?[-n?<db_name>]?[-o?<oracle_home>]?[-u?<oracle_user>]?[-m?<domain>]?[-p?<spfile>]?[-r?{PRIMARY?|?PHYSICAL_STANDBY?|?LOGICAL_STANDBY?|?SNAPSHOT_STANDBY}]?[-s?<start_options>]?[-t?<stop_options>]?[-y?{AUTOMATIC?|?MANUAL}]?[-g?"<serverpool_list>"?[-x?<node_name>]]?[-a?"<diskgroup_list>"|-z] Usage:?srvctl?remove?database?-d?<db_unique_name>?[-f]?[-y] Usage:?srvctl?getenv?database?-d?<db_unique_name>?[-t?"<name_list>"] Usage:?srvctl?setenv?database?-d?<db_unique_name>?{-t?<name>=<val>[,<name>=<val>,...]?|?-T?<name>=<val>} Usage:?srvctl?unsetenv?database?-d?<db_unique_name>?-t?"<name_list>" Usage:?srvctl?add?instance?-d?<db_unique_name>?-i?<inst_name>?-n?<node_name>?[-f] Usage:?srvctl?start?instance?-d?<db_unique_name>?{-n?<node_name>?[-i?<inst_name>]?|?-i?<inst_name_list>}?[-o?<start_options>] Usage:?srvctl?stop?instance?-d?<db_unique_name>?{-n?<node_name>?|?-i?<inst_name_list>}??[-o?<stop_options>]?[-f] Usage:?srvctl?status?instance?-d?<db_unique_name>?{-n?<node_name>?|?-i?<inst_name_list>}?[-f]?[-v] Usage:?srvctl?enable?instance?-d?<db_unique_name>?-i?"<inst_name_list>" Usage:?srvctl?disable?instance?-d?<db_unique_name>?-i?"<inst_name_list>" Usage:?srvctl?modify?instance?-d?<db_unique_name>?-i?<inst_name>?{?-n?<node_name>?|?-z?} Usage:?srvctl?remove?instance?-d?<db_unique_name>?[-i?<inst_name>]?[-f]?[-y] Usage:?srvctl?add?service?-d?<db_unique_name>?-s?<service_name>?{-r?"<preferred_list>"?[-a?"<available_list>"]?[-P?{BASIC?|?NONE?|?PRECONNECT}]?|?-g?<server_pool>?[-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>] Usage:?srvctl?add?service?-d?<db_unique_name>?-s?<service_name>?-u?{-r?"<new_pref_inst>"?|?-a?"<new_avail_inst>"} Usage:?srvctl?config?service?-d?<db_unique_name>?[-s?<service_name>]?[-a] Usage:?srvctl?enable?service?-d?<db_unique_name>?-s?"<service_name_list>"?[-i?<inst_name>?|?-n?<node_name>] Usage:?srvctl?disable?service?-d?<db_unique_name>?-s?"<service_name_list>"?[-i?<inst_name>?|?-n?<node_name>] Usage:?srvctl?status?service?-d?<db_unique_name>?[-s?"<service_name_list>"]?[-f]?[-v] Usage:?srvctl?modify?service?-d?<db_unique_name>?-s?<service_name>?-i?<old_inst_name>?-t?<new_inst_name>?[-f] Usage:?srvctl?modify?service?-d?<db_unique_name>?-s?<service_name>?-i?<avail_inst_name>?-r?[-f] Usage:?srvctl?modify?service?-d?<db_unique_name>?-s?<service_name>?-n?-i?"<preferred_list>"?[-a?"<available_list>"]?[-f] Usage:?srvctl?modify?service?-d?<db_unique_name>?-s?<service_name>?[-c?{UNIFORM?|?SINGLETON}]?[-P?{BASIC|PRECONNECT|NONE}]?[-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?<integer>]?[-w?<integer>] 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] ???????Specify?instances?for?an?administrator-managed?database,?or?nodes?for?a?policy?managed?database Usage:?srvctl?remove?service?-d?<db_unique_name>?-s?<service_name>?[-i?<inst_name>]?[-f] Usage:?srvctl?start?service?-d?<db_unique_name>?[-s?"<service_name_list>"?[-n?<node_name>?|?-i?<inst_name>]?]?[-o?<start_options>] Usage:?srvctl?stop?service?-d?<db_unique_name>?[-s?"<service_name_list>"?[-n?<node_name>?|?-i?<inst_name>]?]?[-f] Usage:?srvctl?add?nodeapps?{?{?-n?<node_name>?-A?<name|ip>/<netmask>/[if1[|if2...]]?}?|?{?-S?<subnet>/<netmask>/[if1[|if2...]]?}?}?[-p?<portnum>]?[-m?<multicast-ip-address>]?[-e?<eons-listen-port>]?[-l?<ons-local-port>]??[-r?<ons-remote-port>]?[-t?<host>[:<port>][,<host>[:<port>]...]]?[-v] Usage:?srvctl?config?nodeapps?[-a]?[-g]?[-s]?[-e] Usage:?srvctl?modify?nodeapps?{[-n?<node_name>?-A?<new_vip_address>/<netmask>[/if1[|if2|...]]]?|?[-S?<subnet>/<netmask>[/if1[|if2|...]]]}?[-m?<multicast-ip-address>]?[-p?<multicast-portnum>]?[-e?<eons-listen-port>]?[?-l?<ons-local-port>?]?[-r?<ons-remote-port>?]?[-t?<host>[:<port>][,<host>[:<port>]...]]?[-v] Usage:?srvctl?start?nodeapps?[-n?<node_name>]?[-v] Usage:?srvctl?stop?nodeapps?[-n?<node_name>]?[-f]?[-r]?[-v] Usage:?srvctl?status?nodeapps Usage:?srvctl?enable?nodeapps?[-v] Usage:?srvctl?disable?nodeapps?[-v] Usage:?srvctl?remove?nodeapps?[-f]?[-y]?[-v] Usage:?srvctl?getenv?nodeapps?[-a]?[-g]?[-s]?[-e]?[-t?"<name_list>"] Usage:?srvctl?setenv?nodeapps?{-t?"<name>=<val>[,<name>=<val>,...]"?|?-T?"<name>=<val>"} Usage:?srvctl?unsetenv?nodeapps?-t?"<name_list>"?[-v] Usage:?srvctl?add?vip?-n?<node_name>?-k?<network_number>?-A?<name|ip>/<netmask>/[if1[|if2...]]?[-v] Usage:?srvctl?config?vip?{?-n?<node_name>?|?-i?<vip_name>?} Usage:?srvctl?disable?vip?-i?<vip_name>?[-v] Usage:?srvctl?enable?vip?-i?<vip_name>?[-v] Usage:?srvctl?remove?vip?-i?"<vip_name_list>"?[-f]?[-y]?[-v] Usage:?srvctl?getenv?vip?-i?<vip_name>?[-t?"<name_list>"] Usage:?srvctl?start?vip?{?-n?<node_name>?|?-i?<vip_name>?}?[-v] Usage:?srvctl?stop?vip?{?-n?<node_name>??|?-i?<vip_name>?}?[-f]?[-r]?[-v] Usage:?srvctl?status?vip?{?-n?<node_name>?|?-i?<vip_name>?} Usage:?srvctl?setenv?vip?-i?<vip_name>?{-t?"<name>=<val>[,<name>=<val>,...]"?|?-T?"<name>=<val>"} Usage:?srvctl?unsetenv?vip?-i?<vip_name>?-t?"<name_list>"?[-v] Usage:?srvctl?add?asm?[-l?<lsnr_name>] Usage:?srvctl?start?asm?[-n?<node_name>]?[-o?<start_options>] Usage:?srvctl?stop?asm?[-n?<node_name>]?[-o?<stop_options>]?[-f] Usage:?srvctl?config?asm?[-a] Usage:?srvctl?status?asm?[-n?<node_name>]?[-a] Usage:?srvctl?enable?asm?[-n?<node_name>] Usage:?srvctl?disable?asm?[-n?<node_name>] Usage:?srvctl?modify?asm?[-l?<lsnr_name>] Usage:?srvctl?remove?asm?[-f] Usage:?srvctl?getenv?asm?[-t?<name>[,?...]] Usage:?srvctl?setenv?asm?-t?"<name>=<val>?[,...]"?|?-T?"<name>=<value>" Usage:?srvctl?unsetenv?asm?-t?"<name>[,?...]" Usage:?srvctl?start?diskgroup?-g?<dg_name>?[-n?"<node_list>"] Usage:?srvctl?stop?diskgroup?-g?<dg_name>?[-n?"<node_list>"]?[-f] Usage:?srvctl?status?diskgroup?-g?<dg_name>?[-n?"<node_list>"]?[-a] Usage:?srvctl?enable?diskgroup?-g?<dg_name>?[-n?"<node_list>"] Usage:?srvctl?disable?diskgroup?-g?<dg_name>?[-n?"<node_list>"] Usage:?srvctl?remove?diskgroup?-g?<dg_name>?[-f] Usage:?srvctl?add?listener?[-l?<lsnr_name>]?[-s]?[-p?"[TCP:]<port>[,?...][/IPC:<key>][/NMP:<pipe_name>][/TCPS:<s_port>]?[/SDP:<port>]"]?[-o?<oracle_home>]?[-k?<net_num>] Usage:?srvctl?config?listener?[-l?<lsnr_name>]?[-a] Usage:?srvctl?start?listener?[-l?<lsnr_name>]?[-n?<node_name>] Usage:?srvctl?stop?listener?[-l?<lsnr_name>]?[-n?<node_name>]?[-f] Usage:?srvctl?status?listener?[-l?<lsnr_name>]?[-n?<node_name>] Usage:?srvctl?enable?listener?[-l?<lsnr_name>]?[-n?<node_name>] Usage:?srvctl?disable?listener?[-l?<lsnr_name>]?[-n?<node_name>] Usage:?srvctl?modify?listener?[-l?<lsnr_name>]?[-o?<oracle_home>]?[-p?"[TCP:]<port>[,?...][/IPC:<key>][/NMP:<pipe_name>][/TCPS:<s_port>]?[/SDP:<port>]"]?[-u?<oracle_user>]?[-k?<net_num>] Usage:?srvctl?remove?listener?[-l?<lsnr_name>?|?-a]?[-f] Usage:?srvctl?getenv?listener?[-l?<lsnr_name>]?[-t?<name>[,?...]] Usage:?srvctl?setenv?listener?[-l?<lsnr_name>]?-t?"<name>=<val>?[,...]"?|?-T?"<name>=<value>" Usage:?srvctl?unsetenv?listener?[-l?<lsnr_name>]?-t?"<name>[,?...]" Usage:?srvctl?add?scan?-n?<scan_name>?[-k?<network_number>?[-S?<subnet>/<netmask>[/if1[|if2|...]]]] Usage:?srvctl?config?scan?[-i?<ordinal_number>] Usage:?srvctl?start?scan?[-i?<ordinal_number>]?[-n?<node_name>] Usage:?srvctl?stop?scan?[-i?<ordinal_number>]?[-f] Usage:?srvctl?relocate?scan?-i?<ordinal_number>?[-n?<node_name>] Usage:?srvctl?status?scan?[-i?<ordinal_number>] Usage:?srvctl?enable?scan?[-i?<ordinal_number>] Usage:?srvctl?disable?scan?[-i?<ordinal_number>] Usage:?srvctl?modify?scan?-n?<scan_name> Usage:?srvctl?remove?scan?[-f]?[-y] Usage:?srvctl?add?scan_listener?[-l?<lsnr_name_prefix>]?[-s]?[-p?[TCP:]<port>[/IPC:<key>][/NMP:<pipe_name>][/TCPS:<s_port>]?[/SDP:<port>]] Usage:?srvctl?config?scan_listener?[-i?<ordinal_number>] Usage:?srvctl?start?scan_listener?[-n?<node_name>]?[-i?<ordinal_number>] Usage:?srvctl?stop?scan_listener?[-i?<ordinal_number>]?[-f] Usage:?srvctl?relocate?scan_listener?-i?<ordinal_number>?[-n?<node_name>] Usage:?srvctl?status?scan_listener?[-i?<ordinal_number>] Usage:?srvctl?enable?scan_listener?[-i?<ordinal_number>] Usage:?srvctl?disable?scan_listener?[-i?<ordinal_number>] Usage:?srvctl?modify?scan_listener?{-u|-p?[TCP:]<port>[/IPC:<key>][/NMP:<pipe_name>][/TCPS:<s_port>]?[/SDP:<port>]} Usage:?srvctl?remove?scan_listener?[-f]?[-y] Usage:?srvctl?add?srvpool?-g?<pool_name>?[-l?<min>]?[-u?<max>]?[-i?<importance>]?[-n?"<server_list>"] Usage:?srvctl?config?srvpool?[-g?<pool_name>] Usage:?srvctl?status?srvpool?[-g?<pool_name>]?[-a] Usage:?srvctl?status?server?-n?"<server_list>"?[-a] Usage:?srvctl?relocate?server?-n?"<server_list>"?-g?<pool_name>?[-f] Usage:?srvctl?modify?srvpool?-g?<pool_name>?[-l?<min>]?[-u?<max>]?[-i?<importance>]?[-n?"<server_list>"] Usage:?srvctl?remove?srvpool?-g?<pool_name> Usage:?srvctl?add?oc4j?[-v] Usage:?srvctl?config?oc4j Usage:?srvctl?start?oc4j?[-v] Usage:?srvctl?stop?oc4j?[-f]?[-v] Usage:?srvctl?relocate?oc4j?[-n?<node_name>]?[-v] Usage:?srvctl?status?oc4j?[-n?<node_name>] Usage:?srvctl?enable?oc4j?[-n?<node_name>]?[-v] Usage:?srvctl?disable?oc4j?[-n?<node_name>]?[-v] Usage:?srvctl?modify?oc4j?-p?<oc4j_rmi_port>?[-v] Usage:?srvctl?remove?oc4j?[-f]?[-v] Usage:?srvctl?start?home?-o?<oracle_home>?-s?<state_file>?-n?<node_name> Usage:?srvctl?stop?home?-o?<oracle_home>?-s?<state_file>?-n?<node_name>?[-t?<stop_options>]?[-f] Usage:?srvctl?status?home?-o?<oracle_home>?-s?<state_file>?-n?<node_name> Usage:?srvctl?add?filesystem?-d?<volume_device>?-v?<volume_name>?-g?<dg_name>?[-m?<mountpoint_path>]?[-u?<user>] Usage:?srvctl?config?filesystem?-d?<volume_device> Usage:?srvctl?start?filesystem?-d?<volume_device>?[-n?<node_name>] Usage:?srvctl?stop?filesystem?-d?<volume_device>?[-n?<node_name>]?[-f] Usage:?srvctl?status?filesystem?-d?<volume_device> Usage:?srvctl?enable?filesystem?-d?<volume_device> Usage:?srvctl?disable?filesystem?-d?<volume_device> Usage:?srvctl?modify?filesystem?-d?<volume_device>?-u?<user> Usage:?srvctl?remove?filesystem?-d?<volume_device>?[-f] Usage:?srvctl?start?gns?[-v]?[-l?<log_level>]?[-n?<node_name>] Usage:?srvctl?stop?gns?[-v]?[-n?<node_name>]?[-f] Usage:?srvctl?config?gns?[-v]?[-a]?[-d]?[-k]?[-m]?[-n?<node_name>]?[-p]?[-s]?[-V] Usage:?srvctl?status?gns?-n?<node_name> Usage:?srvctl?enable?gns?[-v]?[-n?<node_name>] Usage:?srvctl?disable?gns?[-v]?[-n?<node_name>] Usage:?srvctl?relocate?gns?[-v]?[-n?<node_name>]?[-f] Usage:?srvctl?add?gns?[-v]?-d?<domain>?-i?<vip_name|ip>?[-k?<network_number>?[-S?<subnet>/<netmask>[/<interface>]]] srvctl?modify?gns?[-v]?[-f]?[-l?<log_level>]?[-d?<domain>]?[-i?<ip_address>]?[-N?<name>?-A?<address>]?[-D?<name>?-A?<address>]?[-c?<name>?-a?<alias>]?[-u?<alias>]?[-r?<address>]?[-V?<name>]?[-F?<forwarded_domains>]?[-R?<refused_domains>]?[-X?<excluded_interfaces>] Usage:?srvctl?remove?gns?[-f]?[-d?<domain_name>] $?./crsctl?-h Usage:?crsctl?add???????-?add?a?resource,?type?or?other?entity ???????crsctl?check?????-?check?a?service,?resource?or?other?entity ???????crsctl?config????-?output?autostart?configuration ???????crsctl?debug?????-?obtain?or?modify?debug?state ???????crsctl?delete????-?delete?a?resource,?type?or?other?entity ???????crsctl?disable???-?disable?autostart ???????crsctl?enable????-?enable?autostart ???????crsctl?get???????-?get?an?entity?value ???????crsctl?getperm???-?get?entity?permissions ???????crsctl?lsmodules?-?list?debug?modules ???????crsctl?modify????-?modify?a?resource,?type?or?other?entity ???????crsctl?query?-?query?service?state ???????crsctl?pin?-?Pin?the?nodes?in?the?nodelist ???????crsctl?relocate?-?relocate?a?resource,?server?or?other?entity ???????crsctl?replace??-?replaces?the?location?of?voting?files ???????crsctl?setperm???-?set?entity?permissions ???????crsctl?set???????-?set?an?entity?value ???????crsctl?start?????-?start?a?resource,?server?or?other?entity ???????crsctl?status????-?get?status?of?a?resource?or?other?entity ???????crsctl?stop??????-?stop?a?resource,?server?or?other?entity ???????crsctl?unpin?????-?unpin?the?nodes?in?the?nodelist ???????crsctl?unset?????-?unset?a?entity?value,?restoring?its?default
5.2.Oracle RAC集群日常維護命令
以下內容是風哥推薦大家必須要記住的常用操作,日常工作中必須經常使用。
1.停止數據庫上的所有節點和啟動數據庫上的所有節點 Srvctl?stop?database?-d?fgedu?–o?immediate Srvctl?start?database?-d?fgedu 2.停止數據庫上的所有asm磁盤組和啟動數據庫上的所有磁盤組 Srvctl?stop?asm?–g?crs Srvctl?stop?asm?–g?dgsystem Srvctl?stop?asm?–g?fgedudata1 Srvctl?stop?asm?–g?dgrecover Srvctl?start?asm?–g?crs Srvctl?start?asm?–g?dgsystem Srvctl?start?asm?–g?fgedudata1 Srvctl?start?asm?–g?dgrecover 3.停止對應節點上的listener和啟動對應節點上的listener Srvctl?stop?listener?-n?fgerp61 Srvctl?stop?listener?-n?fgerp62 Srvctl?start?listener?-n?fgerp61 Srvctl?start?listener?-n?fgerp62 4.停止scan_listener和啟動scan_listener Srvctl?stop?scan_listener? Srvctl?start?scan_listener 5.停止scan和啟動scan Srvctl?stop?scan Srvctl?start?scan 6.停止對應節點上的資源和啟動對應節點上的資源 Srvctl?stop?nodeapps?-n?fgerp62 Srvctl?stop?nodeapps?-n?fgerp61 Srvctl?start?nodeapps?-n?fgerp62 Srvctl?start?nodeapps?-n?fgerp61 7.停止crs和啟動crs 停止crs crsctl?stop?crs Crsctl?stop?crs的方式能把所有grid進程都關閉掉 啟動crs crsctl?start?crs 8.檢查crs資源狀態 crsctl?status?resource?-t crs_stat?–t 9、用asmcmd工具管理asm磁盤組 查看磁盤組容量 asmcmd?lsdg
如果大家已經有一套Oracle RAC集群環境了,即可按照上面的過程來測試,如果還沒有這套環境,可以參照風哥的Oracle RAC教程:生產環境Linux+Oracle 11gR2 RAC集群安裝配置與維護(https://edu.51cto.com/course/3733.html),來搭建Oracle RAC集群環境用于學習和測試。
更多技術交流,請加入QQ群:787523185
或者掃描加入微信群:
相關課程推薦:
01.Oracle數據庫集群容災實施與維護V3.0(RAC+DG+OGG)
https://edu.51cto.com/topic/1943.html
02.Oracle12.2數據庫實施維護(項目實戰系列)專題2.0?
https://edu.51cto.com/topic/1944.html
03.MySQL高可用復制與分布式集群架構項目實戰系列?
https://edu.51cto.com/topic/1622.html
04.MySQL數據庫性能優化與運維診斷實戰系列
https://edu.51cto.com/topic/1752.html?
05.NoSQL數據庫集群與維護管理(項目實戰)專題1.0
https://edu.51cto.com/topic/1950.html?
06.Oracle RAC集群實施與維護(項目實戰系列)專題1.0?
https://edu.51cto.com/topic/1945.html??
07.Oracle DataGuard容災項目實施與維護專題1.0
https://edu.51cto.com/topic/1946.html??
08.GoldenGate數據容災與復制(項目實戰)專題1.0
https://edu.51cto.com/topic/1949.html
09.Oracle RAC+DataGuard集群容災項目2.0
https://edu.51cto.com/topic/1948.html??
11.Oracle12c+DataGuard容災實施與維護2.0
https://edu.51cto.com/topic/1947.html??
12.Oracle數據庫補丁升級與管理實戰實戰專題(單機+RAC)
https://edu.51cto.com/topic/1154.html??
13.企業級中間件應用WebLogic11g/12c集群安裝布署配置專題
https://edu.51cto.com/topic/276.html?
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。