• [bbk4795] 第37集 第四章 Flashback Database 01


    数据归档区管理员(FLASHBACK ARCHIVE ADMINISTER)

    在日常管理中,可以安排一个专门人员负责数据归档区的管理.DBA分配FLASHBACK ARCHIVE ADMINISTER权限给此用户.

    空间

      TABLESPACE

    权限

      |-SELECT ANY TRANSACTION

      |-FALASHBACK ARCHI

      |-DBMS_FLASHBACK(PACKAGE EXECUTE PRIVES)

    How Total Recall Works

    History data:

    • Row captured asynchronously by background processes at selft-tuned intervals(default:5 min)
    • Stored compressed and partitioned
    • Automatically purged per retention policy
    • Partitions automatically created based on time and volume
    • Unrelated partitions skipped by queries

    Step Process

    1、Create a new database to hold the FDA

    2、With the FLASHBACK ARCHIVE ADMINISTER system privilege:Create a Flashback Data Archive,assign it to the tablespace,and specify its retention period.

    CREATE FLASHBACK ARCHIVE fda1 TABLESPACE fda_tbs1 QUOTA 10M RETENTION 1 YEAR;

    3、With the FLASHBACK ARCHIVE object privilege:Alter the base tables to enable archiving and assign it to a flashback archive.

    ALTER TABLE HR.EMPLOYEES FLASHBACK ARCHIVE fda1;

    Oracle Total Recall Scenario

    Using Flashback Data Archive to access historical data:

    --create the Flashback Data Archive
    
    CREATE FLASHBACK ARCHIVE DEFAULT fla1 TABLESPACE tbs1 QUOTA 10G RETENTION 5 YEAR;
    --Specify the default Flashback Data Archive
    
    ALTER FLASHBACK ARCHIVE fla1 SET DEFAULT;
    --Enable Flashback Data Archive
    
    ALTER TABLE inventory FLASHBACK ARCHIVE;
    
    ALTER TABLE stock_data FLASHBACK ARCHIVE;
    SELECT product_number,product_name,count FROM inventory AS OF TIMESTAMP TO_TIMESTAMP('20017-01-01 00:00:00','YYYY:MM-DD HH24:MI:SS');
  • 相关阅读:
    C++ string 类详解
    C语言 -- 字符串详解
    基本数据结构 -- 链表的遍历、查找、插入和删除
    Shell 基础 -- 总结几种括号、引号的用法
    用 C 语言描述几种排序算法
    Win10 + vs2017 编译并配置tesseract4.1.0
    前端如何引入vConsole
    php设计模式-数据对象映射模式
    PHP设计模式-策略模式
    PHP设计模式-适配器模式
  • 原文地址:https://www.cnblogs.com/arcer/p/3085302.html
Copyright © 2020-2023  润新知