ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RMAN分批restore/apply archivelog恢复数据库

RMAN分批restore/apply archivelog恢复数据库

原创 Linux操作系统 作者:zergduan 时间:2008-04-10 19:23:38 0 删除 编辑

recoverOptionList
Specifies various recovery options.

DELETE ARCHIVELOG [MAXSIZE integer [K|M|G]]
Deletes archived logs restored from backups or copies that are no longer needed. RMAN does not delete archived logs that were already on disk before the RESTORE command started.

If you do not specify MAXSIZE, then RMAN deletes restored archived logs as they are applied. If you specify MAXSIZE, then RMAN will not use more than integer amount of disk space for restored archived logs. If recovery requires the restore of a log larger than the MAXSIZE value, then RMAN reports an error indicating that you should increase the MAXSIZE value. If MAXSIZE is smaller than the backup set containing the logs, then RMAN must read the backup set more than once. Hence, RMAN issues a warning that MAXSIZE should be increased.

正是我想要的。

因为我的归档空间不足以一次把需要的archivelog全部restore后再apply~

我需要的是让rman先restore一部分archivelog,应用后删除,然后继续restore剩下的archivelog再应用...


看样子DELETE ARCHIVELOG [MAXSIZE integer [K|M|G]]提供了这个功能.
看了网上对这个的参数的说法,发现有些问题,所以
自己翻译一下:
用来删除已经不需要的从备份集或备份镜像中restore的archivelog.RMAN不会删除在restore之前已经存在于磁盘上的archivelog。

如果你指定MAXSIZE,RMAN将删除restore后已经应用的archivelog.如果指定的MAXSIZE,RMAN将用小于MAXSIZE的磁盘空间来restore archivelog.如果recover需要的restore的某个archivelog的大小超过MAXSIZE,RMAN将返回一个错误,提醒你应该增大MAXSIZE的大小.如果MAXSIZE小于archivelog的备份集的大小,RMAN必须重复读取多次同一个archivelog的备份集.RMAN将发出一个警告:应该增大MAXSIZE.

也就是说我某次恢复需要应用备份集中的300G的archivelog,但是归档目录只剩下100G可用空间。
可以用下面的语法来让rman实现自动删除已经应用的archivelog并保持每次只restore100G
recover database delete archivelog maxsize 100G;
每个archivelog的大小应该小于100G(否则抱错)
每个archivelog的备份集应该小于100G否则会很慢(多次读取一个备份集),并会报出警告.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/386081/viewspace-234380/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-03-12

  • 博文量
    77
  • 访问量
    757962