如何使用RMAN验证备份的有效性

63次阅读
没有评论

共计 3679 个字符,预计需要花费 10 分钟才能阅读完成。

这篇文章主要介绍如何使用 RMAN 验证备份的有效性,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

RMAN 提供 VALIDATE 的命令,可以用于校验备份集的有效性,常用命令如下:
restore validate controlfile;
restore validate database;
验证命令会建议备份的存在性、完好性和可恢复性,帮助我们确认备份的有效与否。

比如验证控制文件和参数文件:

RMAN  restore validate controlfile;

Starting restore at 25-JAN-10
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=388 devtype=DISK

channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /opt/oracle/product/db10g/dbs/c-1341966532-20100125-01
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/product/db10g/dbs/c-1341966532-20100125-01 tag=TAG20100125T094817
channel ORA_DISK_1: validation complete, elapsed time: 00:00:02
Finished restore at 25-JAN-10

RMAN  restore validate spfile;

Starting restore at 25-JAN-10
using channel ORA_DISK_1

channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /opt/oracle/product/db10g/dbs/c-1341966532-20100116-00
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/product/db10g/dbs/c-1341966532-20100116-00 tag=TAG20100116T033113
channel ORA_DISK_1: validation complete, elapsed time: 00:00:02
Finished restore at 25-JAN-10

验证全备份一般会很慢,谨慎试验:

RMAN  restore validate database;

Starting restore at 25-JAN-10
using channel ORA_DISK_1

data file 22 will be created automatically during restore operation
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/orderfullback_order_20100124_4691
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderfullback_order_20100124_4691 tag=order
channel ORA_DISK_1: validation complete, elapsed time: 00:02:36
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/orderfullback_order_20100124_4692
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderfullback_order_20100124_4692 tag=order
channel ORA_DISK_1: validation complete, elapsed time: 00:01:45
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/orderfullback_order_20100124_4693
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderfullback_order_20100124_4693 tag=order
channel ORA_DISK_1: validation complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/orderfullback_order_20100124_4694
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderfullback_order_20100124_4694 tag=order
channel ORA_DISK_1: validation complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/orderfullback_order_20100124_4695
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderfullback_order_20100124_4695 tag=order
channel ORA_DISK_1: validation complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/orderfullback_order_20100124_4696
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderfullback_order_20100124_4696 tag=order
channel ORA_DISK_1: validation complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting validation of datafile backupset
channel ORA_DISK_1: reading from backup piece /data3/ordrbak/orderfullback_order_20100124_4697
channel ORA_DISK_1: restored backup piece 1
piece handle=/data3/ordrbak/orderfullback_order_20100124_4697 tag=order
channel ORA_DISK_1: validation complete, elapsed time: 00:00:07
failover to previous backup

data file 22 will be created automatically during restore operation
Finished restore at 25-JAN-10

验证命令并不会真正执行恢复,所以可以减去异机测试等的麻烦。

以上是“如何使用 RMAN 验证备份的有效性”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-24发表,共计3679字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)