RMAN 备份恢复
1:RMAN 基本命令
run{
allocate channel ch1 device type disk maxpiecesize 2G;
allocate channel ch2 device type disk maxpiecesize 2G;
allocate channel ch3 device type disk maxpiecesize 2G;
backup as compressed backupset incremental level 0 database format='E:\backup\inc0_%U' tag='Inc0' skip inaccessible include current controlfile ; --差异增量备份
--backup as compressed backupset incremental level 0 cumulative database format='E:\backup\inc0_%U' tag='Inc0' skip inaccessible include current controlfile ;--累积增量备份
backup archivelog all format 'E:\backup\arch_%D_%U' tag 'arch_full_070628' delete input;
}
Format &tag
The most common substitution variable is %U, which generates a unique name. Others include %d for the DB_NAME, %t for the backup set time stamp, %s for the backup set number, and %p for the backup piecenumber.
show all--显示oracleRMAN配置信息
RMAN> list backup summary;备份列表===============关键字 TY LV S 设备类型 完成时间 段数 副本数 压缩标记------- -- -- - ----------- ---------- ------- ------- ---------- ---7 B 0 A DISK 08-3月 -13 1 1 YES INC09 B A A DISK 08-3月 -13 1 1 NO ARCH_FULL_07062810 B A A DISK 08-3月 -13 1 1 NO ARCH_FULL_07062811 B A A DISK 08-3月 -13 1 1 NO ARCH_FULL_07062812 B A A DISK 08-3月 -13 1 1 NO ARCH_FULL_07062813 B 0 A DISK 08-3月 -13 1 1 YES INC014 B 0 A DISK 08-3月 -13 1 1 YES INC0
VALIDATE &DBV
Reporting on Database Files and Backups差异增量:|<----------| |<-----| |<-----------------------| |<-----| |<----| |<-----| |<--------------------------------------------------| 0级备份 2 2 1 2 2 2 0 ----------------------------------------------------->时间轴 星期7 1 2 3 4 5 6 7 还原的时候,差异增量备份必须将每一级的差异增量备份进行还原,如: 周7和周1之间crash:0级备份+arch 周1和周2之间crash:0级备份+2级备份+arch 周2和周3之间crash:0级备份+2级备份+2级备份+arch 周3和周4之间crash:0级备份+1级备份+arch 周4和周5之间crash:0级备份+1级备份+2级备份+arch 周5和周6之间crash:0级备份+1级备份+2级备份+2级别备份+arch 周6和周7之间crash:0级备份+1级备份+2级备份+2级别备份+2级备份+arch 累积增量:|<----------| |<-----------------| |<-----------------------| |<-----| |<-----------| |<------------------| |<--------------------------------------------------| 0级备份 2 2a 1 2b 2c 2d 0 ----------------------------------------------------->时间轴 星期7 1 2 3 4 5 6 7 还原的时候,累积增量备份不必将每一级的备份进行还原,如: 周7和周1之间crash:0级备份+arch 周1和周2之间crash:0级备份+2级备份+arch 周2和周3之间crash:0级备份+2级备份a+arch 周3和周4之间crash:0级备份+1级备份+arch 周4和周5之间crash:0级备份+1级备份+2级备份b+arch 周5和周6之间crash:0级备份+1级备份+2级备份c+arch 周6和周7之间crash:0级备份+1级备份+2级备份d+arch3: RMAN 恢复
对数据库备份: