0级备份
run{
allocate channel d1 type disk maxpiecesize 50G;
allocate channel d2 type disk maxpiecesize 50G;
allocate channel d3 type disk maxpiecesize 50G;
backup format '/OraBack/level0_%d_%U.bak' incremental level 0 tag full_backup_bat database ;
sql 'alter system archive log current';
backup archivelog all format '/OraBack/archivelogbak/log_%d_%U.bak' delete all input;
release channel d3;
release channel d2;
release channel d1;
}
1级备份
run{
allocate channel d1 type disk maxpiecesize 50G;
allocate channel d2 type disk maxpiecesize 50G;
allocate channel d3 type disk maxpiecesize 50G;
backup format '/OraBack/level1_%d_%U.bak' incremental level 1 tag level1_backup_bat database ;
sql 'alter system archive log current';
backup archivelog all format '/OraBack/archivelogbak/log_%d_%U.bak' delete all input;
release channel d3;
release channel d2;
release channel d1;
}
2级备份
run{
allocate channel d1 type disk maxpiecesize 50G;
allocate channel d2 type disk maxpiecesize 50G;
allocate channel d3 type disk maxpiecesize 50G;
backup format '/OraBack/level2_%d_%U.bak' incremental level 2 tag level2_backup_bat database ;
sql 'alter system archive log current';
backup archivelog all format '/OraBack/archivelogbak/log_%d_%U.bak' delete all input;
release channel d3;
release channel d2;
release channel d1;
}
rman 备份集,镜像备份
backup database plus archivelog delete input;
备份表空间
report schema
backup tablespace proddtat;
备份控制文件
backup current controlfile;
backup database include current current controlfile;
镜像备份
copy datafile 5 to '/u01/proddtat.dbf'
list copy
find /OraBack/ -mtime +7 -exec rm -rf {} \;
/u01/app/oracle/oracle/product/10.2.0/db_1/bin/rman target / msglog=/u01/orabac_script/bak_log/bakl0.log cmdfile=/u01/orabac_script/bakl0
转载于:https://blog.51cto.com/janywang/824489