rman 问题

1. RMAN Repeatedly Fail To Backup Archivelogs with RMAN-20242


There is a mis-match between the catalog contents and what is physically on disk in the archivelog directory.
Run the command:
  RMAN> list archivelog all;

# Compare the output with the contents of the archivelog directory.
  # RMAN-20242 is raised when we try to find a log in the rman repository that does not exist on disk.

If logs are missing from the archivelog directory you need to determine why:

1. Logs have been moved to another location to prevent archivelog directory from filling up:
   - backup the logs currently in the archivelog directory using the syntax:

RMAN>backup archivelog sequence between n and n2 thread N delete input;

# Then move the missing logs back into the archivelog directory and back them up,
      # again with delete input option.

2. Logs have been irretrievably lost (deleted):
   - In this case you need to resolve the discrepancy between the rman repository contents and what is actually on disk;

RMAN> crosscheck archivelog all;
      RMAN> delete expired archivelog all;

# If you do this, full recovery using ANY backup taken before this point is not possible
      # as full recovery cannot tolerate gaps in the redo stream.  
      # Take another full hot backup as soon as possible and change operational processes such that archivelog
   # backups are run more frequently to prevent the archivelog
directory from getting full; NEVER delete archivelogs manually,
      # always use RMAN to housekeep archivelogs.


2. RAC - RMAN backup specific Archivelog Sequence getting error RMAN-20242

