zoukankan      html  css  js  c++  java
  • Oracle归档的开启和关闭

      --1、开启归档

      【步骤】

      a.一致性关闭数据库(shutdown [immediate | transactional |normal])

      b.启动到mount阶段(startup mount)

      c.切换到归档模式(alter database archivelog[manual])

      d.切换到open阶段(alter database open)

      e.对数据做一个完整备份(full backup)

      show parameter spfile

      alter system set log_archive_dest_1='location=/ggs/arch_data' scope=spfile;

      alter system set db_recovery_file_dest_size=100g scope=spfile sid='*';

      alter system set db_recovery_file_dest='/ggs/ora_recovery' scope=spfile;

      alter system set log_archive_format='arch_%t_%s_%r.arc' scope=spfile;

      shutdown immediate;

      startup mount;

      alter database archivelog;

      alter database open ;

      archive log list;

      --2、关闭归档

      【步骤】归档模式切换到非归档模式

      a. [immediate | transactional |normal])一致性关闭数据库(shutdown

      b.启动到mount阶段(startup mount)

      c.切换到归档模式(alter database noarchivelog)

      d.切换到open阶段(alter database open)

      关闭归档模式:

      shutdown immediate;

      startup mount;

      alter database noarchivelog;

      alter database open;

      查看归档文件:

      select * from v$log;

      select * from v$logfile;

      select * from v$flash_recovery_area_usage;

      report obsolete;

      delete obsolete;

      备份归档文件:

      backup archivelog all;

      也可以:

      先执行alter system switch logfile;

      再找到归档日志位置,复制到别的地方即可。

      rman target /

      delete archivelog all completed before 'sysdate-7';

      backup first

      backup format '/tmp/arch-%t_%s_%u' archivelog all delete input;

      或者backup database plus archivelog;

      删除归档文件:

      rman target / 或者 rman target user/password@tns

      list archivelog all;

      crosscheck archivelog all;

      list expired archivelog all;

      delete expired archivelog all;(编辑:雷林鹏 来源:网络)

  • 相关阅读:
    wget下载https文件,服务器可以虚拟机中不行的问题
    FTP被动模式服务器端开有限的端口
    ZOJ
    HDU
    JAVA 大数 A+B问题
    A Simple Math Problem(矩阵快速幂)----------------------蓝桥备战系列
    Covering(矩阵快速幂)
    卡特兰数详讲(转)
    Just a Hook(线段树区间修改值)-------------蓝桥备战系列
    A Simple Problem with Integers(线段树区间更新复习,lazy数组的应用)-------------------蓝桥备战系列
  • 原文地址:https://www.cnblogs.com/pengpeng1208/p/9546955.html
Copyright © 2011-2022 走看看