oracle rman keep

本文介绍了使用RMAN进行数据库备份的过程,包括遇到的问题及解决方法。特别关注了如何正确使用KEEPFOREVER选项,并提供了详细的命令示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

官方问BACKUP TAG Q107 DATABASE KEEP FOREVER;


RMAN> BACKUP TAG Q107 DATABASE KEEP FOREVER;

Starting backup at 05-FEB-18
current log archived

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 02/05/2018 19:19:10
RMAN-06522: KEEP FOREVER option is not supported without the recovery catalog

必须用catalog

[oracle@oel ~]$ rman target / catalog cataloguser/cataloguser@192.168.121.1/orcl

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Feb 5 19:19:35 2018

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

connected to target database: ORCL (DBID=1495093367)
connected to recovery catalog database

RMAN> BACKUP TAG Q107 DATABASE KEEP FOREVER;

Starting backup at 05-FEB-18
current log archived

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6 device type=DISK
backup will never be obsolete
archived logs required to recover from this backup will be backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 05-FEB-18
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 02/05/2018 19:19:50
ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

Oracle官方文档说

Note: You cannot use KEEP to override the retention policy for files stored in the fast recovery area. If you specify KEEP when backing up to the recovery area, then RMAN issues an error.

所以报错了

When KEEP is specified, RMAN creates multiple backup sets. RMAN backs up data files, archived redo log files, the control file, and the server parameter file with the options specified in the first backupOperand. Since a backup of the control file is already created, an autobackup of the control file is not created. RMAN uses the FORMAT, POOL, and TAG parameters for all the backups. For this reason, the FORMAT string must allow for the creation of multiple backup pieces. Specifying %U is the easiest way to meet this requirement.

RMAN> BACKUP TAG Q107 DATABASE KEEP FOREVER FORMAT '/home/oracle/keeptest/%U';

Starting backup at 05-FEB-18
current log archived

using channel ORA_DISK_1
backup will never be obsolete
archived logs required to recover from this backup will be backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 05-FEB-18
channel ORA_DISK_1: finished piece 1 at 05-FEB-18
piece handle=/home/oracle/keeptest/09sqg68k_1_1 tag=Q107 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35

using channel ORA_DISK_1
backup will never be obsolete
archived logs required to recover from this backup will be backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 05-FEB-18
channel ORA_DISK_1: finished piece 1 at 05-FEB-18
piece handle=/home/oracle/keeptest/0asqg69q_1_1 tag=Q107 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

current log archived
using channel ORA_DISK_1
backup will never be obsolete
archived logs required to recover from this backup will be backed up
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=19 RECID=12 STAMP=967317820
channel ORA_DISK_1: starting piece 1 at 05-FEB-18
channel ORA_DISK_1: finished piece 1 at 05-FEB-18
piece handle=/home/oracle/keeptest/0bsqg69u_1_1 tag=Q107 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

using channel ORA_DISK_1
backup will never be obsolete
archived logs required to recover from this backup will be backed up
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 05-FEB-18
channel ORA_DISK_1: finished piece 1 at 05-FEB-18
piece handle=/home/oracle/keeptest/0csqg6a2_1_1 tag=Q107 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-FEB-18

RMAN> change backup of archivelog all nokeep;

using channel ORA_DISK_1
keep attributes for the backup are deleted
backup set key=264 RECID=7 STAMP=967317822
keep attributes for the backup are deleted
backup set key=348 RECID=9 STAMP=967317937








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值