rman命令

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值