oracle删除归档

作者: 重庆思庄 | 来源:发表于2019-11-28 15:12 被阅读0次

    oracle删除归档,可以使用rman删除归档,也可以使用rm直接删除!

    1.使用rm删除归档:

    删除所有归档:find /u01/app/oracle/archive -mtime -1 -name "*.dbf" -exec rm -f {} \;或find /u01/app/oracle/archive -mtime -1 -name "*.dbf"| xargs rm -rf

    删除七天前的归档:find /u01/app/oracle/archive -mtime +7 -name "*.dbf" -exec rm -f {} \;或find /u01/app/oracle/archive -mtime +7 -name "*.dbf"| xargs rm -rf

    最后需要用rman删除记录:

    rman target /crosscheck archivelog all;delete noprompt expired archivelog all;

    2.根据sequence#使用rman删除归档:

    单节点:

    delete noprompt archivelog until sequence ${Seq};

    rac(thread后面加节点数):

    delete noprompt archivelog until sequence ${Seq} thread ${CurThread};

    删除7天前的归档:

    DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';

    删除全部归档(noprompt不交互):

    DELETE noprompt ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-0';

    删除从7天前到现在的全部日志:

    DELETE ARCHIVELOG FROM TIME 'SYSDATE-7';

    3.根据时间使用rman删除归档:

    删除7天前的归档:

    DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';

    删除全部归档(noprompt不交互):

    DELETE noprompt ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-0';

    删除从7天前到现在的全部日志:

    DELETE ARCHIVELOG FROM TIME 'SYSDATE-7';

    相关文章

      网友评论

        本文标题:oracle删除归档

        本文链接:https://www.haomeiwen.com/subject/ipsbwctx.html