在之前的博客中我们了解了Oracle 12c 版本发布规则,以及Oracle 19c Data Guard环境的搭建,如下:
Oracle 12.2 家族的补丁 RU 和 RUR 说明
https://www.cndba.cn/dave/article/4063从生命周期的角度谈谈 Oracle 12c, 18c, 19c 和 20c
https://www.cndba.cn/cndba/dave/article/4055Linux 7.7 平台 Oracle 19.3 物理Data Guard 搭建手册
https://www.cndba.cn/dave/article/4067Linux 7.7 平台 Oracle 19c Data Guard 环境 升级RU 19.3 到19.6 操作手册
https://www.cndba.cn/dave/article/4068
我们这里要说明的是Oracle 12c体系家族中 Data Guard的一个变化,覆盖Oracle 12c,18c,19c。
我们首先看Oracle 11g中Data Guard的查询结果:
[dave@www.cndba.cn ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Oct 20 11:29:56 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select GROUP#,STATUS from v$log;
GROUP# STATUS
---------- ----------------
1 CLEARING
2 CLEARING
3 CURRENT
SQL>
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/archive
Oldest online log sequence 32
Next log sequence to archive 0
Current log sequence 33
SQL>
在11.2.0.4的平台中,我们可以看到archive log list 命令和v$log 都显示正常。 但是在12c 体系中,这里的显示发生了变化。 我们这里直接看命令结果:
[dave@www.cndba.cn ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 20 11:26:00 2020
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SYS@cndba>select GROUP#,STATUS from v$log;
GROUP# STATUS
---------- ------------------------------------------------
1 UNUSED
2 CURRENT
3 UNUSED
SYS@cndba>select open_Mode from v$database;
OPEN_MODE
------------------------------------------------------------
READ ONLY
SYS@cndba>archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/archivelog/
Oldest online log sequence 0
Next log sequence to archive 0
Current log sequence 0
SYS@cndba>
在我们这里的19.6 的平台中,我们可以看到结果的不同:
1)archive log list; 显示的序列为0
2)v$log 显示为UNUSED和CURRENT,而不是11g中的CLEARING和CURRENT。
对于第二点的v$log 显示问题,Oracle 说是bug:
The Bug 16091872 : V$LOG ON PSBY SHOWS ONE PER THREAD AS CURRENT
官方说在12c以后的版本已经修复了。在备库没有ORL(Online Redo Log)时,备库的ORL不会随着主库的ORL改变而更新。
对于第一点的:archive log list; 问题,Oracle 官方的建议是在12c 体系架构中不要使用该命令,而是使用如下命令代替:
Primary: SQL> select thread#, max(sequence#) "Last Primary Seq Generated"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
PhyStdby:SQL> select thread#, max(sequence#) "Last Standby Seq Received"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
group by thread# order by 1;
PhyStdby:SQL>select thread#, max(sequence#) "Last Standby Seq Applied"
from v$archived_log val, v$database vdb
where val.resetlogs_change# = vdb.resetlogs_change#
and val.applied in ('YES','IN-MEMORY')
group by thread# order by 1;
参考MOS:Archive Log List Showing 0 At Standby, But Standby Is Completely In Sync With Primary! (Doc ID 2041137.1)
版权声明:本文为博主原创文章,未经博主允许不得转载。