Data Guard

How to Modify Startup Option in SRVCTL on Standby Database

In some cases, you would like to change the default startup option of srvctl other than OPEN, for example, after duplicating a standby database, it needs to go to MOUNT state to prevent users from accessing.

For convenience, you can set the default open option to mount. Then, every time you restart your standby database, it will go to MOUNT state as you wish. No need to add start option “-o mount”.

Let’s see the current config of the standby database in srvctl:

$ srvctl config database -d compdb
Database unique name: compdb
Database name: compdb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/compdb/spfilestandb.ora
Domain: example.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: compdb
Database instances: standb1,standb2
Disk Groups: DATA
Services:
Database is administrator managed

You can see the Database role is PRIMARY and Start option is open, if you restart the host, the standby db will go to READ ONLY WITH APPLY automatically. let’s check the standby database:

$ sqlplus / as sysdba

SQL> select open_mode, database_role from v$database;

OPEN_MODE            DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY

That is not what we want.

srvctl modify database

Next, let’s srvctl modify database, the configuration:

$ srvctl modify database -d compdb -s mount -r PHYSICAL_STANDBY

Review the configuration:
$ srvctl config database -d compdb
Database unique name: compdb
Database name: compdb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/compdb/spfilestandb.ora
Domain: example.com
Start options: mount
Stop options: immediate
Database role: PHYSICAL_STANDBY
Management policy: AUTOMATIC
Server pools: compdb
Database instances: standb1,standb2
Disk Groups: DATA
Services:
Database is administrator managed

That’s is our expected configuration.

Leave a Reply

Your email address will not be published. Required fields are marked *