• 【Oracle】闪回drop后的表


    本文介绍的闪回方式只适用于:删除表的表空间非system,drop语句中没有purge关键字(以上两种情况的误删除操作只能通过日志找回):

    1.删除表后直接从回收站闪回

    SCOTT@LGR> drop table emp1;
    
    Table dropped.
    SCOTT@LGR> select object_name,original_name,operation from recyclebin where original_name='EMP1';
    
    OBJECT_NAME                     ORIGINAL_NAME  OPERATION                  
    ------------------------------  -------------  ---------
    BIN$QxD9et5lIi3gUwEAAH/pOw==$0  EMP1            DROP                  
    SCOTT@LGR> flashback table"BIN$QxD9et5lIi3gUwEAAH/pOw==$0" to before drop;
    
    Flashback complete.

    2.当数据库中存在和删除表同名的表,则删除表需要在闪回的同时修改为其他名字,否则闪回失败

    SCOTT@LGR> drop table emp1;
    
    Table dropped.
    
    SCOTT@LGR> create table emp1 (id number);
    
    Table created.
    
    SCOTT@LGR> select object_name,original_name,operation from recyclebin
      2  where original_name='EMP1';
    
    OBJECT_NAME                    ORIGINAL_NAME    OPERATION                
    ------------------------------ --------------
    BIN$QxD9et5mIi3gUwEAAH/pOw==$0 EMP1             DROP
    
    SCOTT@LGR> flashback table"BIN$QxD9et5mIi3gUwEAAH/pOw==$0" to before drop;
    flashback table"BIN$QxD9et5mIi3gUwEAAH/pOw==$0" to before drop
    *
    ERROR at line 1:
    ORA-38312: original name is used by an existing object
    SCOTT@LGR> flashback table"BIN$QxD9et5mIi3gUwEAAH/pOw==$0" to before drop rename to emp2;
    
    Flashback complete.
  • 相关阅读:
    Node.js、vue.js的使用
    windows配置环境变量
    http常见状态码及其解析
    AWS使用教程
    免费服务器集锦 免费服务器大全 免费使用服务器
    免费服务器AWS免费使用一年详细教程
    PHP实现RSA2加密
    dcoker安装redis
    ES,kibana通过nginx添加访问权限
    docker快速安装kibana
  • 原文地址:https://www.cnblogs.com/NextAction/p/7366711.html
Copyright © 2020-2023  润新知