1、使用命令文件
先创建一个命令文件
~/app/oracle/flash_recovery_area> cat testfile01
BACKUP DATABASE PLUS ARCHIVELOG;
然后使用rman进行调用:
~/app/oracle/flash_recovery_area> rman target / @testfile01
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Apr 5 17:29:14 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: TEST (DBID=2109669017)
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
2>
Starting backup at 05-APR-13
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1522 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=41 RECID=1 STAMP=811963756
channel ORA_DISK_1: starting piece 1 at 05-APR-13
channel ORA_DISK_1: finished piece 1 at 05-APR-13
piece handle=/home/oracle/app/oracle/flash_recovery_area/TEST/backupset/2013_04_05/o1_mf_annnn_TAG20130405T172916_8ox6cdvv_.bkp tag=TAG20130405T172916 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-APR-13
Starting backup at 05-APR-13
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=/home/oracle/app/oracle/oradata/test/system01.dbf
input datafile file number=00002 name=/home/oracle/app/oracle/oradata/test/sysaux01.dbf
input datafile file number=00005 name=/home/oracle/app/oracle/oradata/test/example01.dbf
input datafile file number=00003 name=/home/oracle/app/oracle/oradata/test/undotbs01.dbf
input datafile file number=00004 name=/home/oracle/app/oracle/oradata/test/users01.dbf
channel ORA_DISK_1: starting piece 1 at 05-APR-13
channel ORA_DISK_1: finished piece 1 at 05-APR-13
piece handle=/home/oracle/app/oracle/flash_recovery_area/TEST/backupset/2013_04_05/o1_mf_nnndf_TAG20130405T172918_8ox6cgtl_.bkp tag=TAG20130405T172918 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
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 05-APR-13
channel ORA_DISK_1: finished piece 1 at 05-APR-13
piece handle=/home/oracle/app/oracle/flash_recovery_area/TEST/backupset/2013_04_05/o1_mf_ncsnf_TAG20130405T172918_8ox6cygd_.bkp tag=TAG20130405T172918 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-APR-13
Starting backup at 05-APR-13
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=42 RECID=2 STAMP=811963775
channel ORA_DISK_1: starting piece 1 at 05-APR-13
channel ORA_DISK_1: finished piece 1 at 05-APR-13
piece handle=/home/oracle/app/oracle/flash_recovery_area/TEST/backupset/2013_04_05/o1_mf_annnn_TAG20130405T172935_8ox6d03h_.bkp tag=TAG20130405T172935 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 05-APR-13
Recovery Manager complete.
查看备份文件:
~/app/oracle/flash_recovery_area/TEST/archivelog/2013_04_05> ls -lrt
total 16680
-rw-r----- 1 oracle oinstall 17025536 Apr 5 17:29 o1_mf_1_41_8ox6ccpy_.arc
-rw-r----- 1 oracle oinstall 28160 Apr 5 17:29 o1_mf_1_42_8ox6czsb_.arc