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

相关推荐
霖霖总总2 小时前
[Redis小技巧29]从 Setnx 到 Redlock:Redis 分布式锁的演进之路与生产级实践
数据库·redis·分布式
-ONLY-¥2 小时前
MySQL备份恢复全攻略
数据库·oracle
一个天蝎座 白勺 程序猿2 小时前
源网荷储实时互动需求下,时序数据库如何赋能新型电力系统?
数据库·时序数据库
笑梦无境2 小时前
mysql基础篇二(多年前整理)
数据库·mysql
艾伦_耶格宇2 小时前
【zabbix】-2 zabbix本地部署
数据库·zabbix
麻花20133 小时前
Oracle 数据泵导出与还原操作指南
数据库·oracle
邂逅you3 小时前
SQL温故与知新
数据库·sql
zhangren024683 小时前
Laravel7.x新特性全面解析
数据库·mysql·adb·php
鸽芷咕3 小时前
Oracle替换工程实践深度解析:金仓数据库破解PL/SQL“零改造”迁移难题
数据库·sql·oracle