ITPub博客

首页 > 数据库 > Oracle > RMAN - backup archivelog all 与 backup database plus archivelog 区别

RMAN - backup archivelog all 与 backup database plus archivelog 区别

Oracle 作者:bitifi 时间:2015-11-07 09:29:37 0 删除 编辑
OLTP系统的生产库一般都是打开归档模式,当CUD操作频繁并且时常使用大批量处理时,每天的归档日志也是超级大的,如果长期保留这些归档日志磁盘空间消耗是很恐怖的,所以我们在使用RMAN进行数据库备份时,将归档日志进行备份,来释放磁盘空间。<br /> <br /> 1. 备份归档日志方式:<br /> &nbsp; &nbsp;<br /> 1.1. 单独备份归档日志:backup archivelog all<br /> 1.2 在执行备库时一起备份归档日志:backup database plus archivelog;<br /> <br /> <br /> 2. 这两种方式有什么区别呢?<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br /> &nbsp;2.1 运行backup archivelog all &nbsp;命令时执行的步骤:<br /> &nbsp; &nbsp; &nbsp; 1). alter system archive log current; &nbsp; &nbsp; 归档当前日志&nbsp;<br /> &nbsp; &nbsp; &nbsp; 2). backup &nbsp;archivelog all ; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;备份所有归档日志<br /> &nbsp;<br /> &nbsp;2.2 运行backup database plus archivelog,的运行步骤是;<br /> &nbsp; &nbsp; &nbsp; 1).alter system archive log current; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;归档当前日志<br /> &nbsp; &nbsp; &nbsp; 2).backup archivelog all; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;备份所有归档日志,注意如果备份优化被启用,RMAN只会备份未备份过的日志<br /> &nbsp; &nbsp; &nbsp; 3).backup database; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 备份数据库<br /> &nbsp; &nbsp; &nbsp; 4).alter system archive log current; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;归档当前日志<br /> &nbsp; &nbsp; &nbsp; 5).Backs up any remaining archived logs generated during the backup; &nbsp; 备份备份过程中生成的任何剩余的归档日志&nbsp;<br /> &nbsp;<br /> 3. 删除归档日志一般在备份归档日志同时加上一个参数:delete all input<br /> &nbsp; &nbsp;例如:backup database plus archivelog delete all input; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;执行此命令是会将所有的归档日志进行备份,并且在备份的同时删除已备份的归档日志。<br /> <br /> &nbsp;所以如果在RMAN备份脚本中有plus archivelog 参数 就无需在备份归档日志之前执行: sql 'alter system archive log current';<br /> <div style="white-space:nowrap;"> <br /> </div>

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

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

注册时间:2015-09-21

  • 博文量
    211
  • 访问量
    275781