Srvctl Start Database open mode and role modification with Examples

In Oracle Grid Infrastructure, the srvctl command is used to manage Oracle Real Application Clusters (RAC) and Automatic Storage Management (ASM) components, including Oracle databases. To modify the open mode of an Oracle database using srvctl, you can follow these steps. 

Step 1: Connect to the Server

Connect to the server where the database is located using SSH or a terminal session.

Step 2: Log in as the Oracle Software Owner

Log in as the Oracle software owner (typically, "oracle") or a user with the necessary privileges to modify the open mode of the database.


su - oracle

Step 3: Modify the Open Mode

Use the srvctl modify database command to change the open mode of the database. The command syntax is as follows:


srvctl modify database -db <DBUniqueName> -startoption <open_mode> -role <role>

-db <DBUniqueName>: Replace <DBUniqueName> with the unique name of your Oracle database.

-startoption <open_mode>: Specify the desired open mode for the database. The available options are "mount" (to start the database in a mounted state) and "read-write" (to open the database for read-write operations).

-role <DB role>: Role of the database in an Oracle Data Guard configuration (PRIMARY, PHYSICAL_STANDBY, LOGICAL_STANDBY, or SNAPSHOT_STANDBY)

Short FormLong Form
-d-db
-s-startoption
-r-role

Example 1: Modifying the Database to Mount Mode


To modify the database to mount mode, use the following command:


srvctl modify database -db FOADB -s mount

This command changes the database named "FOADB" to mount mode, making it available for various administrative tasks, such as applying redo logs or performing backups.

Example 2: Modifying the Database to Read-Write Mode


To modify the database to read-write mode, use the following command:


srvctl modify database -db FOADB -s read-write

This command opens the database "FOADB" for read-write operations. Be cautious when using this option, as read-write mode allows data modifications and should only be used when necessary.

Step 4: Verify the Database State

After running the srvctl command, you can verify the state of the database by using the srvctl status database command:


srvctl status database -db <DBUniqueName>

-db <DBUniqueName>: Replace <DBUniqueName> with the unique name of your database.

Example:


srvctl status database -db FOADB

This command displays the current state of the "FOADB" database, indicating whether it's in mounted or read-write mode.











If you like please follow and comment