Starting and Stopping Instances and Oracle RAC Databases
You can start and stop instances with Oracle Enterprise Manager, SQL*Plus, or SRVCTL.
Both Oracle Enterprise Manager and SRVCTL provide options to start and stop all of the instances in an Oracle Real Application Clusters (Oracle RAC) database with a single step.
Using any tool, you can choose the startup state to which you want to start the database. The state of the database and database instance will determine what operations you can perform. You can perform certain operations only when the database is in the MOUNT (NOMOUNT) state. Performing other operations requires that the database be in the OPEN state.
Note:
Oracle does not support running more than one instance of the same database on the same node.
To start an Oracle RAC database instance on a node in the cluster, you must first start the Oracle Grid Infrastructure stack on the node. An Oracle RAC database instance will not start on a server on which the Oracle Grid Infrastructure stack is not running.
Related Topics
Starting One or More Instances and Oracle RAC Databases Using SRVCTL
Use SRVCTL start Oracle RAC databases and instances.
Note:
This section assumes that you are using an SPFILE for your database.
Enter the following SRVCTL syntax from the command line, providing the required database name and instance name, or include multiple instance names to start multiple specific instances:
To start your entire cluster database, that is, all of the instances and its dependencies, enter the following SRVCTL command:
$ srvctl start database -db db_unique_name [-startoption start_options]The following SRVCTL command, for example, mounts all of the non-running instances of an Oracle RAC database:
$ srvctl start database -db orcl -startoption mount- To start specific instances of a database, enter a comma-delimited list of instance names:
$ srvctl start instance -db db_unique_name -instance "instance_name_list" [-startoption start_options]You must enclose a comma-delimited list in double quotation marks (
""). - To start an instance of a database on a specific node, use the following command with a single node name:
$ srvctl start instance -db db_unique_name -node node_name [-startoption start_options]Note:
The policy-managed database deployment option is desupported in Oracle AI Database 26ai.
Policy-managed databases were deprecated in Oracle Database 21c, and admin-managed database deployment was enhanced with functions similar to policy managed databases. By converging the automation provided by policy-managed database with the consistency of an admin-managed database, Oracle seeks to simplify database management tasks for database administrators. This converged database deployment provides the best of both options, such as providing the options to rank and define the order of database startup, without requiring you to choose a specific style during deployment.
Note that this command also starts all enabled and non-running services and PDBs that have
AUTOMATICmanagement policy, and for which the database role matches one of the service's roles.
Stopping One or More Instances and Oracle RAC Databases Using SRVCTL
Use SRVCTL to stop instances and Oracle RAC databases.
The procedure for shutting down Oracle RAC instances is identical to shutting down instances in noncluster Oracle AI Database, with the following exceptions:
- In Oracle RAC, shutting down one instance does not interfere with the operation of other running instances.
- To shut down an Oracle RAC database completely, shut down every instance that has the database open or mounted.
- After a
NORMALorIMMEDIATEshutdown, instance recovery is not required. Recovery is required, however, after you issue theSHUTDOWN ABORTcommand or after an instance terminates unusually. An instance that is still running performs instance recovery for the instance that shut down. If no other instances are running, the next instance to open the database performs instance recovery for any instances needing it. Using the
SHUTDOWN TRANSACTIONALcommand with theLOCALoption is useful to shut down a particular Oracle RAC database instance. Transactions on other instances do not block this operation. If you omit theLOCALoption, then this operation waits until transactions on all other instances that started before you ran theSHUTDOWNcommand either commit or rollback, which is a valid approach, if you intend to shut down all instances of an Oracle RAC database.Note:
SHUTDOWN TRANSACTIONALandSHUTDOWN TRANSACTIONAL LOCALboth perform the same action on a nonclustered database but the two commands are different on an Oracle RAC database.
Enter the following SRVCTL syntax from the command line, providing the required database name and instance name, or include multiple instance names to stop multiple specific instances:
- To stop your entire cluster database, that is, all of the instances and its enabled services, enter the following SRVCTL command:
$ srvctl stop database -db db_unique_name [-stopoption stop_options]Use the
TRANSACTIONALstop option with thesrvctl stop databasecommand and theTRANSACTIONAL LOCALstop option with thesrvctl stop instancecommand. - To stop all instances and their enabled services that are managed by Oracle Clusterware on one or more nodes, enter the following SRVCTL command:
$ srvctl stop instance -node "node_list" [-stopoption stop_options]Note:
If any of the instances has services running on it, then you must use the
-forceoption to stop the services and the instance. To stop one or more instances, enter the following SRVCTL syntax from the command line:
$ srvctl stop instance -db db_unique_name {-node "node_list" | -instance "inst_name_list"} [-stopoption stop_options]You can enter either a comma-delimited list of instance names to stop several instances or you can enter a node name to stop one instance. In Windows you must enclose a comma-delimited list in double quotation marks (
"").The
srvctl stop instancecommand also stops the services related to the terminated instances on the nodes where the instances were running. As an example, the following command shuts down the two instances,orcl3andorcl4, on theorcldatabase using thefailoveroption for CRS to find another node to run the services from it and theimmediatestop option:$ srvctl stop instance -db orcl -instance "orcl3,orcl4" -force -failover -stopoption immediate
Stopping All Databases and Instances Using CRSCTL
You can use the crsctl stop crs command on the node or the crsctl stop cluster -all command to stop all instances on a node or the entire cluster.
When you want to stop an entire node or cluster (for maintenance purposes, for example), you run either the crsctl stop crs command on the node or the crsctl stop cluster -all command, provided you have the required cluster privileges. These commands stop all database instances running on a server or in the cluster and ensure that their state is recovered after you restart the cluster. Using CRSCTL also enables Oracle Clusterware to relocate services and other resources that can run elsewhere.
Using either of these CRSCTL commands to stop all database instances on a server or in the cluster can lead to the database instances being stopped similar to shutdown abort, which requires an instance recovery on startup. If you use SRVCTL to stop the database instances manually before stopping the cluster, then you can prevent a shutdown abort, but this requires that you manually restart the database instances after restarting Oracle Clusterware.
Starting and Stopping Individual Instances Using SQL*Plus
If you want to start or stop only one instance and you are connected to your local node, then you must first ensure that your current environment includes the SID for the local instance.
Note that any subsequent commands in your session, whether inside or outside a SQL*Plus session, are associated with that same SID.
Note:
This section assumes you are using an SPFILE.
To start or shutdown your local instance, initiate a SQL_Plus session and connect with the SYSRAC or SYSOPER privilege and then issue the required command. For example to start and mount an instance on your local node, run the following commands in your SQL_Plus session:
CONNECT / AS SYSRAC
STARTUP MOUNT
Note:
If you use Oracle ASM disk groups, then use the SYSASM privilege instead of the SYSRAC privilege to connect to and administer the Oracle ASM instances.
Oracle recommends that you do not use SQL*Plus to manage Oracle ASM instances in an Oracle RAC environment. Oracle Clusterware automatically manages Oracle ASM instances, as required. If manual intervention is necessary, then use respective SRVCTL commands.
You can start multiple instances from a single SQL*Plus session on one node using Oracle Net Services. Connect to each instance in turn by using a Net Services connection string, typically an instance-specific alias from your tnsnames.ora file.
For example, you can use a SQL*Plus session on a local node to perform a transactional shutdown for two instances on remote nodes by connecting to each in turn using the instance's individual alias name. Assume the alias name for the first instance is db1 and that the alias for the second instance is db2. Connect to the first instance and shut it down as follows:
CONNECT /@db1 AS SYSRAC
SHUTDOWN TRANSACTIONAL
Note:
To ensure that you connect to the correct instance, you must use an alias in the connect string that is associated with only one instance. If you use a connect string that uses a TNS alias that connects to a service or an Oracle Net address that lists multiple IP addresses, then you might not be connected to the specific instance you want to shut down.
Then connect to and shutdown the second instance by entering the following from your SQL*Plus session:
CONNECT /@db2 AS SYSRAC
SHUTDOWN TRANSACTIONAL
It is not possible to start or stop multiple instances, simultaneously, with SQL_Plus, so you cannot start or stop all of the instances for a cluster database with a single SQL_Plus command. You may want to create a script that connects to each instance in turn and start it up and shut it down. However, you must maintain this script manually if you add or drop instances.
Related Topics