m6米乐安卓版下载-米乐app官网下载
暂无图片
5
暂无图片
暂无图片
暂无图片

adg快速修复gap,一键修复 -m6米乐安卓版下载

原创 范伟林 2023-07-27
978

一、前言

  • 相信我们也会经常遇到dg库出现gap也就是日志裂缝,缺失了某一部分的归档日志,备库的scn出现了滞留;
  • 此时咱们主库也没有缺失的归档日志fal也无法自动获取,也没有进行过归档日志的备份,安装照传统咱们11g习惯的做法都是利用增量备份前滚备库数据文件的scn,进而绕过了gap,实现后续的同步;
  • 自oracle版本不断的改进增强,在18c之后的版本就利用一句命令自动的实现的gap的恢复,所以oracle也就是越来越操作简单了,23c也出了很多新特性,使得开发也越来越简单快捷。
  • 下面咱们来看看这一句命令恢复gap,背后的过程。

二、问题复现

本次模拟的环境为19c

2023-07-25t15:02:47.542383 08:00
pr00 (pid:22459): fal: failed to request gap sequence
pr00 (pid:22459):  gap - thread 2 sequence 4868-4870
pr00 (pid:22459):  dbid 3475847471 branch 1093287857
pr00 (pid:22459): fal: all defined fal servers have been attempted
pr00 (pid:22459): -------------------------------------------------------------------------
pr00 (pid:22459): check that the control_file_record_keep_time initialization
pr00 (pid:22459): parameter is defined to a value that's sufficiently large
pr00 (pid:22459): enough to maintain adequate log switch information to resolve
pr00 (pid:22459): archived redo log gaps.
pr00 (pid:22459): -------------------------------------------------------------------------

note:上面的数据库alert信息,可以看出来备库目前处于gap状态,一直获取不到thread 2 sequence 4868-4870的归档日志

三、问题的处理

关闭mrp进程

edit database william set state='apply-off';

一键恢复

