rman备份脚本和rman增量备份脚本分享

前端之家收集整理的这篇文章主要介绍了rman备份脚本和rman增量备份脚本分享前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

@H_404_0@

一、单独备份

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、全库备份脚本:
<div class="codetitle"><a style="CURSOR: pointer" data="22240" class="copybut" id="copybut22240" onclick="doCopy('code22240')"> 代码如下:
<div class="codebody" id="code22240">
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;
}


@H_404_0@

二、增量备份

1、0级增量备份
<div class="codetitle"><a style="CURSOR: pointer" data="13954" class="copybut" id="copybut13954" onclick="doCopy('code13954')"> 代码如下:
<div class="codebody" id="code13954">
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;
}


@H_404_0@2、1级备份脚本
<div class="codetitle"><a style="CURSOR: pointer" data="91928" class="copybut" id="copybut91928" onclick="doCopy('code91928')"> 代码如下:
<div class="codebody" id="code91928">
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备份脚本

猜你在找的Oracle相关文章