暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

RMAN> delete obsolete recovery window of 3 days;

原创 qwer 2023-05-24
554

keep in mind that 'delete obsolete recovery window of 3 days;" does not mean that all backups older than 3 days will be deleted. 

All backups needed to be able to recover to a point within the last 3 days (sysdate - 3 at the time of the command) will be retained regardless of age. 

So, if your most recent full or inc 0 backup is 5 years old, your 'recovery window of 3 days' will still require 5 years worth of backups.


RMAN Expired vs Obsolete Backups

Two terms that are very important when it comes to RMAN backups validation they are


Expired backups

Let's take you trigger an RMAN backup and someone deleted backup set or backup pieces at OS level. 

The database CONTROFILE has the details of the backup on disk but at OS level the backup file does not exists.

We can run RMAN crosscheck command to check if backup files exists at OS level or not. If the backup files are not found, RMAN will mark it as EXPIRED.

RMAN> crosscheck backup;

DBA Action

The first action a DBA must take is to find out where the backup pieces are. Did a junior DBA move them to different location or different disk due to space issues.

If you can find the backup pieces, put them back into the original location and run crosscheck backup command again via RMAN.

If you are not able to find backup pieces, then you must clear the expired backup entries from RMAN (controlfile). Use below command to delete expired backups

RMAN> delete expired backup;



Obsolete backups

The general meaning of OBSOLETE is no longer used or required.

RMAN considers backups as OBSOLETE when they are no longer required for database recovery.

This is done by one of the RMAN CONFIGURATION parameters.


For example, we set RMAN retention policy to redundancy 4. 

This means that if we have 5 database backups, the first one will be marked as OBSOLETE because we want to keep 4 copies of RMAN backups.

We use below command to list all the obsolete backups inside RMAN

RMAN> report obsolete;

DBA Action

IF the FRA location is full, then do not worry, RMAN is intelligent, it will overwrite the obsolete backups.

If you find obsolete backups, you can simply delete the backups (as they are no longer needed for recovery)

RMAN> delete obsolete;
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论