Вы находитесь на странице: 1из 3

6.3.

1 Starting Redo Apply

To start log apply services on a physical standby database, ensure the physical
standby database is started and mounted and then start Redo Apply using the SQL
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE statement.

You can specify that Redo Apply runs as a foreground session or as a background
process.

• To start Redo Apply in the foreground, issue the following SQL statement:
• SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;

If you start a foreground session, control is not returned to the command


prompt until recovery is canceled by another session.

• To start Redo Apply in the background, include the DISCONNECT keyword on


the SQL statement. For example:
• SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
DISCONNECT;

This statement starts a detached server process and immediately returns


control to the user. While the managed recovery process is performing
recovery in the background, the foreground process that issued the RECOVER
statement can continue performing other tasks. This does not disconnect the
current SQL session.

6.3.2 Starting Real-Time Apply

To start real-time apply, include the USING CURRENT LOGFILE clause on the SQL
statement. For example:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING


CURRENT LOGFILE;

6.3.3 Stopping Log Apply Services

To stop Redo Apply or real-time apply, issue the following SQL statement in another
window:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

Step 4 Initiate a failover on the target physical standby database.

Issue the following statement to initiate the failover:


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH
FORCE;

8.1.2 Shutting Down a Physical Standby Database

To shut down a physical standby database and stop Redo Apply, use the SQL*Plus
SHUTDOWN statement. Control is not returned to the session that initiates a database
shutdown until shutdown is complete.

If the primary database is up and running, defer the destination on the primary
database and perform a log switch before shutting down the standby database.

To stop Redo Apply before shutting down the database, use the following steps:

1. Issue the following query to find out if the standby database is performing
Redo Apply or real-time apply. If the MRP0 or MRP process exists, then the
standby database is applying redo.
2. SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;
3.
4. If Redo Apply is running, cancel it as shown in the following example:
5. SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
CANCEL;
6.
7. Shut down the standby database.
8. SQL> SHUTDOWN IMMEDIATE;

8.2.2 Opening a Physical Standby Database for Read-Only Access

You can alternate between having a physical standby database open for read-only
access and performing Redo Apply using the following procedures.

To open a standby database for read-only access when it is currently


shut down:

Start, mount, and open the database for read-only access using the following
statement:

SQL> STARTUP;

To open a standby database for read-only access when it is currently


performing Redo Apply:

1. Cancel Redo Apply:


2. SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
CANCEL;
3.
4. Open the database for read-only access:
5. SQL> ALTER DATABASE OPEN;
6.
You do not need to shut down the instance to open it for read-only access.

To change the standby database from being open for read-only access
to performing Redo Apply:

1. Terminate all active user sessions on the standby database.


2. Restart Redo Apply. To start Redo Apply, issue the following statement:
3. SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
4. 2> DISCONNECT FROM SESSION;
5.

To enable real-time apply, include the USING CURRENT LOGFILE clause:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE


2> USING CURRENT LOGFILE;

Вам также может понравиться