Friday, July 21, 2006

Managing a Physical Standby Database

If both the primary and standby databases are offline, then always (if possible) start the standby database before starting the primary database

8.1.1 Starting up a Physical Standby Database

1. Start the database:
SQL> STARTUP NOMOUNT;

2. Mount the standby database:
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;

3. Start the managed recovery operation:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT FROM SESSION;
Note: here has the option to open the dabase for read-only access

8.1.2. Shutting down a physical standby database

The following steps show you how to shut down a standby database:

1. 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;

2. Cancel managed recovery operations.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

3. Shut down the standby database.
SQL> SHUTDOWN IMMEDIATE;

8.2.2 Opening a Standby Database for Read-Only Access


1) To open a standby database for read-only access when it is currently shut down:
SQL> STARTUP NOMOUNT;
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
SQL> ALTER DATABASE OPEN READ ONLY;

2) To open a standby database for read-only access when it is currently performing managed recovery:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE OPEN READ ONLY;

3) To change the standby database from being open for read-only access to performing managed recovery:
1. Terminate all active user sessions on the standby database.
2. Restart log apply services:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT FROM SESSION;


RMAN backup and recovery of a primary database using a standby database
- use the physical standby database to off-load the database backup operation from the primary database
- Using RMAN at the standby site, you can back up the datafiles and the archived redo logs while the standby database is performing managed recovery.

see Oracle9i Recovery Manager User's Guide


8.4 Managing Primary Database Events That Affect the Standby Database (stop here)

No comments: