crosscheck restore uncatalog archivelog 检查 恢复 归档日志

Summary

How to verify if the archivelogs are on disk or RMAN backup?

Solution

  1. Issue the following RMAN command to check if the archivelogs are on disk:
复制代码
RMAN> crosscheck archivelog from logseq 7057 until logseq 7060 thread 1;

If they are not on disk, then you will get the following message:

复制代码
specification does not match any archive log in the recovery catalog
  1. If they are not on disk, then you may issue the following RMAN commands to verify if they are

in the RMAN backup.

复制代码
RMAN> crosscheck backup of archivelog from logseq 7057 until logseq 7060 thread 1;
RMAN> list backup of archivelog from logseq 7057 until logseq 7060 thread 1;

The corresponding RMAN backupset must have a status of AVAILABLE

复制代码
  BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ -------------------- 94463 117M DISK 00:00:53 25-FEB-2007 20:53:15 BP Key: 94470 Status: AVAILABLE Tag: TAG20070225T203855 Piece Name: <path>\F_615502342_DRIAVKG6_1_1.RBK

Summary

RMAN command 'RESTORE ARCHIVELOG ALL VALIDATE' failing with error:

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

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

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

RMAN-03002: failure of restore command at 01/13/2012 11:38:39

RMAN-06026: some targets not found - aborting restore

RMAN-06025: no backup of log thread 1 seq 1 lowscn 1164241 found to restore

RMAN-06025: no backup of log thread 1 seq 58 lowscn 1164240 found to restore

RMAN-06025: no backup of log thread 1 seq 57 lowscn 1164238 found to restore

Solution

Option 1: When not using an RMAN catalog, use the below syntax from RMAN command prompt,

for validating a subset of archivelog file backups.

RMAN> restore archivelog from time='<RECOVERY WINDOWS DAYS#>' validate;

For example, suppose retention is set to 'recovery window of 7 days', then use the below command.

RMAN> show RETENTION POLICY;

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

RMAN> restore archivelog from time='SYSDATE-7' validate;

Starting restore at 13-JAN-12

using channel ORA_DISK_1

channel ORA_DISK_1: starting validation of archive log backupset

channel ORA_DISK_1: reading from backup piece <path>\BACKUPSET\2012_01_13\O1_MF_ANNNN_TAG20120113T111853_7JZKG717_.BKP

channel ORA_DISK_1: restored backup piece 1

piece handle=<path>\BACKUPSET\2012_01_13\O1_MF_ANNNN_TAG20120113T111853_7JZKG717_.BKP tag=TAG20120113T111853

channel ORA_DISK_1: validation complete, elapsed time: 00:00:02

channel ORA_DISK_1: starting validation of archive log backupset

channel ORA_DISK_1: reading from backup piece <path>\BACKUPSET\2012_01_13\O1_MF_ANNNN_TAG20120113T112054_7JZKL018_.BKP

channel ORA_DISK_1: restored backup piece 1

piece handle=<path>\BACKUPSET\2012_01_13\O1_MF_ANNNN_TAG20120113T112054_7JZKL018_.BKP tag=TAG20120113T112054

channel ORA_DISK_1: validation complete, elapsed time: 00:00:03

Finished restore at 13-JAN-12

RMAN>

重新恢复archivelog

Attachments :

Cause

The message above is correct however if the archivelogs are stored within ASM you are not able to use the os copy or move command to retrieve them.

RMAN> run {
2> set archivelog destination to '/tmp'; 不生效 要force
3> restore archivelog from logseq=60 until logseq=65;
4> }

executing command: SET ARCHIVELOG DESTINATION
using target database controlfile instead of recovery catalog

Starting restore at 2006/11/17 08:51:01
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=147 devtype=DISK

archive log thread 1 sequence 60 is already on disk as file +DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487
archive log thread 1 sequence 61 is already on disk as file +DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_61.263.606732499
archive log thread 1 sequence 62 is already on disk as file +DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_62.265.606732505
archive log thread 1 sequence 63 is already on disk as file +DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_63.278.606732509
archive log thread 1 sequence 64 is already on disk as file +DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_64.277.606732509
archive log thread 1 sequence 65 is already on disk as file +DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_65.276.606732521
restore not done; all files readonly, offline, or already restored
Finished restore at 2006/11/17 08:51:02

Article Feedback

Summary

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.

When attempting to restore archive logs that are already located on disk using RMAN the following message will be raised:

restore not done; all files readonly, offline, or already restored

Solution

There are three potential solutions:

  1. Use the RMAN copy command

RMAN> copy archivelog '+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487' to '/tmp/archive_seq_60.arc';

If there are only a few archivelogs required then the copy command can be repeated for each log. However if there are multiple archive logs below solutions may be preferable.

  1. Try to use the FORCE clause in the restore command to restore the archivelog to an alternate location even when the archvie already exists on disk:

RMAN> run {

2> set archivelog destination to '/tmp';

3> restore FORCE archivelog from logseq=60 until logseq=65;

4> }

  1. Use the RMAN uncatalog command.

RMAN> change archivelog from logseq=60 until logseq=65 uncatalog; 而不是uncatalog xxxx

uncataloged archive log

archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487 recid=64 stamp=606732490

uncataloged archive log

archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_61.263.606732499 recid=65 stamp=606732500

uncataloged archive log

archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_62.265.606732505 recid=66 stamp=606732507

uncataloged archive log

archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_63.278.606732509 recid=67 stamp=606732508

uncataloged archive log

archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_64.277.606732509 recid=68 stamp=606732511

uncataloged archive log

archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_65.276.606732521 recid=69 stamp=606732523

Uncataloged 6 objects

Once the archivelogs have been successfully uncataloged you are able to successfully restore the archive logs to new location.

RMAN> run {

2> set archivelog destination to '/tmp';

3> restore archivelog from logseq=60 until logseq=65;

4> }

executing command: SET ARCHIVELOG DESTINATION

Starting restore at 2006/11/17 08:57:06

using channel ORA_DISK_1

channel ORA_DISK_1: starting archive log restore to user-specified destination

archive log destination=/tmp

channel ORA_DISK_1: restoring archive log

archive log thread=1 sequence=60

channel ORA_DISK_1: restoring archive log

archive log thread=1 sequence=61

channel ORA_DISK_1: restoring archive log

archive log thread=1 sequence=62

channel ORA_DISK_1: restoring archive log

archive log thread=1 sequence=63

channel ORA_DISK_1: restoring archive log

archive log thread=1 sequence=64

channel ORA_DISK_1: restoring archive log

archive log thread=1 sequence=65

channel ORA_DISK_1: restored backup piece 1

piece handle=+DGROUP2/rman/backupset/2006_11_17/DB_tag20061117t084948_0.275.606732589 tag=TAG20061117T084948

channel ORA_DISK_1: restore complete

Finished restore at 2006/11/17 08:57:08

Following the successul restore of the archivelogs you can then continue to re-catalog the archivelogs back into the ASM diskgroup. Below is an example of cataloging one archivelog.

RMAN> catalog archivelog '+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487';

cataloged archive log

archive log filename=+DGROUP2/rman/archivelog/2006_11_17/thread_1_seq_60.267.606732487 recid=76 stamp=606733388

相关推荐
这个DBA有点耶3 分钟前
银行核心系统数据库迁移怎么选?6 步法+5 个避坑指南
数据库·安全·架构
风哥2号7 分钟前
数据库教程FGMT31‑Linux平台MySQL9.7安装配置与版本升级
数据库
hanchenxing15 分钟前
前端异步任务三方案:Celery vs Redis Stream vs BullMQ 实战对比消息队列
前端·数据库·redis·异步任务·方案对比
java_logo1 小时前
Docker 部署 Milvus:轻松搭建高性能向量数据库平台
数据库·docker·私有化部署·milvus·向量数据库·rag·轩辕镜像
A心有千千结2 小时前
GO 使用 OpenTelemetry 进行编译时插桩,实现零码注入
数据库·golang·可观测性·观测云
GreatVicent2 小时前
腾讯AI产业大会解读:Agent进场,企业基础设施怎么搭
大数据·数据库·人工智能·llm·agent·企业信息化
大模型码小白3 小时前
告别造假数据,直接连数据库查真实时序数据喂给 TimechoAI 大模型
java·数据库·人工智能·microsoft·架构
晚安日记wanna3 小时前
大表 DDL 面试翻车现场Online DDL 为什么还会锁死业务
数据库·面试·架构
IvorySQL3 小时前
PostgreSQL 日报|建库策略致备库静默丢数据(9 月 12 日)
数据库·人工智能·postgresql
这个DBA有点耶3 小时前
当Agent从“写SQL”变成“执行SQL”:数据库安全模型需要重新设计
数据库·aigc·dba