生产环境Oracle RAC集群测试最佳方法(支持Oracle 11g/12c/18c/19c RAC安装后期测试过程)
一、Oracle RAC集群测试背景
某中大型制造业公司,由于要新上项目,建设了一套业务系统-ERP系统,这套系统的数据库环境是Oracle RAC(RHEL Linux7+Oracle11gR2 RAC)架构 ,根据风哥提供的建设方案项目已经建设完成。
这套ERP系统的RAC集群数据库在上线之前,我们需要对RAC集群做一些功能测试,这个测试方法适用于Oracle11g/12c,也适用于oracle18c/19c。
二、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卡,光纤线)、网络设备(网络交换机,光纤交换机,网线)郑州不 孕不 育医 院哪家好:http://jbk.39.net/yiyuanzaixian/zztjyy/
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集群环境用于学习和测试。