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>

相关推荐
寂寞恋上夜34 分钟前
数据迁移方案怎么写:迁移策略/回滚方案/验证方法(附完整模板)
网络·数据库·oracle·markdown转xmind·deepseek思维导图
SelectDB技术团队1 小时前
驾驭 CPU 与编译器:Apache Doris 实现极致性能的底层逻辑
数据库·数据仓库·人工智能·sql·apache
tc&2 小时前
为什么 Kamailio 模块封装的 MySQL 函数能有效防范 SQL 注入?
数据库·sql·mysql·网络攻击模型·kamailio
float_六七2 小时前
数据库管理系统(DBMS) 的核心组成部分
数据库·oracle
写代码的【黑咖啡】3 小时前
深入理解 Python 中的 SQLAlchemy
开发语言·python·oracle
心丑姑娘4 小时前
使用ClickHouse时的劣质SQL样例
数据库·sql·clickhouse
dishugj4 小时前
【Oracle】 Flashback(闪回)技术实操指南
数据库·oracle·flashback
lkbhua莱克瓦245 小时前
进阶-存储对象2-存储过程上
java·开发语言·数据库·sql·mysql
Insist7535 小时前
KingbaseES 集群运维案例之 --- 集群架构拆分为单实例操作
网络·数据库·oracle
lkbhua莱克瓦245 小时前
进阶-存储对象1-视图
java·数据库·sql·mysql·视图