zoukankan      html  css  js  c++  java
  • [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');
  • 相关阅读:
    数据分析三剑客之pandas
    python神器 Jupyter Notbook
    数据分析三剑客之numpy
    MySQL之数据备份与还原
    爬虫之增量式爬虫
    文件相关命令(find,tree,tar)文件属性信息 date
    系统通配符号、系统正则符号,grep
    sed命令
    系统用户权限,系统权限位,用户相关命令
    根下目录及目录内详细文件
  • 原文地址:https://www.cnblogs.com/arcer/p/3085302.html
Copyright © 2011-2022 走看看