• How to delete expired archive log files using rman?


    he following commands will helpful to delete the expired archive log files using Oracle Recovery Manager(RMAN).Connect to the Rman prompt and try the bellow commands.

        RMAN>list expired archivelog all;

    RMAN>crosscheck archivelog all;
    RMAN>delete noprompt expired archivelog all;
    RMAN>list expired archivelog all;

    Sample Ouptut:

    RMAN> list expired archivelog all;
    specification does not match any archived log in the repository
    RMAN>

    In my develop environment , sometime the archive destination folder is full, caused the database hang. So I will use below command to disable it.

    Disable Archive log mode

    startup mount

    alter database noarchivelog;

    alter database open;

    方法一:
    rman target/
    或rman target/@orcl
    在命令窗口里面执行
    delete noprompt archivelog until time 'sysdate-7'; //删除七天前的归档,果使用了闪回功能,也会删除闪回的数据。 
    DELETE ARCHIVELOG FROM TIME 'SYSDATE-7'; //删除七天到现在的归档 

    方法二:(rman登不进去)

    执行find /archive/ -name "*.dbf"|wc –l查看有多少归档日志
    删除7天之前的所有归档文件
    find /archive/ -name "*.dbf" -mtime +7  -exec rm -f {} ;

    将归档日志信息进行更新

    asm 就得用asmcmd交互界面rm了
    RMAN> crosscheck archivelog all;
    RMAN> delete noprompt expired archivelog all; 
    RMAN> exit
     

  • 相关阅读:
    Dapper使用
    EF5.X Code First表关联与延迟加载
    EF Code First 学习笔记:关系
    Entity Framework
    MVC3+EF4.1学习系列(五)----- EF查找导航属性的几种方式
    QML与C++混合编程
    如何将信号从javascript发射到qml
    qt quick中qml编程语言
    PyQt 5信号与槽的几种高级玩法
    静态编译OpenSSL并整合到Qt
  • 原文地址:https://www.cnblogs.com/princessd8251/p/3808090.html
Copyright © 2020-2023  润新知