数据库全备份脚本

数据库全备份脚本

#!/bin/bash
# incremental level 0 backup script
/home/oracle/.profile

rman target / <<EOF
spool log to '/home/oracle/fullbackup.log';
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup full tag ‘dbfull’ format ‘/home/oracle/backup/full%u_%s_%p’ database
include current controlfile;  
//备份整个数据库,标签为dbfull,包括当前控制文件
sql ‘alter system archive log current’; 
//执行归档当前日志文件SQL语句
backup fileaperset 3 format ‘/home/oracle/backup/arch%u_%s_%p’
//设置备份集中可包含的备份片数
archivelog all delete input;  
//备份归档可,可以单独定期备份
release channel c1;
release channel c2;
}
crosscheck backup;
delete expired backup;
delete obsolete;
EOF
-------------------------一网友发的,暂留稍后研究。

你可能感兴趣的:(数据库,全备份脚本)