使用Rman的Plus archvielog选项简化数据库备份操作
2024-07-21 02:11:35
供稿:网友
oracle9i开始rman提供plus archivelog选项,极大的简化了rman备份的操作。
当你定义plus archivelog语句时,rman执行如下步骤的操作:
1。运行一个alter system archivelog current命令
2。运行backup archivelog all命令。注意如果备份优化被启用,rman只会备份未备份过的日志
3。备份backup命令中定义的文件
4。运行alter system archivelog current命令
5。备份所有的剩下的归档日志
测试备份脚本:
backup database format '/opt/oracle/orabak/full_%d_%t_%s'plus archivelog format '/opt/oracle/orabak/arch_%d_%t_%s'delete all input;
测试日志:
[[email protected] oracle]$ rman target /recovery manager: release 9.2.0.4.0 - productioncopyright (c) 1995, 2002, oracle corporation. all rights reserved.connected to target database: conner (dbid=3152029224)rman> run {2> backup database 3> format '/opt/oracle/orabak/full%d_%t_%s'4> plus archivelog 5> format '/opt/oracle/orabak/arch_%d_%t_%s'6> delete all input; }starting backup at 04-nov-04current log archivedusing target database controlfile instead of recovery catalogallocated channel: ora_disk_1channel ora_disk_1: sid=12 devtype=diskchannel ora_disk_1: starting archive log backupsetchannel ora_disk_1: specifying archive log(s) in backup setinput archive log thread=1 sequence=163 recid=6 stamp=541351580channel ora_disk_1: starting piece 1 at 04-nov-04channel ora_disk_1: finished piece 1 at 04-nov-04piece handle=/opt/oracle/orabak/arch_conner_20041104_7 comment=nonechannel ora_disk_1: backup set complete, elapsed time: 00:00:02channel ora_disk_1: deleting archive log(s)archive log filename=/opt/oracle/oradata/conner/archive/1_163.dbf recid=6 stamp=541351580finished backup at 04-nov-04starting backup at 04-nov-04using channel ora_disk_1channel ora_disk_1: starting full datafile backupsetchannel ora_disk_1: specifying datafile(s) in backupsetincluding current spfile in backupsetincluding current controlfile in backupsetinput datafile fno=00004 name=/opt/oracle/oradata/conner/eygle01.dbfinput datafile fno=00001 name=/opt/oracle/oradata/conner/system01.dbfinput datafile fno=00002 name=/opt/oracle/oradata/conner/undotbs01.dbfinput datafile fno=00003 name=/opt/oracle/oradata/conner/users01.dbfchannel ora_disk_1: starting piece 1 at 04-nov-04aaaachannel ora_disk_1: finished piece 1 at 04-nov-04piece handle=/opt/oracle/orabak/full_conner_20041104_8 comment=nonechannel ora_disk_1: backup set complete, elapsed time: 00:04:04finished backup at 04-nov-04starting backup at 04-nov-04current log archivedusing channel ora_disk_1channel ora_disk_1: starting archive log backupsetchannel ora_disk_1: specifying archive log(s) in backup setinput archive log thread=1 sequence=164 recid=7 stamp=541351832channel ora_disk_1: starting piece 1 at 04-nov-04channel ora_disk_1: finished piece 1 at 04-nov-04piece handle=/opt/oracle/orabak/arch_conner_20041104_9 comment=nonechannel ora_disk_1: backup set complete, elapsed time: 00:00:02channel ora_disk_1: deleting archive log(s)archive log filename=/opt/oracle/oradata/conner/archive/1_164.dbf recid=7 stamp=541351832finished backup at 04-nov-04rman>
通过plus archivelog,简化了备份操作,同时确保需要的日志都被备份。
[[email protected] orabak]$ ls -ltotal 751628-rw-r----- 1 oracle dba 156160 nov 4 15:26 arch_conner_20041104_7-rw-r----- 1 oracle dba 60928 nov 4 15:30 arch_conner_20041104_9-rw-r----- 1 oracle dba 768679936 nov 4 15:30 full_conner_20041104_8
本文作者:
eygle,oracle技术关注者,来自中国最大的oracle技术论坛itpub.
www.eygle.com是作者的个人站点.你可通过[email protected]来联系作者.欢迎技术探讨交流以及链接交换.
原文出处:
http://www.eygle.com/ha/use.rman.plus.archivelog.option.htm