rman备份基础

RMAN> show all;


配置controlfile为自动备份
RMAN> configure controlfile autobackup on;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored


还原默认模式
RMAN> configure controlfile autobackup clear;

RMAN configuration parameters are successfully reset to default value


备份数据文件
RMAN> backup datafile '/oracle/oradata/orclgg/users01.dbf' format '/oracle/backup/df_%U';


备份表空间
RMAN> backup tablespace users format  '/oracle/backup/ts_%U';


修改备份路径
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oracle/backup/ctl_%F';

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE

DISK TO '/oracle/backup/ctl_%F';
new RMAN configuration parameters are successfully stored


单独备份控制文件
RMAN> backup current controlfile;

备份数据文件和当前控制文件
SQL> select file#,name from v$datafile;

     FILE# NAME
---------- ----------------------------------------
         1 /oracle/oradata/orclgg/system01.dbf
         2 /oracle/oradata/orclgg/undotbs01.dbf
         3 /oracle/oradata/orclgg/sysaux01.dbf
         4 /oracle/oradata/orclgg/users01.dbf

RMAN> backup datafile 4 include current controlfile;


备份spfile
RMAN> backup spfile;


备份归档日志文件
RMAN> backup archivelog all format '/oracle/backup/ac_%U';

 

归档和数据一起备份
backup database plus archivelog format '/oracle/backup/db_%U';

并发备份

SQL> select file#,name from v$datafile;

     FILE# NAME
---------- ----------------------------------------
         1 /oracle/oradata/orclgg/system01.dbf
         2 /oracle/oradata/orclgg/undotbs01.dbf
         3 /oracle/oradata/orclgg/sysaux01.dbf
         4 /oracle/oradata/orclgg/users01.dbf

RMAN> run {
2>      allocate channel c1 type disk;
3>      allocate channel c2 type disk;
4>      allocate channel c3 type disk;
5>      backup incremental level=0
6>      format '/oracle/backup/p_%U'
7>      (datafile 1 channel c1 tag='sys')
8>      (datafile 2 channel c2 tag='aux')
9>      (datafile 3,4 channel c3 tag='other');
10>     sql 'alter system archive log current';
11> }

released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=141 devtype=DISK

allocated channel: c2
channel c2: sid=146 devtype=DISK

allocated channel: c3
channel c3: sid=159 devtype=DISK

Starting backup at 01-SEP-11
channel c1: starting incremental level 0 datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=/oracle/oradata/orclgg/system01.dbf
channel c1: starting piece 1 at 01-SEP-11
channel c2: starting incremental level 0 datafile backupset
channel c2: specifying datafile(s) in backupset
input datafile fno=00002 name=/oracle/oradata/orclgg/undotbs01.dbf
channel c2: starting piece 1 at 01-SEP-11
channel c3: starting incremental level 0 datafile backupset
channel c3: specifying datafile(s) in backupset
input datafile fno=00003 name=/oracle/oradata/orclgg/sysaux01.dbf
input datafile fno=00004 name=/oracle/oradata/orclgg/users01.dbf
channel c3: starting piece 1 at 01-SEP-11
channel c3: finished piece 1 at 01-SEP-11
piece handle=/oracle/backup/p_0imlg275_1_1 tag=OTHER comment=NONE
channel c3: backup set complete, elapsed time: 00:00:25
channel c1: finished piece 1 at 01-SEP-11
piece handle=/oracle/backup/p_0gmlg273_1_1 tag=SYS comment=NONE
channel c1: backup set complete, elapsed time: 00:00:34
channel c2: finished piece 1 at 01-SEP-11
piece handle=/oracle/backup/p_0hmlg273_1_1 tag=AUX comment=NONE
channel c2: backup set complete, elapsed time: 00:00:34
Finished backup at 01-SEP-11

Starting Control File and SPFILE Autobackup at 01-SEP-11
piece handle=/oracle/backup/ctl_c-2257414742-20110901-05 comment=NONE
Finished Control File and SPFILE Autobackup at 01-SEP-11

sql statement: alter system archive log current
released channel: c1
released channel: c2
released channel: c3

将并发改为三个
RMAN> configure device type disk parallelism 3 backup type to backupset;

增量备份
RMAN> run {
2>      allocate channel d1 type disk;
3>      backup incremental level 0 database format '/oracle/backup/l0_%U';
4> }

 

查看时间超过6秒的操作
SQL> desc v$session_longops;
SQL> select sid,sofar,totalwork from  v$session_longops;




 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25604225/viewspace-715129/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25604225/viewspace-715129/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值