rman命令,备份表空间。
1、单条命令
RMAN> connect target /;
connected to target database: ORCL (DBID=1273838262)
using target database control file instead of recovery catalog
RMAN> backup format '/home/oracle/rmanBak/%d_%s.bak' tablespace users;
Starting backup at 07-AUG-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=139 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/home/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 07-AUG-13
channel ORA_DISK_1: finished piece 1 at 07-AUG-13
piece handle=/home/oracle/rmanBak/ORCL_1.bak tag=TAG20130807T101316 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:36
Finished backup at 07-AUG-13
RMAN> list backupset;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 30.34M DISK 00:00:27 07-AUG-13
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20130807T101316
Piece Name: /home/oracle/rmanBak/ORCL_1.bak
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 Full 7607655 07-AUG-13 /home/oracle/oradata/orcl/users01.dbf
==================================================================================================
2、作业命令
RMAN> run {
2> allocate channel d1 type disk;
3> backup format '/home/oracle/rmanBak/%d_%s.bak' tablespace users;
4> release channel d1;
5> }
released channel: ORA_DISK_1
allocated channel: d1
channel d1: sid=139 devtype=DISK
Starting backup at 07-AUG-13
channel d1: starting full datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00004 name=/home/oracle/oradata/orcl/users01.dbf
channel d1: starting piece 1 at 07-AUG-13
channel d1: finished piece 1 at 07-AUG-13
piece handle=/home/oracle/rmanBak/ORCL_2.bak tag=TAG20130807T101841 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:15
Finished backup at 07-AUG-13
released channel: d1
RMAN> list backupset;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Full 30.34M DISK 00:00:27 07-AUG-13
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20130807T101316
Piece Name: /home/oracle/rmanBak/ORCL_1.bak
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 Full 7607655 07-AUG-13 /home/oracle/oradata/orcl/users01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Full 30.34M DISK 00:00:08 07-AUG-13
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20130807T101841
Piece Name: /home/oracle/rmanBak/ORCL_2.bak
List of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
4 Full 7607882 07-AUG-13 /home/oracle/oradata/orcl/users01.dbf