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 小时前
零基础从入门到精通MySQL(中篇):进阶篇——吃透多表查询、事务核心与高级特性,搞定复杂业务SQL
数据库·sql·mysql
荒川之神5 小时前
Oracle 数据仓库雪花模型设计(完整实战方案)
数据库·数据仓库·oracle
一江寒逸6 小时前
零基础从入门到精通MySQL(上篇):筑基篇——吃透核心概念与基础操作,打通SQL入门第一关
数据库·sql·mysql
流觞 无依7 小时前
DedeCMS plus/download.php SQL注入漏洞修复教程
sql·php
不会写DN7 小时前
SQL 多表操作全解
数据库·sql
荒川之神7 小时前
Oracle 数据仓库星座模型(Galaxy Model)设计原则
数据库·数据仓库·oracle
曹牧9 小时前
Oracle:
数据库·oracle
buhuimaren_9 小时前
pg日常维护
数据库·oracle
大虾别跑9 小时前
Oracle迁移
数据库·oracle
Trouvaille ~9 小时前
【MySQL篇】数据库操作:从创建到管理
linux·数据库·mysql·oracle·xshell·ddl