zoukankan      html  css  js  c++  java
  • rman备份跳过read only数据文件,减少备份总量,加快备份时间

    客户需求,RMAN备份时间过长,想缩短备份时间,优化备份。

    客户基于表空间进行历史数据归档的方式,将历史的表空间进行read only,想让RMAN跳过只读表空间,减少RMAN备份的数据总量,从而缩短备份时间。

    一、对表空间调整为只读模式
    SQL> alter tablespace test read only; SQL> select segment_name,owner from dba_segments where tablespace_name='TEST'; SEGMENT_NAME OWNER ------------------------------ EMP1 SCOTT SQL> select * from scott.emp1; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ---------- ---------- --------- ---------- -------------- ---------- ---------- ---------- 7369 SMITH CLERK 7902 17-12月-80 800 20 SQL> delete scott.emp1; delete scott.emp1 *1 行出现错误: ORA-00372: 此时无法修改文件 7 ORA-01110: 数据文件 7: 'C:WIN_ORACLE_11_DATABASEAPPORADATAWIN11TEST01.DBF' 开启备份优化,对read only 无效,并不会跳过read only的备份 RMAN> run { CONFIGURE BACKUP OPTIMIZATION ON; backup as compressed backupset database format 'C:win_oracle_11_database manbackupdbFULLBAK_%U_%d_%s.bak'; } 通过参数设置 RMAN>run { CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE RETENTION POLICY TO NONE; backup as compressed backupset database format 'C:win_oracle_11_database manbackupdbFULLBAK_%U_%d_%s.bak'; } 当第二次备份时,将跳过已备份的文件,但是由于RMAN保留参数配置为默认值,无法删除历史的备份文件,浪费空间存储,不符合实际情况。 使用如下参数,将无法进行跳过read only备份 RMAN>run { CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE RETENTION POLICY TO REDUNDANCY 2; backup as compressed backupset database format 'C:win_oracle_11_database manbackupdbFULLBAK_%U_%d_%s.bak'; } 使用SKIP READO参数进行备份 RMAN> delete backup; RMAN>run { CONFIGURE BACKUP OPTIMIZATION ON; CONFIGURE RETENTION POLICY TO REDUNDANCY 2; backup as compressed backupset database SKIP READONLY format 'C:win_oracle_11_database manbackupdbFULLBAK_%U_%d_%s.bak'; } 加上参数SKIP READONLY 即可
    RMAN>run { CONFIGURE RETENTION POLICY TO REDUNDANCY 2; backup as compressed backupset
    database SKIP READONLY format 'C:win_oracle_11_database manbackupdbFULLBAK_%U_%d_%s.bak'; }
  • 相关阅读:
    git-将dev代码合并到test
    java中一句话取到用split()截后的最后一个值
    shiro重定向或会话失效后NginxURL地址无效,以及浏览器控制台Mixed Content: The page at ‘https://XXX’ was loaded over HTTPS, but requested an insecure错误
    Linux 查找Nginx配置文件位置命令
    Linux 常用命令(个人暂时用到的)
    代理模式
    【Vue自学笔记(四)】天气案例
    【Vue自学笔记(三)】网络请求的简单使用
    【Vue自学笔记】案例
    【Vue自学笔记(二)】Vue指令
  • 原文地址:https://www.cnblogs.com/lvcha001/p/11669622.html
Copyright © 2011-2022 走看看