To start a physical standby database, follow these steps using SQL*Plus with administrator privileges:
Start the database in NOMOUNT mode:
- Use the
STARTUP NOMOUNT
command to initialize the standby database. - The
NOMOUNT
option is mandatory when starting a standby database.
1 | SQL> STARTUP NOMOUNT; |
Mount the standby database:
- After starting, mount the database in standby mode to allow it to receive archived redo data from the primary database.
1 | SQL> ALTER DATABASE MOUNT STANDBY DATABASE ; |
1 2 3 4 5 | SQL> select database_role,open_mode from v$ database ; DATABASE_ROLE OPEN_MODE ---------------- -------------------- PHYSICAL STANDBY MOUNTED |
Start managed recovery (optional):
- Typically, after mounting, you start the managed recovery process to apply redo logs.
- The following command initiates recovery and runs in the background:
1 | SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; |
Start the DB with SRVCTL commands
-- SYNTAX FOR START DB
srvctl start database -d db_name [-o start_options]
where start_option is nomount/mount/open(default)
e.g
srvctl start database -d CERTDB -o nomount
srvctl start database -d CERTDB -o mount
srvctl start database -d CERTDB -o open
To safely shut down a physical standby database, follow these steps:
Check if Managed Recovery is Active:
- First, check whether the standby database is performing managed recovery. If the MRP0 or MRP process is running, it indicates that the managed recovery is active.
1 | SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY; |
Cancel Managed Recovery:
- If managed recovery is active, you need to cancel it before proceeding with the shutdown
1 2 3 | SQL> ALTER SYSTEM SWITCH LOGFILE; SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; |
Shut Down the Standby Database:
- After canceling managed recovery and deferring the archive log destination (if needed), proceed with shutting down the standby database.
1 | SQL> SHUTDOWN IMMEDIATE; |
Stop the DB with SRVCTL Commands
-- SYNTAX FOR STOP DB
srvctl stop database -d db_name [-o stop_options]
where stop_options is normal/immediate(default)/transactional/abort
e.g
srvctl stop database -d PRODB -o normal
srvctl stop database -d PRODB -o immediate
srvctl stop database -d PRODB -o transactional
srvctl stop database -d PRODB -o abort
Hope it helped !!