zoukankan      html  css  js  c++  java
  • [bbk5120] 第44集 第四章 Flashback Database 08

    Restoring Tables from the Recycle Bin

    • Restore dropped tables and dependent objects.
    • If multiple recyclye bin entries have the same original name:
      • Use qunique,system-generated names to restore a particular version.
      • When using original names,the restored table is last in,first out(LIFO)
    • Rename the original name if that name is currently used.
    FLASHBACK TABLE <table_name> TO REFORE DROP [RENAME TO <new_name>];

    Recycle Bin:Automatic Space Reclamation

    Recycle Bin:Manual Space Reclamation

    PURAGE {TABLE <table_name> | INDEX <index_name>}

    PURAGE TABLESPACE <ts_name> [USER <user_name>]

    PRUAGE [USER_|DBA_] RECYCLEBIN

    Bypassing the Recycle Bin

    DROP TABLE <table_name> [PURGE];
    DROP TABLESPACE <ts_name> [INCLUDING CONTENTS];
    DROP USER <user_name> [CASCADE];

    Security considerations for the recycle bin:

    ALTER SYSTEM SET RECYCLEBIN=OFF SCOPE=SPFILE;

    Querying the Recycle Bin

    SQL> l
      1  SELECT owner,original_name,object_name,type,ts_name,droptime,related,space
      2  FROM dba_recyclebin
      3* WHERE can_undrop = 'YES'
    SQL> /
    
    OWNER      ORIGINAL_NAME             OBJECT_NAME                    TYPE                      TS_NAME                        DROPTIME               RELATED      SPACE
    ---------- ------------------------- ------------------------------ ------------------------- ------------------------------ ------------------- ---------- ----------
    SCOTT      EMP1                      BIN$3Oa1+S5bGnvgQAAAAAA3aQ==$0 TABLE                     USERS                          2013-05-17:16:24:25      80370          8
    ARCER      T                         BIN$pfwr1Jtji5zgQPrc4kAI7Q==$0 TABLE                     USERS                          2011-06-18:19:55:16      74574          8
    ARCER      SYS_FBA_HIST_80587        BIN$3RJoV7r6XA7gQAAAAABh/A==$0 TABLE                                                    2013-05-19:20:32:21      80589
    U3         COMPOSITE1                BIN$3EgRsliwFWPgQAAAAABnMA==$0 TABLE                                                    2013-05-09:19:08:24      79684
    SQL> SELECT original_name,object_name,ts_name,droptime
      2  FROM user_recyclebin WHERE can_undrop = 'YES';
    
    no rows selected
    SQL> SHOW RECYCLEBIN

    Quiz

    When you flash back a dropped table,the recovered indexes,triggers,and constraints keep their recycle bin names.

    1、True

    2、False

  • 相关阅读:
    mysq 日期相减
    说说时间观与时间管理——北漂18年(71)
    ionic之切换开关
    ionic之单选框
    SELECT ... LOCK IN SHARE MODE和SELECT ... FOR UPDATE locks在RR模式下可以看到最新的记录
    14.5.2.3 Consistent Nonlocking Reads 一致性非锁定读
    14.5.2.2 autocommit, Commit, and Rollback
    14.5.2 事务隔离级别
    对于唯一索引使用唯一条件搜索, InnoDB 只锁定找到的index record,不是它之前的区间
    mysql explain 解释
  • 原文地址:https://www.cnblogs.com/arcer/p/3101199.html
Copyright © 2011-2022 走看看