recover standby database from service wldb;
[oracle@william ~]$ rman target /
recovery manager: release 19.0.0.0.0 - production on tue jul 25 15:06:33 2023
version 19.13.0.0.0
米乐app官网下载 copyright (c) 1982, 2019, oracle and/or its affiliates.  all rights reserved.
connected to target database: wldb (dbid=3475847471, not open)
rman> recover standby database from service wldb;
starting recover at 25-jul-23
using target database control file instead of recovery catalog
oracle instance started
total system global area   10737417288 bytes
fixed size                    13626440 bytes
variable size               1644167168 bytes
database buffers            9059696640 bytes
redo buffers                  19927040 bytes
contents of memory script:
{
   restore standby controlfile from service  'wldb';
   alter database mount standby database;
}
executing memory script
starting restore at 25-jul-23
allocated channel: ora_disk_1
channel ora_disk_1: sid=1137 device type=disk
channel ora_disk_1: starting datafile backup set restore
channel ora_disk_1: using network backup set from service hip
channel ora_disk_1: restoring control file
channel ora_disk_1: restore complete, elapsed time: 00:00:02
output file name=/data/oradata/william/controlfile01.ctl
finished restore at 25-jul-23
released channel: ora_disk_1
statement processed
executing: alter system set standby_file_management=manual
contents of memory script:
{
  recover database from service  'wldb';
}
executing memory script
starting recover at 25-jul-23
starting implicit crosscheck backup at 25-jul-23
allocated channel: ora_disk_1
channel ora_disk_1: sid=1137 device type=disk
crosschecked 971 objects
finished implicit crosscheck backup at 25-jul-23
starting implicit crosscheck copy at 25-jul-23
using channel ora_disk_1
finished implicit crosscheck copy at 25-jul-23
searching for all files in the recovery area
cataloging files...
cataloging done
list of cataloged files
=======================
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5169_lcyt21t7_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5170_lcyt24gx_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5171_lcyt3xts_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5172_lcyt3zjb_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4867_lcyt434n_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5173_lcyt43cd_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5158_lcyt76f0_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4871_lcyt76pk_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4872_lcyt76pn_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5177_lcyt76pq_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4873_lcyt76pt_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5176_lcyt76pw_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5178_lcyt76pz_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5179_lcyt76vf_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4874_lcyt76yf_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5180_lcyt77dg_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5159_lcyt78tw_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5181_lcyt78xm_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5182_lcyt79sp_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5664_lcyt79vr_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5183_lcyt7cw7_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5184_lcyt7cym_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4875_lcyt7pgd_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4876_lcyt7pgq_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4877_lcyt7pm2_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4878_lcyt7qdw_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4879_lcyt7qgz_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4880_lcyt7qhv_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4881_lcyt7r6k_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4882_lcyt7s19_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_4883_lcyt7srq_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5190_lcyt7svf_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5160_lcytlkh1_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5665_lcytllx8_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5667_lcytst2l_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5162_lcytsvtc_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5668_lcytszmo_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5163_lcytt1b9_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5164_lcytzgsm_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5166_lcywd4dt_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5670_lcywd73s_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5671_lcywd9b6_.arc
file name: /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5167_lcywd9xm_.arc
file name: /data/oradata/fast_recovery_area/william/autobackup/2022_01_07/o1_mf_s_1093356481_jxhp61y4_.bkp
file name: /data/oradata/fast_recovery_area/william/autobackup/2022_01_07/o1_mf_s_1093357387_jxhq2cv5_.bkp
file name: /data/oradata/fast_recovery_area/william/autobackup/2022_01_07/o1_mf_s_1093359738_jxhsdqhl_.bkp
file name: /data/oradata/fast_recovery_area/william/autobackup/2022_04_17/o1_mf_s_1102213822_k5p2wxxp_.bkp
using channel ora_disk_1
skipping datafile 27; already restored to scn 17714612574869
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00001: /data/oradata/william/system.283.1093287729
channel ora_disk_1: restore complete, elapsed time: 00:00:04
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00002: /data/oradata/william/system.289.1093346719
channel ora_disk_1: restore complete, elapsed time: 00:00:04
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00003: /data/oradata/william/sysaux.284.1093287763
channel ora_disk_1: restore complete, elapsed time: 00:00:45
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00004: /data/oradata/william/undotbs1.285.1093287789
channel ora_disk_1: restore complete, elapsed time: 00:00:08
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00005: /data/oradata/william/undotbs2.291.1093288043
channel ora_disk_1: restore complete, elapsed time: 00:00:08
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00007: /data/oradata/william/users.286.1093287789
channel ora_disk_1: restore complete, elapsed time: 00:00:36
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00008: /data/oradata/william/undotbs1.288.1093346723
channel ora_disk_1: restore complete, elapsed time: 00:00:26
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00009: /data/oradata/william/undotbs1.320.1093346727
channel ora_disk_1: restore complete, elapsed time: 00:00:25
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00010: /data/oradata/william/undotbs2.321.1093346731
channel ora_disk_1: restore complete, elapsed time: 00:00:16
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00011: /data/oradata/william/undotbs2.322.1093346735
channel ora_disk_1: restore complete, elapsed time: 00:00:16
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00012: /data/oradata/william/nhip_esb.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00013: /data/oradata/william/nhip_esb2.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00014: /data/oradata/william/nhip_mdm01.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00015: /data/oradata/william/nhip_dc_tbs.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:15
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00016: /data/oradata/william/nhip_dc_tbs2.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:16
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00017: /data/oradata/william/bidata01.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00018: /data/oradata/william/bidata02.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00019: /data/oradata/william/biindx01.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00020: /data/oradata/william/biindx02.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:01
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00021: /data/oradata/william/odsdata01.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00022: /data/oradata/william/odsdata02.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00023: /data/oradata/william/odsindx01.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00024: /data/oradata/william/odsindx02.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:01
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00025: /data/oradata/william/nhip_empi.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
channel ora_disk_1: starting incremental datafile backup set restore
channel ora_disk_1: using network backup set from service hip
destination for restore of datafile 00026: /data/oradata/william/nhip_portal_tbs.dbf
channel ora_disk_1: restore complete, elapsed time: 00:00:02
starting media recovery
archived log for thread 1 with sequence 5673 is already on disk as file /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5673_lcyx4svo_.arc
archived log for thread 1 with sequence 5674 is already on disk as file /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5674_lcyx4wdp_.arc
archived log for thread 1 with sequence 5675 is already on disk as file /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_1_5675_lcyx55w3_.arc
archived log for thread 2 with sequence 5169 is already on disk as file /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5169_lcyx4svk_.arc
archived log for thread 2 with sequence 5170 is already on disk as file /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5170_lcyx4vto_.arc
archived log for thread 2 with sequence 5171 is already on disk as file /data/oradata/fast_recovery_area/william/archivelog/2023_07_25/o1_mf_2_5171_lcyx54yy_.arc
media recovery complete, elapsed time: 00:00:00
finished recover at 25-jul-23
executing: alter system set standby_file_management=auto
finished recover at 25-jul-23
rman> 

note:通过观察日志的过程可以发现,实际次命令的逻辑也是跟咱们传统手工的方式做增量恢复不相上下;相当于rman自动化的帮你实现了,通过tns的方式。

开启同步

edit database william set state='apply-on';

可以看到相当的简单方便

最后修改时间:2023-07-28 10:04:21
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【米乐app官网下载的版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论

网站地图