????Oracle dataguard enabling real time apply

lovehewenyu發表於2013-08-14

????Oracle dataguard enabling real time apply

 

總結:

    物理DGalter database recover managed standby database using current logfile disconnect;

    邏輯DGalter database start logical standby apply immediate;

 

physical standby database

 

開啟redo apply

To start Redo Apply in the foreground, issue the following SQL statement:

·         SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;

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;

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;

關閉redo apply

·         SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

 

logical standby database

開啟sql apply

To start SQL Apply, start the logical standby database and issue the following statement:

·         SQL> ALTER DATABASE START LOGICAL STANDBY APPLY;

To start real-time apply on the logical standby database to immediately apply redo data from the standby redo log files on the logical standby database, include the IMMEDIATE keyword as shown in the following statement:

·         SQL>  ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

關閉sql apply

To stop SQL Apply, issue the following statement on the logical standby database:

·         SQL> ALTER DATABASE STOP LOGICAL STANDBY APPLY;

 

 

 

 

官檔解釋如下:

 

Oracle 10g

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 SQLALTER DATABASE RECOVER MANAGED STANDBY DATABASE statement.

You can specify that Redo Apply runs as a foreground session or as a background process, and enable it with real-time apply.

·         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.

·         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.2 Stopping Redo Apply

To stop Redo Apply, issue the following SQL statement in another window:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

 

6.4.1 Starting SQL Apply

To start SQL Apply, start the logical standby database and issue the following statement:

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY;

To start real-time apply on the logical standby database to immediately apply redo data from the standby redo log files on the logical standby database, include theIMMEDIATE keyword as shown in the following statement:

SQL>  ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

6.4.2 Stopping SQL Apply on a Logical Standby Database

To stop SQL Apply, issue the following statement on the logical standby database:

SQL> ALTER DATABASE STOP LOGICAL STANDBY APPLY;

When you issue this statement, SQL Apply waits until it has committed all complete transactions that were in the process of being applied. Thus, this command may not stop the SQL Apply processes immediately.

If you want to stop SQL Apply immediately, issue the following statement:

SQL> ALTER DATABASE ABORT LOGICAL STANDBY APPLY;

Oracle 11g

7.3.1 Starting Redo Apply

To start 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, and enable it with real-time apply.

·         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.

·         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;

7.3.2 Stopping Redo Apply

To stop Redo Apply, issue the following SQL statement:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

 

 

7.4.1 Starting SQL Apply

To start SQL Apply, start the logical standby database and issue the following statement:

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY;

To start real-time apply on the logical standby database to immediately apply redo data from the standby redo log files on the logical standby database, include the IMMEDIATE keyword as shown in the following statement:

SQL>  ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

7.4.2 Stopping SQL Apply on a Logical Standby Database

To stop SQL Apply, issue the following statement on the logical standby database:

SQL> ALTER DATABASE STOP LOGICAL STANDBY APPLY;

When you issue this statement, SQL Apply waits until it has committed all complete transactions that were in the process of being applied. Thus, this command may not stop the SQL Apply processes immediately.

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-768473/,如需轉載,請註明出處,否則將追究法律責任。

相關文章