RMAN> run {
 allocate channel d1 type disk;
 backup as copy archivelog from sequence 433 until sequence 434 format ‘/apps/oracle/rman/CUR/curprod_%t_%s_%r.arc‘;
 release channel d1;
using target database control file instead of recovery catalog
allocated channel: d1
channel d1: sid=2152 instance=curprod3 devtype=DISK

Starting backup at 23-JUL-08
released channel: d1

RMAN-03002: failure of backup command at 07/23/2008 17:33:45
RMAN-20242: specification does not match any archive log in the recovery catalog


This is a RAC database and the thread number was not specified in the backup statement.


Specify the thread as part of the backup command, for instance:

RMAN> backup archivelog from sequence 433 until sequence 434 thread 3 format ‘/apps/oracle/rman/CUR/curprod_%t_%s_%r.arc‘;


3. RMAN Backup Archivelog using LIKE operator failed RMAN-20242

RMAN ‘archivelog like‘ method is very useful when trying to backup archived log
on oracle parallel server and oracle parallel failsafe where archived logs exist
on all nodes local disks.

RMAN> run  {
 allocate channel c1 type disk;
    archivelog like ‘E:\oracle\oradata\prod\archive%‘;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure during compilation of command
RMAN-03013: command type: backup
ORACLE error from recovery catalog database: RMAN-20242: specification
does not match any archivelog in the recovery catalog

# To resolve the above error, query V$ARCHIVED_LOG to find out the archived log
# details and note the format of the name column.


SQL> select * from v$archived_log;

---------- ----------
---------- ---------- ----------------- --------- ------------- ---------
------------ --------- ---------- ---------- ---- ---- --- --- --- ---------
         1  419970034
         1       1524                 1 21-JAN-01        599954 25-JAN-01
      600067 25-JAN-01        103        512 FGRD FGRD NO  YES YES 25-JAN-01

# Notice the name is in UPPER case - ‘E:\ORACLE\ORADATA\PROD\ARCHIVE\PRODT001S01524.ARC‘.
# Modify the script and run again.


RMAN> run  {
 allocate channel c1 type disk;
    archivelog like ‘E:\ORACLE\ORADATA\PROD\ARCHIVE\PROD%‘ delete input;
 release channel c1;

RMAN-03022: compiling command: backup
RMAN-03023: executing command: backup
RMAN-08009: channel c1: starting archivelog backupset
RMAN-08502: set_count=36 set_stamp=420311754 creation_time=29-JAN-01
RMAN-08014: channel c1: specifying archivelog(s) in backup set
RMAN-08504: input archivelog thread=1 sequence=1538 recid=15 stamp=420196579
RMAN-08504: input archivelog thread=1 sequence=1539 recid=16 stamp=420239024
RMAN-08013: channel c1: piece 1 created
RMAN-08503: piece handle=E:\ORACLE\ORA817\DATABASE\14CGQSMA_1_1 comment=NONE
RMAN-08525: backup set complete, elapsed time: 00:00:02
RMAN-08071: channel c1: deleting archivelog(s)
RMAN-08514: archivelog filename=E:\ORACLE\ORADATA\PROD\ARCHIVE\PRODT001S01541.ARC recid=18 stamp=420310800
RMAN-08514: archivelog filename=E:\ORACLE\ORADATA\PROD\ARCHIVE\PRODT001S01542.ARC recid=19 stamp=420310879
RMAN-03023: executing command: partial resync
RMAN-08003: starting partial resync of recovery catalog
RMAN-08005: partial resync complete

RMAN-03022: compiling command: release
RMAN-03023: executing command: release
RMAN-08031: released channel: c1

4. Rman-20242 raised for Backup Archivelogs when using SEQUENCE, if logs do not belong to current incarnation

RMAN list and backup commands when used for archivelogs, specifying sequence or sequence range is
limited to logs only in current incarnation. For example:

RMAN> list archivelog all;

using target database control file instead of recovery catalog

List of Archived Log Copies
Key Thrd Seq  S Low Time Name
------- ----  ------- - ------------------ ----
99    1    6  A 09-nov-07 12:30:58 D:\ORACLE\PRODUCT\10.2.0..........O1_MF_1_6_3MM4NR1W_.ARC
95    1    6  A 09-nov-07 12:30:58 D:\ORACLE\PRODUCT\10.2.0..........O1_MF_1_6_3MJT5FQH_.ARC
98    1    7  A 12-nov-07 14:52:25 D:\ORACLE\PRODUCT\10.2.0..........O1_MF_1_7_3MM4NN0R_.ARC
96    1    7  A 12-nov-07 14:52:25 D:\ORACLE\PRODUCT\10.2.0..........O1_MF_1_7_3MM3HO29_.ARC
97    1    8  A 13-nov-07 11:43:46 D:\ORACLE\PRODUCT\10.2.0..........O1_MF_1_8_3MM4NLFT_.ARC
100   1    1  A 13-nov-07 12:03:30 D:\ORACLE\PRODUCT\10.2.0..........O1_MF_1_1_3MM5TSTX_.ARC

Log sequences 6,7 and 8 belong to previous incarnation.
Log sequence 1 belongs to current incarnation.

RMAN> list archivelog sequence=6;
specification does not match any archive log in the recovery catalog

RMAN> list archivelog ‘D:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\V10203\ARCHIVELOG\2007_11_13\O1_MF_1_6_3MM4NR1W_.ARC‘;

List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - ------------------ ----
1    6 A 09-nov-07 12:30:58

RMAN> backup archivelog all;
== ALL logs are backed up.

RMAN> backup archivelog sequence=6;

Starting backup at 13-nov-07 12:53:27
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 11/13/2007 12:53:28
RMAN-20242: specification does not match any archive log in the recovery catalog



This problem is NOT confined to SAP databases.
Anyone trying to backup logs using SEQUENCE will find they cannot backup logs from an earlier
incarnation where the logs are still avaliable on disk. Nor can the logs be listed using SEQUENCE.


Apply the fix for Bug 5648115 when it becomes available.
Bug 5648115 is fixed in 11GR2.


Do NOT use SEQUENCE - use SCN instead - not ideal as you would need to get SCN details from v$archived_log first:

sql> select first_change#, next_change# from v$archived_log where sequence#=n and resetlogs_change#=N;

You can take N from the output from:

RMAN> list incarnation;

时间: 04-05

rman 问题的相关文章


关于配置RMAN备份环境你可以给每个目标数据库设置一些固定的配置,这些配置控制着RMAN多个方面的行为.例如,你可配置备份的保存策略.默认的备份目录.默认的备份设备类型等.你可以用show命令来查看配置及用configure来修改RMAN的配置. 1.查看和清除RMAN配置参数show命令可以查看RMAN当前的配置情况,以及这些参数当前是否设置了默认值.SHOW ALL; --查看说有的配置情况 你也可以通过SHOW命令加指定的配置参数的名字来查看它的值.例:SHOW RETENTION POL

Oracle 11gR2使用RMAN duplicate复制数据库

11g的RMAN duplicate 个人感觉比10g的先进了很多,10g需在rman备份的基础上进行复制,使用RMAN duplicate创建一个数据完全相同但DBID不同的数据库.而11g的RMAN duplicate 可通过Active database duplicate和Backup-based duplicate两种方法实现.Active database duplicate方式不需要先把目标数据库进行rman备份,只要目标数据库处于归档模式下即可直接通过网络对数据库进行copy,且


利用SHELL脚本来验证Oracle数据库RMAN备份集的有效性 作者:赵全文  网名:guestart 我们生产环境的Oracle数据库都做了RMAN备份,是采用了一周的RMAN备份保留策略:除了使用RMAN备份以外,我们还使用了爱数(Eisoo)备份软件来进行备份,可以说是做到了有备无患.可是,如果有一天,Oracle数据库由于主机层面硬件原因或是数据库层面的原因不能对外提供高可用服务的时候,假设数据丢了一大部分,我们只有用RMAN备份来进行恢复,再如果发现,RMAN备份失效了,那就往地缝里


报错1.数据库开启block change tracking ,恢复完成后打开因文件不存在报错. RMAN> alter database open resetlogs; RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: ========

Oracle 11g rman备份相关

1.验证备份是否可以被成功还原,完全还原确定需应用哪些备份集和归档日志. RMAN> restore database preview; Starting restore at 07-OCT-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=202 device type=DISK allocated cha


备份Spfile.控制文件.数据文件.归档日志文件,并删除冗余备份.可结合rman cmdfile=FILE_PATH msglog=$HOME/backup/log/backup_level0.log和CRONTAB进行周期备份. run { allocate channel c1 device type disk; backup incremental level 0 format '/export/home/oracle/backup/db_full_incre0_%U.bkp'tag '

Oracle RMAN 备份控制文件/恢复控制文件

--备份控制文件 rman target / RMAN> startup RMAN> configure controlfile autobackup on; --启动自动备份 RMAN> show CONTROLFILE AUTOBACKUP;  --显示是否自动备份控制文件 RMAN> configure controlfile autobackup format for device type disk to '/backup/%F'; --设置控制文件备份路径 RMAN&g

oracle 11g RMAN:Active Database Duplication for standby database 创建dg 命令解读

基于生产的duplicate 复制,如果事先没有手动配置pfile(设定内存,进程,dg相关配置参数,数据库相关路径参数)则会出现各种参数无法转换的问题: 因为duplicate 会从生产自动拷贝pfile,控制文件,密码文件过来,如果主库和备库环境不一样(数据库软件路径,数据文件存储路径) 如果没在duplicate的命令中完整指定新环境备库的各种参数涉及路径,及转换参数,就会默认使用从主库拷贝过来的spfile中的参数设置(会忽略oracle 自定义的的缺省配置:比如adr 缺省会放在ORA


rman异机恢复 注意事项: 1.源数据库与目标数据库的目录结构相同 2.目标数据库只需要安装ORACLE软件(但是参数文件中指定的目录要创建) 3.要将源数据库的数据文件,参数文件,控制文件,密码文件,归档日志统统备份 1.源数据库备份 参数文件与控制文件自动备份 CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/r

oracle 11g 基于备份的rman duplicate

基于备份的rman duplicate 命令来创建standby database 前提条件: 保证原库数据库的备份,归档对于standby 端是完全可见的, 这里假设原库和目标端数据文件,日志文件等所有文件存放结构完全相同: 配置主库,备库静态监听,主库处于归档模式,和force logging 1.对主数据库进行必要的更改. a. 启用 force logging. b. 如果没有密码文件,则创建密码文件. c. 创建备用 redo 日志. d. 修改参数文件,使其适用于 Dataguard