ITPub博客

首页 > 数据库 > Oracle > rman全备

rman全备

原创 Oracle 作者:huzhichengforce 时间:2014-05-31 18:18:47 0 删除 编辑
RMAN> run{
2> allocate channel d1 type disk;
3> backup as compressed backupset
4> incremental level 0
5> format '/u01/backup/inc0_%t_%T'
6> tag='inc0'
7> database include current controlfile;
8> sql 'alter system archive log current';
9> backup archivelog all format '/u01/backup/archlog_%d_%s_%u.bak' delete all input;
10> release channel d1;
11> }
rman全备脚本:
#!/bin/bash
rman target sys/sysdba nocatalog <
run {
allocate channel t1 type disk;
allocate channel t2 type disk;
allocate channel t3 type disk;
set limit channel t1 kbytes 4194304;
set limit channel t2 kbytes 4194304;
set limit channel t3 kbytes 4194304;
backup
format '/u01/rman/full_wapdb_%U'
(database include current controlfile);
backup
format '/u01/rman/redolog_wapdb_%U' archivelog all delete input;
sql ' alter system archive log current';
release channel t1;
release channel t2;
release channel t3;
}
exit
EOF
---------------------------------------------------------------
[oracle@db1 ~]$ vi rman_backup.sh
#!/bin/bash
rman target sys/zjxc123 nocatalog <
run{
allocate channel d1 type disk;
backup as compressed backupset
incremental level 0
format '/u01/backup/inc0_%t_%T' tag='inc0'
database include current controlfile;
sql 'alter system archive log current';
backup archivelog all format '/u01/backup/archlog_%d_%s_%u.bak' delete all input;
release channel d1;
}
-------------------------------------------------------
单行命令:backup as compressed backupset database include current controlfile format'/u01/back/full_%t_%U.bak';
要在 rman show all 中 先配置
configure channel device type disk format '/u01/backup/inc0_%d_db_%u';
backup as compressed backupset database include current controlfile plus archivelog delete all input;
==========================================================
RMAN> report schema;
用 backup validate 不会产生实际的备份集
RMAN> backup validate datafile 2;
======================== 没有压缩的备份 ================================
RUN {
allocate channel c1 type disk;
allocate channel c2 type disk;
BACKUP FORMAT '/u01/data/orcl_%U_%T' skip inaccessible filesperset 5 DATABASE TAG orcl_hot_db_bk;
sql 'alter system archive log current';
BACKUP FORMAT '/u01/data/arch_%U_%T' skip inaccessible filesperset 5 ARCHIVELOG ALL DELETE INPUT;
backup current controlfile tag='bak_ctlfile' format='/u01/data/ctl_file_%U_%T';
backup spfile tag='spfile' format='/u01/data/ORCL_spfile_%U_%T';
release channel c2;
release channel c1;
}
===========================================

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

上一篇: SYS.AUD$
下一篇: 监控rman备份信息
请登录后发表评论 登录
全部评论

注册时间:2012-08-19

  • 博文量
    202
  • 访问量
    518270