RDBMS 12.2.0.1 的data guard 。
最近在备库的alert.log上看到一些警告
2018-09-08T08:24:31.886590+08:00
Warning: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE has been deprecated.
Warning: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE has been deprecated.
alter database recover managed standby database using current logfile disconnect from session
Starting background process MRP0
2018-09-08T08:24:32.245965+08:00
MRP0 started with pid=37, OS id=1132
2018-09-08T08:24:37.355340+08:00
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
2018-09-08T08:24:38.136590+08:00
查看了一下12c的官方文档,官方文档是这样说明的,
8.2.1 Using Real-Time Apply to Apply Redo Data Immediately
If the real-time apply feature is enabled, then apply services can apply redo data as it is received, without waiting for the current standby redo log file to be archived. This results in faster switchover and failover times because the standby redo log files have already been applied to the standby database by the time the failover or switchover begins. It also enables real-time reporting on an Oracle Active Data Guard standby by keeping it more closely synchronized with the primary database.
Use the ALTER DATABASE
statement to enable the real-time apply feature, as follows:
-
For physical standby databases, issue the
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
statement. (As of Oracle Database 12c Release 1 (12.1), theUSING CURRENT LOGFILE
clause is deprecated and no longer necessary to start real-time apply.) -
For logical standby databases, issue the
ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE
statement.
Real-time apply requires a standby database that is configured with a standby redo log and that is in ARCHIVELOG mode.
注意里面的这一行
Real-time apply requires a standby database that is configured with a standby redo log and that is in ARCHIVELOG mode.
在12c 下,主要通过以下的语句启用real-time apply
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING ARCHIVED LOGFILE DISCONNECT;
通过执行以上的语句,在alertlog中,可以看到均是real time apply的。
alter database recover managed standby database disconnect from session
Starting background process MRP0
2018-09-02T17:04:35.815209+08:00
MRP0 started with pid=31, OS id=8008
2018-09-02T17:04:39.221459+08:00
Deleted Oracle managed file E:\ORADATA\FAST_RECOVERY_AREA\NOCDB_STDBY\ARCHIVELOG\2018_09_02\O1_MF_0_0_FRQ9X74H_.ARC
2018-09-02T17:04:39.471459+08:00
Primary database is in MAXIMUM PERFORMANCE mode
RFS[16]: Assigned to RFS process (PID:4976)
RFS[16]: Selected log 4 for T-1.S-8 dbid 3226205934 branch 985794675
2018-09-02T17:04:40.815209+08:00
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
2018-09-08T09:03:43.594598+08:00
alter database recover managed standby database nodelay
2018-09-08T09:03:43.766473+08:00
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Media Recovery Waiting for thread 1 sequence 25 (in transit)
2018-09-08T09:03:44.047723+08:00
Completed: alter database recover managed standby database cancel
2018-09-08T09:27:03.860223+08:00
alter database recover managed standby database
2018-09-08T09:27:03.891473+08:00
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
Media Recovery Waiting for thread 1 sequence 25 (in transit)
2018-09-08T09:27:04.282098+08:00
Recovery of Online Redo Log: Thread 1 Group 6 Seq 25 Reading mem 0
Mem# 0: E:\ORADATA\NOCDB_STDBY\STDBY_REDO06.LOG
对比11gR2,官方文档是这样说明的。
7.2.1 Using Real-Time Apply to Apply Redo Data Immediately
If the real-time apply feature is enabled, apply services can apply redo data as it is received, without waiting for the current standby redo log file to be archived. This results in faster switchover and failover times because the standby redo log files have been applied already to the standby database by the time the failover or switchover begins.
Use the ALTER DATABASE
statement to enable the real-time apply feature, as follows:
-
For physical standby databases, issue the
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE
statement. -
For logical standby databases, issue the
ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE
statement.
Real-time apply requires a standby database that is configured with a standby redo log and that is in ARCHIVELOG mode.
11gR2的命令就不再这里列出了,具体可以参考官方文档。
通过以上的对比,可以了解11gR2和12c的redo apply的一些区别。当然,在12c上继续使用11gR2的方法,还是可以的。只是alertlog中会有一些warning提示而已。
END