云南网官方网站,用手机搭建wordpress,免费的asp网站,网站改用绝对地址的好处发现在日常备份中#xff0c;rman无法将过期的归档日志备份删除#xff0c;查相关资料#xff0c; delete noprompt backup completed before sysdate-2; 可通过该语句将所有备份记录删除#xff0c;包括归档日志备份。 整理的脚本如下#xff1a; 10 20 * * * su - or… 发现在日常备份中rman无法将过期的归档日志备份删除查相关资料 delete noprompt backup completed before sysdate-2; 可通过该语句将所有备份记录删除包括归档日志备份。 整理的脚本如下 10 20 * * * su - oracle -c /oracle/script/fullbackup.sh 10 12 * * * su - oracle -c /oracle/script/arcbk.sh 先设置rman备份保留可恢复数据库到前两天的时间 RMAN CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 days; oracleciqdb:~/script cat fullbackup.sh echo start backup/rmanfs/rmandb.log date /rmanfs/rmandb.log $ORACLE_HOME/bin/rman target / log /rmanfs/rmandb.log append EOF run { crosscheck backup; delete noprompt expired backup device type disk; allocate channel DISK_2 type disk format /rmanfs/fulldb_%T_%u; ##backup database include current controlfile ; backup as compressed backupset ( database include current controlfile ); } allocate channel for maintenance device type disk; delete noprompt archivelog until time sysdate - 8; delete noprompt obsolete device type disk; delete noprompt backup completed before sysdate-2; EOF date /rmanfs/rmandb.log echo stop backup-/rmanfs/rmandb.log oracleciqdb:~/script cat arcbk.sh echo start backup/rmanfs/rmanarc.log date /rmanfs/rmanarc.log $ORACLE_HOME/bin/rman target / log /rmanfs/rmanarc.log append EOF run { allocate channel DISK_2 type disk format /rmanfs/arc_%T_%u; ##backup archivelog all not backed up 1 times; backup as compressed backupset ( archivelog all); } allocate channel for maintenance device type disk; delete noprompt obsolete device type disk; EOF date /rmanfs/rmanarc.log echo stop backup-/rmanfs/rmanarc.log oracleciqdb:~/script run { CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE DEFAULT DEVICE TYPE TO DISK; CONFIGURE CONTROLFILE AUTOBACKUP ON; CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET; allocate channel d1 device type disk format E:\Oracle\OraData\p6test\backup\full_%U; allocate channel d2 device type disk format \\SERVER\backup\p6test\full_%U; backup database tagfull_database_backup; sql alter system archive log current; backup archivelog all not backed up 1 times tagarchivelog_backup; # we throw away all backups from 40 hours ago. This way we get synchronized with the VM snapshot created at Storage level (meaning, directly using ZFS filesystem commands or from the OS of dedicated storage boxes) delete noprompt archivelog until time sysdate - 3; delete noprompt backup completed before sysdate-40/24; release channel d1; release channel d2; } RMAN delete backupset tagTAG20181024T085438; Method 3: You can also delete backupset those backed up before a particular time:
delete completed before TO_DATE(Date String,MM/DD/YYYY HH24:MI:SS);
For example: delete backup completed before TO_DATE(09/23/2018 08:00:00,MM/DD/YYYY HH24:MI:SS); And also, if backupset file is deleted by OS command, then you can delete related information via RMAN by using force. eg: RMAN delete force backupset 1; RMAN delete force backupset tagTAG20181024T085438; RMAN delete force noprompt backup completed before TO_DATE(09/23/2018 08:00:00,MM/DD/YYYY HH24:MI:SS);