Oracle笔记
2010年9月10日 04:25
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; //开启控制文件自动备份
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> backup database spfile include current controlfile plus archivelog;
/*备份归档日志,由于命令中带有plus archivelog,因此手动备份归档日志*/
Starting backup at 09-SEP-10
current log archived //当前日志归档
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=143 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=4 recid=1 stamp=729289389
channel ORA_DISK_1: starting piece 1 at 09-SEP-10
channel ORA_DISK_1: finished piece 1 at 09-SEP-10
piece handle=/home/oracle/oracle/flash_recovery_area/ORCL/backupset/2010_09_09/o1_mf_annnn_TAG20100909T202309_68knfh2s_.bkp tag=TAG20100909T202309 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 09-SEP-10
/*备份数据文件,控制文件和服务器参数文件*/
Starting backup at 09-SEP-10
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/oracle/oracle/oradata/orcl/system01.dbf
input datafile fno=00003 name=/home/oracle/oracle/oradata/orcl/sysaux01.dbf
input datafile fno=00005 name=/home/oracle/oracle/oradata/orcl/example01.dbf
input datafile fno=00002 name=/home/oracle/oracle/oradata/orcl/undotbs01.dbf
input datafile fno=00004 name=/home/oracle/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 09-SEP-10
channel ORA_DISK_1: finished piece 1 at 09-SEP-10
piece handle=/home/oracle/oracle/flash_recovery_area/ORCL/backupset/2010_09_09/o1_mf_nnndf_TAG20100909T202312_68knfjll_.bkp tag=TAG20100909T202312 comment=NONE //数据文件备份位置
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 09-SEP-10
channel ORA_DISK_1: finished piece 1 at 09-SEP-10
piece handle=/home/oracle/oracle/flash_recovery_area/ORCL/backupset/2010_09_09/o1_mf_ncsnf_TAG20100909T202312_68knk68q_.bkp tag=TAG20100909T202312 comment=NONE //控制文件和服务器参数文件位置
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 09-SEP-10
/*归档日志再次被备份,事后查看备份文件,发现第一次归档备份文件大小是第二次的数百倍,可能因为是Open Backup,数据库在备份期间生成了重做日志,因此需要再次备份,证据就是Close Backup的时候不会有第二次备份归档日志,他会显示:specification does not match any archive log in the recovery catalog backup cancelled because all files were skipped*/
Starting backup at 09-SEP-10
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=5 recid=2 stamp=729289512
channel ORA_DISK_1: starting piece 1 at 09-SEP-10
channel ORA_DISK_1: finished piece 1 at 09-SEP-10
piece handle=/home/oracle/oracle/flash_recovery_area/ORCL/backupset/2010_09_09/o1_mf_annnn_TAG20100909T202512_68knk991_.bkp tag=TAG20100909T202512 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 09-SEP-10
/*由于之前开启了自动备份控制文件和服务器参数文件,因此他们再次被备份*/
Starting Control File and SPFILE Autobackup at 09-SEP-10
piece handle=/home/oracle/oracle/flash_recovery_area/ORCL/autobackup/2010_09_09/o1_mf_s_729289514_68knkby5_.bkp comment=NONE //注意不是放在backupset文件夹下面,而是放在autobackup文件夹下面
Finished Control File and SPFILE Autobackup at 09-SEP-10
/*
备份完毕,共五个文件,四个在backupset文件夹下,一个在autobackup文件夹下
从上述文字可知,如果开启控制文件自动备份,那么只要发生备份,控制文件和服务器参数文件必然会自动备份,无论备份命令中是否已经显式的要求备份他们了,且自动备份的位置是在autobackup文件夹下。
控制文件和服务器参数文件总备份在一起。
只要要求备份归档日志(即plus archivelog),归档日志就会有两次备份,分别存储在两个文件下。
*/