• flashback table


    前提:开启回收站

       查看回收站状态

    SQL> show parameter recyclebin;
    
    NAME				     TYPE	 VALUE
    ------------------------------------ ----------- ------------------------------
    recyclebin			     string	 ON
    

      

    SQL> desc test;
     Name					   Null?    Type
     ----------------------------------------- -------- ----------------------------
     TABLE_NAME				   NOT NULL VARCHAR2(30)
    SQL> drop table test;
    
    Table dropped.
    SQL> select original_name,operation,droptime from recyclebin;
    no rows selected
    SQL> flashback table test to before drop;
    flashback table test to before drop
    *
    ERROR at line 1:
    ORA-38305: object not in RECYCLE BIN
    SQL> 
    

      

    SQL> show user
    USER is "SYS"
    SQL> 
    

     奇怪,为什么回收站是开的,删除时不进回收站呢?系统表空间是不放入回收站的

    scott用户就没有问题:

    SQL> show user
    USER is "SCOTT"
    SQL>create table  test as select * from emp;
    Table created.
    
    SQL> select count(1) from test;
    
      COUNT(1)
    ----------
           270
    
    SQL> drop table test;
    
    Table dropped.
    
    SQL> select original_name,operation,droptime from recyclebin;
    
    ORIGINAL_NAME			 OPERATION DROPTIME
    -------------------------------- --------- -------------------
    TEST				 DROP	   2019-09-11:02:13:37
    
    SQL> flashback table test to before drop;
    
    Flashback complete.
    
    SQL> select count(1) from test;
    
      COUNT(1)
    ----------
           270
    
    SQL> 
    

     回收站开启的方法:

    alter session set recyclebin=off;

    alter system set recyclebin=off DEFERRED;

  • 相关阅读:
    <span>和<div>标签的隐藏和显示切换
    重启svn
    Mac下配置apache
    iOS时间显示今天昨天
    关于UIPageViewController那些事
    关于plist文件的那些事
    Xcode调试LLDB
    Reveal安装
    静态初始化器
    Static简介
  • 原文地址:https://www.cnblogs.com/jycjy/p/11507054.html
Copyright © 2020-2023  润新知