铁雪资源网 Design By www.gsvan.com

一、单独备份
1、经典整库备份:backup as compressed backupset database include current controlfile plus archivelog delete all input;
2、tablespace:backup tablespace 名字;
3、数据文件:backup datafile n; (n:具体的数据文件编号select file_name,file_id,tablespace_name from dba_data_files;)
4、控制文件:backup current controlfile;或者backup database include current controlfile;
5、日志文件:backup archivelog all;或者 database plus archivelog;
6、参数文件:backup spfile;
7、全库备份脚本:
复制代码 代码如下:
run{  
allocate channel c1 type disk;  
backup full tag ‘dbfull' format ‘/backup/full%u_%s_%p' database  
include current controlfile;  
sql ‘alter system archive log current'; #在数据库进行全备份完成之后,需要执行该条命令将当前日志归档,备份归档日志时应该包括最后生成的归档
backup filesperset 3 format ‘/backup/arch%u_%s_%p'#filesperset 3设定每个备份集里文件不超过3个 
archivelog all delete input; #备份归档可选,可以单独定期备份  
release channel c1;   
}

二、增量备份

1、0级增量备份
复制代码 代码如下:
run{  
allocate channel c1 type disk;  
backup incremental level 0 tag ‘db0' format ‘/backup/db0%u_%s_%p'database
include current controlfile;  ;  
sql 'alter system archive log current';#在数据库进行全备份完成之后,需要执行该条命令将当前日志归档,备份归档日志时应该包括最后生成的归档
backup filesperset 3 format ‘/backup/arch%u_%s_%p'#filesperset 3设定每个备份集里文件不超过3个
archivelog all delete input; #备份归档可选,可以单独定期备份  
release channel c1;   

2、1级备份脚本
复制代码 代码如下:
run{  
allocate channel c1 type disk;    
backup incremental level 1 tag ‘db1' format ‘/backup/db1%u_%s_%p'  
database skip readonly include current controlfile;     
backup filesperset 3 format ‘/backup/arch%u_%s_%p'#filesperset设定每个备份集里文件不超过3个
archivelog all delete input; #备份归档可选,可以单独定期备份  
release channel c1;    
}

标签:
rman备份脚本,rman增量备份

铁雪资源网 Design By www.gsvan.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
铁雪资源网 Design By www.gsvan.com

评论“rman备份脚本和rman增量备份脚本分享”

暂无rman备份脚本和rman增量备份脚本分享的评论...