在今天的文章中,我将介绍如何解决 Pre-Switchover Validate 命令中的 SRL 不足警告。
当我们在 Swtichover 之前将成为 Primary 的 Standby 数据库上运行 Validate 命令时,
我们在 Current Log File Groups 和 Future Log File Groups 部分收到 Insufficient SRLs 警告。
以下是我们修复此警告的方法。
1.我们正在学习配置。
GMGRL> show configuration
Configuration - DRSolution
Protection Mode: MaxPerformance
Members:
primary - Primary database
prmyFS - Far sync instance
physical - Physical standby database
snapshot - Snapshot standby database
logical - Logical standby database
logical2 - Physical standby database
Members Not Receiving Redo:
physclFS - Far sync instance
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS (status updated 49 seconds ago)
2.我们在质疑主备库是否适合切换。
DGMGRL> validate database physical;
Database Role: Physical standby database
Primary Database: primary
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
Flashback Database Status:
primary: On
physical: Off
Current Log File Groups Configuration:
Thread # Online Redo Log Groups Standby Redo Log Groups Status
(primary) (physical)
1 3 3 Insufficient SRLs
Future Log File Groups Configuration:
Thread # Online Redo Log Groups Standby Redo Log Groups Status
(physical) (primary)
1 3 3 Insufficient SRLs
Transport-Related Property Settings:
Property primary Value physical Value
RedoRoutes (LOCAL:prmyFS SYNC) (LOCAL:physclFS SYNC)
- 我们在主备数据库中查询在线和备用重做日志。
rimary - 07-04-2017 14:06:24] SQL> select thread#, group#, sequence#, status, bytes from v$log;
THREAD# GROUP# SEQUENCE# STATUS BYTES
---------- ---------- ---------- ---------------- ----------
1 1 812 CURRENT 52428800
1 2 810 INACTIVE 52428800
1 3 811 INACTIVE 52428800
[Primary - 07-04-2017 14:15:47] SQL> select thread#, group#, sequence#, status, bytes from v$standby_log;
THREAD# GROUP# SEQUENCE# STATUS BYTES
---------- ---------- ---------- ---------- ----------
1 4 0 UNASSIGNED 52428800
1 5 0 UNASSIGNED 52428800
1 6 0 UNASSIGNED 52428800
0 7 0 UNASSIGNED 52428800
hysical - 07-04-2017 14:06:24] SQL> select thread#, group#, sequence#, status, bytes from v$log;
THREAD# GROUP# SEQUENCE# STATUS BYTES
---------- ---------- ---------- ---------------- ----------
1 1 0 UNUSED 52428800
1 2 0 UNUSED 52428800
1 3 0 UNUSED 52428800
[Physical - 07-04-2017 14:15:15] SQL> select thread#, group#, sequence#, status, bytes from v$standby_log;
THREAD# GROUP# SEQUENCE# STATUS BYTES
---------- ---------- ---------- ---------- ----------
1 4 812 ACTIVE 52428800
1 5 0 UNASSIGNED 52428800
1 6 0 UNASSIGNED 52428800
0 7 0 UNASSIGNED 52428800
正如我们在上面看到的,在备用重做日志中创建了一个重做日志作为线程#0。
事实上,在建立主数据库备用时,备用重做日志是作为主数据库中在线重做日志数量的额外创建的。
但是 Oracle 创建了一个创建为 Thread# 0,我不明白为什么。
在这种情况下,不遵循 Oracle 的最佳建议。 这就是我们收到警告的原因。
- 我们在主数据库中创建一个具有相同大小的线程#0 的新备用日志文件。
这是因为如果 Oracle 出于特殊原因使用它,则不会干扰该过程。
Primary - 07-04-2017 14:15:55] SQL> alter database add standby logfile thread 0 group 8 size 52428800;
Database altered.
[Primary - 07-04-2017 14:19:27] SQL> select thread#, group#, sequence#, status, bytes from v$standby_log;
THREAD# GROUP# SEQUENCE# STATUS BYTES
---------- ---------- ---------- ---------- ----------
1 4 0 UNASSIGNED 52428800
1 5 0 UNASSIGNED 52428800
1 6 0 UNASSIGNED 52428800
0 7 0 UNASSIGNED 52428800
0 8 0 UNASSIGNED 52428800
- 我们通过在主数据库中删除 7 号备用日志文件来创建线程 #1。
[Primary - 07-04-2017 14:19:31] SQL> alter database drop standby logfile group 7;
Database altered.
[Primary - 07-04-2017 14:22:19] SQL> alter database add standby logfile thread 1 group 7 size 52428800;
Database altered.
- 我们在备用数据库中执行相同的操作。 首先我们停止重做应用,否则我们会得到如下错误。
[Physical - 07-04-2017 14:19:47] SQL> alter database recover managed standby database cancel;
Database altered.
第 1 行的错误:
ORA-01156: recovery or flashback in progress may need access to files
7、我们在Standby数据库中新建一个thread#0的Standby Redo Log组,DROP当前thread#0的Standby Redo Log组,并创建与thread#1同组的Standby Redo Log文件。
[Physical - 07-04-2017 14:20:26] SQL> alter database add standby logfile thread 0 group 8 size 52428800;
Database altered.
[Physical - 07-04-2017 14:20:29] SQL> alter database recover managed standby database disconnect;
Database altered.
[Physical - 07-04-2017 14:20:43] SQL> alter database drop standby logfile group 7;
Database altered.
[Physical - 07-04-2017 14:21:24] SQL> alter database add standby logfile thread 1 group 7 size 52428800;
Database altered.
- 我们检查 Primary 和 Standby 端的 Standby Redo Log 文件。
[Primary - 07-04-2017 14:22:29] SQL> select thread#, group#, sequence#, status, bytes from v$standby_log;
THREAD# GROUP# SEQUENCE# STATUS BYTES
---------- ---------- ---------- ---------- ----------
1 4 0 UNASSIGNED 52428800
1 5 0 UNASSIGNED 52428800
1 6 0 UNASSIGNED 52428800
1 7 0 UNASSIGNED 52428800
0 8 0 UNASSIGNED 52428800
[Physical - 07-04-2017 14:21:34] SQL> select thread#, group#, sequence#, status, bytes from v$standby_log;
THREAD# GROUP# SEQUENCE# STATUS BYTES
---------- ---------- ---------- ---------- ----------
1 4 812 ACTIVE 52428800
1 5 0 UNASSIGNED 52428800
1 6 0 UNASSIGNED 52428800
1 7 0 UNASSIGNED 52428800
0 8 0 UNASSIGNED 52428800
- 通过再次运行 Validate 命令,我们检查是否发生了错误。
GRL> validate database physical;
Database Role: Physical standby database
Primary Database: primary
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
Flashback Database Status:
primary: On
physical: Off
Transport-Related Property Settings:
Property primary Value physical Value
RedoRoutes (LOCAL:prmyFS SYNC) (LOCAL:physclFS SYNC)
原文标题:Insufficient SRLs
原文作者:Onur ARDAHANLI
原文地址:https://dbtut.com/index.php/2022/07/08/insufficient-srls/
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




