FRA中 keep的backup set 不保险

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.3 [Release 10.2 to 11.2]

Information in this document applies to any platform.

Goal

When I try to 'change...keep' a backupset in the FRA, I get error ORA-19811, how can I KEEP a backup written to the Flash Recovery Area (FRA)?

RESEARCH

=========

OERR ORA-19811 cannot have files in DB_RECOVERY_FILE_DEST with keep attribute
Note.305817.1 FAQ - Flash Recovery Area feature of 10G
Note 315098.1 How is the space pressure managed in the Flash Recovery Area - Example.

Solution

ANSWER

=======

As the space management of the FRA is automatic, you cannot KEEP a backupset created in the FRA.

A backup needed to be KEPT, must be created outside the flash recovery area. There are several ways of accomplishing this:

  1. When performing the backup, use FORMAT along with the backup command to place the backupsets to a location other than default (which would be the FRA).

  2. Copy the desired backups in another location. If restore of these backups is ever required, and the RMAN meta data has aged out, then 'catalog backuppiece' and restore the backup. Note, this is a new Oracle10g option.

3, Once the backupset deleted from the FRA, due to space management, the backup can then be KEPT using the 'change' command. In other words, if the FRA is copied to tape (or to backup copied to alternative disk location using 'backup backupset', once the backupset is deleted from the FRA, it's KEEP options can be changed.

Note, this can be expedited by manually coping the backupset at the OS level, delete the original backup, catalog and keep the copy. See the following testcase:

TESTCASE


RMAN> list backup of database summary;

List of Backups

===============

Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag


135 B F A DISK 28-NOV-06 1 1 NO TAG20061128T150309

218 B F A DISK 28-NOV-06 1 1 NO TAG20061128T161144

423 B F A DISK 30-NOV-06 1 1 NO TAG20061130T130903

452 B F A DISK 01-DEC-06 1 1 NO TAG20061201T100942

RMAN> list backupset 452;

List of Backup Sets

===================

BS Key Type LV Size Device Type Elapsed Time Completion Time


452 Full 286.59M DISK 00:00:48 01-DEC-06

BP Key: 455 Status: AVAILABLE Compressed: NO Tag: TAG20061201T100942

Piece Name:

/<path>/flash_recovery_area/<db name>/backupset/2006_12_01/<name of backuppiece>

List of Datafiles in backup set 452

File LV Type Ckp SCN Ckp Time Name


1 Full 382053 01-DEC-06 /<path>/system01.dbf

2 Full 382053 01-DEC-06 /<path>/undotbs01.dbf

3 Full 382053 01-DEC-06 /<path>/sysaux01.dbf

4 Full 382053 01-DEC-06 /<path>//users01.dbf

At OS:


$ cp /<path>/flash_recovery_area/<db name>/backupset/2006_12_01/<name of backuppiece> /<new path>

$ pwd /<new path>

$ ls <name of backuppiece>

In RMAN:


RMAN> delete backupset 452;

using channel ORA_DISK_1

List of Backup Pieces

BP Key BS Key Pc# Cp# Status Device Type Piece Name


455 452 1 1 AVAILABLE DISK

/<path>/flash_recovery_area/<db name>/backupset/2006_12_01/<name of backuppiece>

Do you really want to delete the above objects (enter YES or NO)? yes

deleted backup piece

backup piece

handle=/<path>/flash_recovery_area/<db name>/backupset/2006_12_01/<name of backuppiece> recid=24 stamp=608033386

Deleted 1 objects

RMAN> catalog backuppiece '/<backuppiece in new copied path>';

cataloged backuppiece

backup piece handle=/<backuppiece in new copied path> recid=26 stamp=608033760

RMAN> list backup of database summary;

List of Backups

===============

Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag


135 B F A DISK 28-NOV-06 1 1 NO TAG20061128T150309

218 B F A DISK 28-NOV-06 1 1 NO TAG20061128T161144

423 B F A DISK 30-NOV-06 1 1 NO TAG20061130T130903

489 B F A DISK 01-DEC-06 1 1 NO TAG20061201T100942

RMAN> change backupset 489 keep forever nologs;

using channel ORA_DISK_1

keep attributes for the backup are changed

backup will never be obsolete

archived logs required to recover from this backup will not be kept

backup set key=489 recid=23 stamp=608033760

RMAN> list backupset 489;

List of Backup Sets

===================

BS Key Type LV Size Device Type Elapsed Time Completion Time


489 Full 286.59M DISK 00:00:00 01-DEC-06

BP Key: 495 Status: AVAILABLE Compressed: NO Tag: TAG20061201T100942

Piece Name: /<backuppiece in new copied path>

Keep: NOLOGS Until: FOREVER

List of Datafiles in backup set 489

File LV Type Ckp SCN Ckp Time Name


1 Full 382053 01-DEC-06 /<path>/system01.dbf

2 Full 382053 01-DEC-06 /<path>/undotbs01.dbf

3 Full 382053 01-DEC-06 /<path>/sysaux01.dbf

4 Full 382053 01-DEC-06 /<path>/users01.dbf

RMAN>

相关推荐
世界尽头与你4 小时前
(修复方案)CVE-2023-22047: Oracle PeopleSoft Enterprise PeopleTools 未授权访问漏洞
数据库·安全·oracle·渗透测试
Mr_Xuhhh5 小时前
MySQL函数详解:日期、字符串、数学及其他常用函数
java·数据库·sql
司沐_Simuoss10 小时前
Text to SQL系统的千层套路~
数据库·人工智能·sql·语言模型·系统架构
ActionTech13 小时前
MySQL 用好 Optimizer Trace,深刻理解 SQL 优化过程!
sql·mysql·oracle
Mr_Xuhhh14 小时前
MySQL索引深度解析:从原理到实践
数据库·sql·mysql
多多*14 小时前
Mysql数据库相关 事务 MVCC与锁的爱恨情仇 锁的层次架构 InnoDB锁分析
java·数据库·windows·sql·oracle·面试·哈希算法
Monkey的自我迭代15 小时前
实战项目数据桥agent复盘
数据库·python·oracle
何以不说话16 小时前
堡垒机jumpserver
运维·sql
远方160916 小时前
112-Oracle database 26ai下载和安装环境准备
大数据·数据库·sql·oracle·database
Albert Tan16 小时前
Oracle EBS 12.2 审计追踪
数据库·oracle