Oracle dataguard enabling real time apply
总结:
物理DG:alter database recover managed standby database using current logfile disconnect;
逻辑DG:alter 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.