dataguard gap

简介: 解决gap

1,错误日志

1Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION

Tue Jan 18 10:24:45 2022

FAL[client]: Failed to request gap sequence

GAP - SCN range: 0x0931.ec587602 - 0x0931.ec587602

DBID 639780530 branch 1000850613

FAL[client]: All defined FAL servers have been attempted.

------------------------------------------------------------

Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization

parameter is defined to a value that's sufficiently large

enough to maintain adequate log switch information to resolve

archivelog gaps.

------------------------------------------------------------

https://blogs.oracle.com/database4cn/post/rmandataguardstandby

2,查询数据库scn

col CURRENT_SCN format 99999999999999;

SELECT CURRENT_SCN FROM V$DATABASE;

 CURRENT_SCN

---------------

10110023267841

SQL> col min(checkpoint_change#) format 99999999999999;

SQL> select min(checkpoint_change#) from v$datafile_header

 2  where file# not in (select file# from v$datafile where enabled = 'READ ONLY');

MIN(CHECKPOINT_CHANGE#)

-----------------------

        10110023275988

3,增量备份

RMAN> BACKUP INCREMENTAL FROM SCN 10110023275988 DATABASE FORMAT '/u01/app/oracle/bak/bak_%U' tag 'FORSTANDBY';

Starting backup at 2022-01-18 10:31:50

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=38 instance=nongxian2 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00004 name=+DATA/nongxian/datafile/users.437.1000850541

input datafile file number=00006 name=+DATA/nongxian/datafile/agri_tb01.dbf

input datafile file number=00007 name=+DATA/nongxian/datafile/txnlist_tb01.dbf

input datafile file number=00008 name=+DATA/nongxian/datafile/nyplat_tb01.dbf

input datafile file number=00009 name=+DATA/nongxian/datafile/txnlist_tb02.dbf

input datafile file number=00003 name=+DATA/nongxian/datafile/undotbs1.678.1000850541

input datafile file number=00005 name=+DATA/nongxian/datafile/undotbs2.806.1000850677

input datafile file number=00002 name=+DATA/nongxian/datafile/sysaux.697.1000850541

input datafile file number=00001 name=+DATA/nongxian/datafile/system.683.1000850541

channel ORA_DISK_1: starting piece 1 at 2022-01-18 10:31:51

channel ORA_DISK_1: finished piece 1 at 2022-01-18 10:38:26

piece handle=/u01/app/oracle/bak/bak_hq0jj6cn_1_1 tag=FORSTANDBY comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:06:35

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

channel ORA_DISK_1: starting piece 1 at 2022-01-18 10:38:27

channel ORA_DISK_1: finished piece 1 at 2022-01-18 10:38:28

piece handle=/u01/app/oracle/bak/bak_hr0jj6p2_1_1 tag=FORSTANDBY comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 2022-01-18 10:38:28

RMAN> exit

4,传输备份到备

$ scp * 10.4.1.32:/nxarchive/bak

---------------

10110023267841

SQL> select min(checkpoint_change#) from v$datafile_header

 2  where file# not in (select file# from v$datafile where enabled = 'READ ONLY');

MIN(CHECKPOINT_CHANGE#)

-----------------------

            1.0110E+13

SQL> col min(checkpoint_change#) format 99999999999999;

SQL> /

MIN(CHECKPOINT_CHANGE#)

-----------------------

        10110023275988

SQL>  

SQL>  

SQL>  

SQL>  

SQL>  

SQL>  

5,数据库恢复

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;    

Database altered.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Jan 18 11:15:58 2022

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: NONGXIAN (DBID=639780530, not open)

RMAN> catalog start with '/nxarchive/bak';

using target database control file instead of recovery catalog

searching for all files that match the pattern /nxarchive/bak

List of Files Unknown to the Database

=====================================

File Name: /nxarchive/bak/bak_hq0jj6cn_1_1

File Name: /nxarchive/bak/bak_hr0jj6p2_1_1

Do you really want to catalog the above files (enter YES or NO)? yes

cataloging files...

cataloging done

List of Cataloged Files

=======================

File Name: /nxarchive/bak/bak_hq0jj6cn_1_1

File Name: /nxarchive/bak/bak_hr0jj6p2_1_1

RMAN> recover database;

Starting recover at 18-JAN-22

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=3698 device type=DISK

channel ORA_DISK_1: starting incremental datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

destination for restore of datafile 00001: /nxdata/system.683.1000850541

destination for restore of datafile 00002: /nxdata/sysaux.697.1000850541

destination for restore of datafile 00003: /nxdata/undotbs1.678.1000850541

destination for restore of datafile 00004: /nxdata/users.437.1000850541

destination for restore of datafile 00005: /nxdata/undotbs2.806.1000850677

destination for restore of datafile 00006: /nxdata/agri_tb01.dbf

destination for restore of datafile 00007: /nxdata/txnlist_tb01.dbf

destination for restore of datafile 00008: /nxdata/nyplat_tb01.dbf

destination for restore of datafile 00009: /nxdata/txnlist_tb02.dbf

channel ORA_DISK_1: reading from backup piece /nxarchive/bak/bak_hq0jj6cn_1_1

channel ORA_DISK_1: piece handle=/nxarchive/bak/bak_hq0jj6cn_1_1 tag=FORSTANDBY

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:25

starting media recovery

archived log for thread 1 with sequence 29577 is already on disk as file /nxarchive/1_29577_1000850613.dbf

archived log for thread 1 with sequence 29606 is already on disk as file /nxarchive/1_29606_1000850613.dbf

archived log for thread 1 with sequence 29614 is already on disk as file /nxarchive/1_29614_1000850613.dbf

archived log for thread 1 with sequence 29615 is already on disk as file /nxarchive/1_29615_1000850613.dbf

archived log for thread 1 with sequence 29616 is already on disk as file /nxarchive/1_29616_1000850613.dbf

archived log for thread 1 with sequence 29617 is already on disk as file /nxarchive/1_29617_1000850613.dbf

archived log for thread 1 with sequence 29618 is already on disk as file /nxarchive/1_29618_1000850613.dbf

archived log for thread 2 with sequence 27594 is already on disk as file /nxarchive/2_27594_1000850613.dbf

archived log for thread 2 with sequence 27617 is already on disk as file /nxarchive/2_27617_1000850613.dbf

archived log for thread 2 with sequence 27619 is already on disk as file /nxarchive/2_27619_1000850613.dbf

archived log for thread 2 with sequence 27620 is already on disk as file /nxarchive/2_27620_1000850613.dbf

unable to find archived log

archived log thread=1 sequence=0

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 01/18/2022 11:16:56

RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 0 and starting SCN of 10110023267842

RMAN> exit

RESTORE STANDBY CONTROLFILE FROM '/nxarchive/bak/bak_hr0jj6p2_1_1';

6,恢复控制文件

RMAN> RESTORE STANDBY CONTROLFILE FROM '/nxarchive/bak/bak_hr0jj6p2_1_1';

Starting restore at 18-JAN-22

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=1058 device type=DISK

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

output file name=/nxdata/current.ctl

Finished restore at 18-JAN-22

$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 18 11:17:50 2022

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> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Database altered.

SQL>  

7,状态检查

##alter system archive log current

select unique thread# as thread,max(sequence#) over(partition by thread#) as last from gv$archived_log where applied='YES'

/

相关文章
|
1天前
|
云安全 人工智能 自然语言处理
|
9天前
|
数据采集 人工智能 自然语言处理
Meta SAM3开源:让图像分割,听懂你的话
Meta发布并开源SAM 3,首个支持文本或视觉提示的统一图像视频分割模型,可精准分割“红色条纹伞”等开放词汇概念,覆盖400万独特概念,性能达人类水平75%–80%,推动视觉分割新突破。
649 56
Meta SAM3开源:让图像分割,听懂你的话
|
6天前
|
搜索推荐 编译器 Linux
一个可用于企业开发及通用跨平台的Makefile文件
一款适用于企业级开发的通用跨平台Makefile,支持C/C++混合编译、多目标输出(可执行文件、静态/动态库)、Release/Debug版本管理。配置简洁,仅需修改带`MF_CONFIGURE_`前缀的变量,支持脚本化配置与子Makefile管理,具备完善日志、错误提示和跨平台兼容性,附详细文档与示例,便于学习与集成。
319 116
|
5天前
|
人工智能 Java API
Java 正式进入 Agentic AI 时代:Spring AI Alibaba 1.1 发布背后的技术演进
Spring AI Alibaba 1.1 正式发布,提供极简方式构建企业级AI智能体。基于ReactAgent核心,支持多智能体协作、上下文工程与生产级管控,助力开发者快速打造可靠、可扩展的智能应用。
|
21天前
|
域名解析 人工智能
【实操攻略】手把手教学,免费领取.CN域名
即日起至2025年12月31日,购买万小智AI建站或云·企业官网,每单可免费领1个.CN域名首年!跟我了解领取攻略吧~
|
9天前
|
机器学习/深度学习 人工智能 自然语言处理
AgentEvolver:让智能体系统学会「自我进化」
AgentEvolver 是一个自进化智能体系统,通过自我任务生成、经验导航与反思归因三大机制,推动AI从“被动执行”迈向“主动学习”。它显著提升强化学习效率,在更少参数下实现更强性能,助力智能体持续自我迭代。开源地址:https://github.com/modelscope/AgentEvolver
440 32
|
4天前
|
弹性计算 人工智能 Cloud Native
阿里云无门槛和有门槛优惠券解析:学生券,满减券,补贴券等优惠券领取与使用介绍
为了回馈用户与助力更多用户节省上云成本,阿里云会经常推出各种优惠券相关的活动,包括无门槛优惠券和有门槛优惠券。本文将详细介绍阿里云无门槛优惠券的领取与使用方式,同时也会概述几种常见的有门槛优惠券,帮助用户更好地利用这些优惠,降低云服务的成本。
272 132

热门文章

最新文章