RMAN是一个很方便很好用的备份,恢复,还原的一个工具,做这个小测试其实只有一个RMAN语句就完全解决了这么大的需求:

RMAN> backup as backupset full database format '/u01/app/backup/db_%U.rmn' include current controlfile plus archivelog delete all input;


Starting backup at 10-OCT-16

current log archived

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=143 device type=DISK

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=11 RECID=6 STAMP=924895260

channel ORA_DISK_1: starting piece 1 at 10-OCT-16

channel ORA_DISK_1: finished piece 1 at 10-OCT-16

piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/0bri1i0t_1_1 tag=TAG20161010T192101 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

channel ORA_DISK_1: deleting archived log(s)

archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_11_924890639.dbf RECID=6 STAMP=924895260

Finished backup at 10-OCT-16

 

Starting backup at 10-OCT-16

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00001 name=/u01/app/oracle/oradata/ORA11GR2/system01.dbf

input datafile file number=00002 name=/u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/ORA11GR2/example01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/ORA11GR2/undotbs01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/ORA11GR2/users01.dbf

channel ORA_DISK_1: starting piece 1 at 10-OCT-16

channel ORA_DISK_1: finished piece 1 at 10-OCT-16

piece handle=/u01/app/backup/db_0cri1i0v_1_1.rmn tag=TAG20161010T192103 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:05:42

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 10-OCT-16

channel ORA_DISK_1: finished piece 1 at 10-OCT-16

piece handle=/u01/app/backup/db_0dri1ibl_1_1.rmn tag=TAG20161010T192103 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 10-OCT-16

 

Starting backup at 10-OCT-16

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=12 RECID=7 STAMP=924895610

channel ORA_DISK_1: starting piece 1 at 10-OCT-16

channel ORA_DISK_1: finished piece 1 at 10-OCT-16

piece handle=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/0eri1ibq_1_1 tag=TAG20161010T192650 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

channel ORA_DISK_1: deleting archived log(s)

archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_12_924890639.dbf RECID=7 STAMP=924895610

Finished backup at 10-OCT-16

总结:

RMAN> backup as backupset full database format '/u01/app/backup/db_%U.rmn' include current controlfile plus archivelog delete all input;

posted on 2016-10-10 22:47  Tomatoes  阅读(352)  评论(0编辑  收藏  举报