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

相关推荐
倔强的石头_3 天前
《Kingbase护城河》——数据库存储空间全景探测与精细化瘦身实战
数据库
冬奇Lab3 天前
每日一个开源项目(第134篇):Zvec - 阿里开源的嵌入式向量数据库,向量搜索界的 SQLite
数据库·人工智能·llm
ClouGence4 天前
Oracle CDC 架构优化:从主库直连到 DataGuard 备库同步
数据库·后端·oracle
无响应de神4 天前
三、用户与权限管理
数据库·mysql
麦聪聊数据4 天前
数据服务化时代:企业数据能力输出的核心路径
数据库
shushangyun_4 天前
2026年快消品B2B系统推荐:支持终端门店订货、促销政策自动化的工具?
java·运维·网络·数据库·人工智能·spring·自动化
DARLING Zero two♡4 天前
【MySQL数据库】数据类型与表约束
数据库·mysql
曹牧4 天前
Oracle EXPLAIN PLAN
数据库·oracle
BD_Marathon4 天前
SQL学习指南——视图
数据库·sql
活宝小娜4 天前
mysql详细安装教程
数据库·mysql·adb