How to start up a physical standby database with read only apply state? And How to shutdown a physical standby database?
Ezana Answered question 03/10/2022
Below are the steps to a physical standby database with read only state.
- startup nomount with pfile:
SQL> STARTUP NOMOUNT='/export/home/oracle/pfile.ora'; ORACLE instance started. Total System Global Area 7.5162E+10 bytes Fixed Size 5282712 bytes Variable Size 1.3153E+10 bytes Database Buffers 6.1740E+10 bytes Redo Buffers 263151616 bytes
- Mount the standby database:
SQL> ALTER DATABASE MOUNT STANDBY DATABASE; Database altered.
- Find out if the standby database is performing managed recovery. If the MRP0 or MRP process exists, then the standby database is performing managed recovery.
SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY; PROCESS STATUS --------- ------------ ARCH CONNECTED ARCH CONNECTED ARCH CONNECTED ARCH CONNECTED RFS IDLE RFS IDLE MRP0 WAIT_FOR_LOG
- Cancel log apply services:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; Database altered.
- Open the database for read only access:
SQL> alter database open read only; Database altered.
- Start the managed recovery operation( redo apply):
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; Database altered.
- Finally check the open mode of the database:
SQL> select open_mode from v$database; OPEN_MODE -------------------- READ ONLY WITH APPLY
And the following steps show you how to shut down a standby database:
- Find out if the standby database is performing managed recovery. If the MRP0 or MRP process exists, then the standby database is performing managed recovery:
SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY; PROCESS STATUS --------- ------------ ARCH CONNECTED ARCH CONNECTED ARCH CONNECTED ARCH CONNECTED RFS IDLE RFS IDLE MRP0 WAIT_FOR_LOG
- Cancel managed recovery operations:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; Database altered.
- Finally shut down the standby database:
SQL> SHUTDOWN IMMEDIATE;
Ezana Answered question 03/10/2022