Summary of Oracle 11gR2 RAC cluster Service Startup and Shutdown
Introduction: the source of this article is that one of my students recently set up a RAC cluster in the company, but the sequence and principle of its startup and shutdown are not very clear, I also found that many students have little knowledge about RAC, so I will list the most common startup and shutdown orders and commands involved in RAC one by one, due to the large number of background resources of RAC, there are also a lot of commands involved. The help manual is attached so that it can be quickly found during temporary use at work, if this article can help you, it will be my motivation to continue working hard in the future. Thank you for your valuable comments on my article.
Close process (CRS cluster close-> close database)
1. Close the database:
Run the srvctl command with the CMDL user
Syntax: srvctl stop database-d dbname [-o immediate]
Purpose: Disable all dbname instances at a time.
[Oracle @ rac1 ~] $ Srvctl stop database-d racdb-stop instances on all nodes
Then check the status:
[Oracle @ rac1 ~] $ Srvctl status database-d racdb
Instance rac1 is not running on node rac1
Instance rac2 is not running on node race
2. Stop HAS (High Availability Services), which must be operated by the root user.
[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
This command can only shut down the CRS service of the current node. Therefore, it needs to be executed on all the nodes of RAC, and the same is true for startup. Has is equivalent to crs
3. To stop the node cluster service, you must use the root user:
[Root @ rac1 oracle] # cd/u01/grid/11.2.0/grid/bin
[Root @ rac1 bin] #./crsctl stop cluster ---- stop the cluster service on this node
[Root @ rac1 bin] #./crsctl stop cluster-all --- stop all node services
You can also control the stopped nodes as follows:
[Root @ rac1 bin] # crsctl stop cluster-n rac1 rac2
CRS-2677: Stop of 'ora.css d' on 'rac1' succeeded
CRS-2677: Stop of 'ora.css d' on 'rac2' succeeded
........... Omitted log output ..............
If you want to run a command to stop all processes, you can use the preceding command. If no parameter is specified, the parameter is valid for the current node. If yes, the parameter is valid for the relevant parameter node.
4. Check the cluster process status
[Root @ rac1 bin] # crsctl check cluster
Detailed output
[Root @ rac1 bin] # crs_stat-t-v
Only check the cluster status of the current node
[Root @ rac1 bin] # crsctl check crs
Startup Process (CRS cluster startup-> database startup)
1. Start HAS
Start a Single Node
[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.
Start all nodes
[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.
This command will start all rac crs-related processes in the background
[Root @ rac2 ~] # Crs_stat-t-v
CRS-0184: Cannot communicate with the CRS daemon.
Because the crs process started by start has is too many, it will start slowly. My machine waited for 5 minutes and reported the above error before the startup was successful, wait for a while and run the following command to check that all CRS-related process services have been started.
[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 rac1
Ora... ER. lsnr ora... er. type 0/5 0/ONLINE rac1
Ora... N1.lsnr ora... er. type 0/5 0/0 ONLINE rac2
Ora... N2.lsnr ora... er. type 0/5 0/0 ONLINE rac1
Ora... N3.lsnr ora... er. type 0/5 0/0 ONLINE rac1
Ora. asm ora. asm. type 0/5 0/ONLINE rac1
Ora. cvu ora. cvu. type 0/5 0/0 ONLINE rac1
Ora. gsd ora. gsd. type 0/5 0/OFFLINE
Ora... network ora... rk. type 0/5 0/ONLINE rac1
Ora. Solaris ora. productname. type 0/1 0/2 ONLINE rac1
Ora. ons ora. ons. type 0/3 0/ONLINE rac1
Ora... SM1.asm application 0/5 0/0 ONLINE rac1
Ora... C1.lsnr application 0/5 0/0 ONLINE rac1
Ora. rac1.gsd application 0/5 0/0 OFFLINE
Ora. rac1.ons application 0/3 0/0 ONLINE rac1
Ora. rac1.vip ora... t1.type 0/0 0/0 ONLINE rac1
Ora... SM2.asm application 0/5 0/0 ONLINE rac2
Ora... C2.lsnr application 0/5 0/0 ONLINE rac2
Ora. rac2.gsd application 0/5 0/0 OFFLINE
Ora. rac2.ons application 0/3 0/0 ONLINE rac2
Ora. rac2.vip ora... t1.type 0/0 0/0 ONLINE rac2
Ora... ry. acfs ora... fs. type 0/5 0/ONLINE rac1
Ora. scan1.vip ora... ip. type 0/0 0/0 ONLINE rac2
Ora. scan2.vip ora... ip. type 0/0 0/0 ONLINE rac1
Ora. scan3.vip ora... ip. type 0/0 0/0 ONLINE rac1
Note:
English description
Ora. gsd is OFFLINE by default ifthere is no 9i database in the cluster.
Ora. productname is OFFLINE in 11.2.0.1 as DatabaseWorkload Management (DBWLM) is unavailable. these can be ignored in11gR2 RAC.
Explanation
Ora. gsd is a process used in cluster services to communicate with the 9i database. It is saved for backward compatibility in the current version. The status of OFFLINE does not affect the normal operation and performance of CRS, we can ignore it.
A valid service process in version 11.2.0.2 or later is used for resource management of DBWLM. Therefore, it is not used in version 11.2.0.1 or earlier.
2. Start the database:
Oracl the user executes the srvctl command:
Syntax: srvctl start | stop | status database-d dbname [-o immediate]
Purpose: Start all dbname instances at a time.
[Oracle @ rac1 ~] $ Srvctl start database-d racdb-start instances on all nodes
Then check the status:
[Oracle @ rac1 ~] $ Srvctl status database-d racdb
3. output the full name of the resource in detail and check the status
Crsctl status resource-t
Crsctl status resource
4. Common srvctl commands
Specify an instance on dbname
Srvctl start | stop | status instance-d <dbname>-I <instance_name>
5. display the configuration and status of all instances under RAC
Srvctl status | config database-d <dbname>
6. display application services (VIP, GSD, listener, ONS) on all nodes)
Srvctl start | stop | status nodeapps-n <node_name>
7. ASM process Service Management
Srvctl start | stop | status | config asm-n <nodename> [-I <asm_inst_name>] [-o <oracle_home>]
Srvctl config asm-
Srvctl status asm-
6. All environment information can be obtained:
Srvctl getenv database-d <dbname> [-I <instance_name>]
7. Set the global environment and variables:
Srvctl setenv database-d <dbname>-t LANG = en
8. Delete existing database information in OCR
Srvctl remove database-d <dbname>
9. Add a database instance to OCR:
Srvctl add instance-d <dbname>-I <instance_name>-n <node1>
Srvctl add instance-d <dbname>-I <instance_name>-n <node2>
10. Check the listening status
Srvctl status listener
Srvctl config listener-
SCAN configuration information
Srvctl config scan
SCAN listener status information
Srvctl status scan
Summary: The crsctl command is a cluster-level command that allows you to manage all cluster resources, such as starting and stopping them.
The srvctl command is a service-level command that allows you to uniformly start, stop, and manage a single service resource.
Appendix: Help for starting and stopping the srvctl command
[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 Solaris [-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 Solaris [-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