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>

相关推荐
阿里云大数据AI技术11 小时前
用 SQL 调大模型?Hologres + 百炼,让数据开发直接“对话”AI
sql·llm
tryCbest5 天前
数据库SQL学习
数据库·sql
jnrjian5 天前
ORA-01017 查找机器名 用户名 以及library cache lock 参数含义
数据库·oracle
TTc_6 天前
oracle中的union和union all有什么区别?
数据库·oracle
cowboy2586 天前
mysql5.7及以下版本查询所有后代值(包括本身)
数据库·sql
努力的lpp6 天前
SQL 报错注入
数据库·sql·web安全·网络安全·sql注入
麦聪聊数据6 天前
统一 Web SQL 平台如何收编企业内部的“野生数据看板”?
数据库·sql·低代码·微服务·架构
山峰哥6 天前
吃透 SQL 优化:告别慢查询,解锁数据库高性能
服务器·数据库·sql·oracle·性能优化·编辑器
南 阳6 天前
Python从入门到精通day37
数据库·python·oracle
轩情吖6 天前
MySQL初识
android·数据库·sql·mysql·adb·存储引擎