REM 包含归档日志的全备份:
run {
allocate channel ch1 type disk;
backup full database format 'D:rmanbackup_%p_%s_%u.%d';
sql 'alter system archive log current';
backup archivelog all delete input format 'D:rmanal_backup_%p_%s_%u.%d';
}
REM 备份归档日志文件
run {
allocate channel c1 type disk format 'd:rmanal_backup_%p_%s_%u.%d';
backup archivelog all;
}
run {
allocate channel c1 type disk format 'd:rmanal_backup_%s_%u.%d';
backup archivelog all delete all input;
}
REM 直接发出命令
backup archivelog all format "d:rmanAL_%d_%U.%d" delete all input;
REM 备份控制文件
run{
allocate channel dev1 type disk format 'd:rman%U';
backup current controlfile;
}
REM 查看备份的控制文件
list backup of controlfile;
REM 恢复控制文件
run {
allocate channel ch1 type disk;
restore controlfile;
}
REM 恢复整个数据库
run {
allocate channel dev1 type disk;
restore database;
recover database;
}
REM 恢复归档日志文件
run {
allocate channel d1 type disk;
set archivelog destination to 'E:Oracleoradataora9iarchivebak';
restore archivelog from logseq 24 until logseq 43 thread 1;
release channel d1;
}
Rem 创建脚本
create script Level0Backup {
backup incremental level 0
format 'd:rman%d_%s_%p'
filesperset 5
(database include current controlfile);
sql 'alter system archive log current';
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29987/viewspace-51647/
,如需转载,请注明出处,否则将追究法律责任。