欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

RMAN 的备份保留策略

发布时间:2024/8/26 编程问答 46 豆豆
生活随笔 收集整理的这篇文章主要介绍了 RMAN 的备份保留策略 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

RMAN 的备份保留策略:

命令格式:

configure retention policy clear ---------------备份保留策略使用默认值

configure retention policy to none------------不采用任何备份保留策略

configure retention policy to recover window of integer days------------基于时间的备份保留策略,保留几天前的备份文件

configure retention policy to redundancy integer-------基于冗余备份的备份保留策略,对备份文件保留几个冗余备份

1:基于时间

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

保留七天内的所有备份。

2:基于冗余备份

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3

为每个数据文件保留3个冗余备份。

 

备份保留策略不需要的文件是废弃状态的文件,比如:八天前的数据文件和时间最早的第四个冗余备份

REPORT OBSOLETE命令查看当前处于废弃状态的备份文件

DELETE OBSOLET 命令可立刻删除备份保留策略 不需要的文件(废弃文件)。

====文档解释====

Configuring a Retention Policy

Retention policy governs how long database backups are retained, and 

determines how far into the past you can recover your database. Retention policy 

can be set in terms of a recovery window (how far into the past you need to be 

able to recover your database), or a redundancy value (how many backups of 

each file must be retained). Choosing an effective retention policy is a vital part 

of your backup strategy. 

This command ensures that RMAN retains all backups needed to recover the 

database to any point in time in the last 7 days:

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;

This command ensures that RMAN retains three backups of each datafile:

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;

Use DELETE OBSOLETE to immediately delete backups no longer required by the 

retention policy. (For backups stored in a flash recovery area, you do not need to 

perform this step. The database automatically deletes obsolete backups in the 

flash recovery area when space is needed, as well as files that have been backed 

up to a media manager.)

=======end===============================================

总结

以上是生活随笔为你收集整理的RMAN 的备份保留策略的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。