1. Ensure that the prerequisites described in Prerequisites of Flashback Drop are met.

    The following list summarizes the user privileges required for the operations related to Flashback Drop and the recycle bin:
    
    DROP
    
    Any user with DROP privileges over an object can drop the object, placing it in the recycle bin.
    
    FLASHBACK TABLE ... TO BEFORE DROP
    
    Privileges for this statement are tied to the privileges for DROP. That is, any user who can drop an object can perform Flashback Drop to retrieve the dropped object from the recycle bin.
    
    PURGE
    
    Privileges for a purge of the recycle bin are tied to the DROP privileges. Any user having DROP TABLE, DROP ANY TABLE, or PURGE DBA_RECYCLE_BIN privileges can purge the objects from the recycle bin.
    
    READ or SELECT and FLASHBACK for objects in the Recycle Bin
    
    Users must have the READ or SELECT and FLASHBACK privileges over an object in the recycle bin to query the object in the recycle bin. Any users who had the READ or SELECT privilege over an object before it was dropped continue to have the READ or SELECT privilege over the object in the recycle bin. Users must have FLASHBACK privilege to query any object in the recycle bin, because these are objects from a past state of the database.
    
    Objects must meet the following prerequisites to be eligible for retrieval from the recycle bin:
    
    The recycle bin is only available for non-system, locally managed tablespaces. If a table is in a non-system, locally managed tablespace, but one or more of its dependent segments (objects) is in a dictionary-managed tablespace, then these objects are protected by the recycle bin.
    
    Tables that have fine-grained auditing (FGA) and Virtual Private Database (VPD) policies defined over them are not protected by the recycle bin.
    
    Partitioned index-organized tables are not protected by the recycle bin.
    
    The table must not have been purged, either by a user or by Oracle Database during a space reclamation operation.

    Prerequisites

  2. Connect SQL*Plus to the target database and obtain the name of the dropped table in the recycle bin.

    You can use the SQL*Plus command SHOW RECYCLEBIN as follows:

    SHOW RECYCLEBIN;
    
    ORIGINAL NAME    RECYCLEBIN NAME                   TYPE         DROP TIME
    ---------------- --------------------------------- ------------ -------------
    EMPLOYEE_DEMO BIN$gk3lsj/3akk5hg3j2lkl5j3d==$0 TABLE 2013-04-11:17:08:54

    The ORIGINAL NAME column shows the original name of the object, whereas the RECYCLEBIN NAME column shows the name of the object as it exists in the bin.

    Alternatively, you can query USER_RECYCLEBIN or DBA_RECYCLEBIN to obtain the table name. The following example queries the RECYCLEBIN view to determine the original names of dropped objects:

    SELECT object_name AS recycle_name, original_name, type
    FROM recyclebin; RECYCLE_NAME ORIGINAL_NAME TYPE
    -------------------------------- --------------------- ----------
    BIN$gk3lsj/3akk5hg3j2lkl5j3d==$0 EMPLOYEE_DEMO TABLE
    BIN$JKS983293M1dsab4gsz/I249==$0 I_EMP_DEMO INDEX

    If you plan to manually restore original names for dependent objects, then ensure that you make note of each dependent object's system-generated recycle bin name before you restore the table.

    Note:

    Object views such as DBA_TABLES do not display the recycle bin objects.

  3. Optionally, query the table in the recycle bin.

    You must use the recycle bin name of the object in your query rather than the object's original name. The following example queries the table with the recycle bin name of BIN$gk3lsj/3akk5hg3j2lkl5j3d==$0:

    SELECT *
    FROM "BIN$gk3lsj/3akk5hg3j2lkl5j3d==$0";

    Quotation marks are required because of the special characters in the recycle bin name.

    Note:

    If you have the necessary privileges, then you can also use Flashback Query on tables in the recycle bin, but only by using the recycle bin name rather than the original table name. You cannot use Data Manipulation Language (DML) or DDL statements on objects in the recycle bin.

  4. Retrieve the dropped table.

    Use the FLASHBACK TABLE ... TO BEFORE DROP statement. The following example restores the BIN$gk3lsj/3akk5hg3j2lkl5j3d==$0 table, changes its name back to hr.employee_demo, and purges its entry from the recycle bin:

    FLASHBACK TABLE "BIN$gk3lsj/3akk5hg3j2lkl5j3d==$0" TO BEFORE DROP;
    

    The table name is enclosed in quotation marks because of the possibility of special characters appearing in the recycle bin object names.

    Alternatively, you can use the original name of the table:

    FLASHBACK TABLE HR.EMPLOYEE_DEMO TO BEFORE DROP;
    

    You can also assign a new name to the restored table by specifying the RENAME TO clause. For example:

    FLASHBACK TABLE "BIN$gk3lsj/3akk5hg3j2lkl5j3d==$0" TO BEFORE DROP
    RENAME TO hr.emp_demo;
  5. Optionally, verify that all dependent objects retained their system-generated recycle bin names.

    The following query determines the names of the indexes of the retrieved hr.employee_demo table:

    SELECT INDEX_NAME
    FROM USER_INDEXES
    WHERE TABLE_NAME = 'EMPLOYEE_DEMO'; INDEX_NAME
    ------------------------------
    BIN$JKS983293M1dsab4gsz/I249==$0
  6. Optionally, rename the retrieved indexes to their original names.

    The following statement renames the index to its original name of i_emp_demo:

    ALTER INDEX "BIN$JKS983293M1dsab4gsz/I249==$0" RENAME TO I_EMP_DEMO;
    
  7. If the retrieved table had referential constraints before it was placed in the recycle bin, then re-create them.

    This step must be performed manually because the recycle bin does not preserve referential constraints on a table.

Oracle Flashback Drop的更多相关文章

  1. ORACLE FLASHBACK DATABASE 知识整理

    1.知识储备 1)    只有SYSDBA有权执行,闪回前一定要记录当前SCN 2)    需要停机,并要求处于ARCHIVELOG模式中 3)    闪回日志不能被复用和归档,是自动管理的.RVWR ...

  2. Oracle Flashback Technologies - 闪回被drop的表

    Oracle Flashback Technologies - 闪回被drop的表 在oracle10g中,drop一个表后,表没有真正被删除,支持被rename后放在recyclebin中. #新建 ...

  3. Oracle Flashback(flashback table或drop)

    在Oracle 10g中,Flash back家族分为以下成员:Flashback DatabaseFlashback DropFlashback TableFlashback Query(分Flas ...

  4. Oracle Flashback 闪回

    Oracle 的闪回技术是一种数据恢复技术,仅能对用户逻辑错误进行恢复, 闪回针对的是提交commit的事务,没有提交的事务,使用rollback 1.闪回版本查询 Flashback Version ...

  5. Oracle Flashback Technologies (总)

    Oracle Flashback Technologies Oracle 9i中增加了闪回查询技术,闪回查询为数据库提供了一种简单.强大.完全无干扰从人为错误中恢复的机制.通过闪回查询,用户可以查看过 ...

  6. oracle flashback

    一.Flashback闪回技术概述:当Oracle数据库发生逻辑错误时,必须使用flashback技术,实现快速和方便的恢复数据.对于人为错误,要确定受到错误事务影响的对象或者记录是非常困难的.使用f ...

  7. flashback drop(2015-2-3学习日记)

    知识面是由知识点组成的,你在研究某一个知识点的时候常常会遇到另一个知识点,然后你去研究那个知识点,又会带出更多的知识点,最终组成了知识面. 今天在看书的时候看到一个删除表的语句: DROP TABLE ...

  8. Flashback Drop实例操作

    1.Flashback DropFlashback Drop 是从Oracle 10g 开始出现的,用于恢复用户误删除的对象(包括表,索引等), 这个技术依赖于Tablespace Recycle B ...

  9. Oracle Flashback 详解

    Oracle flashback 是一种方便快捷的数据库恢复技术,它不使用备份文件,通过闪回日志可以使数据库恢复到过去的某个状态,当用户发生逻辑错误时(误删表数据.表.表空间等)需要快速恢复数据库,可 ...

随机推荐

  1. S-Nim HDU 1536 博弈 sg函数

    S-Nim HDU 1536 博弈 sg函数 题意 首先输入K,表示一个集合的大小,之后输入集合,表示对于这对石子只能去这个集合中的元素的个数,之后输入 一个m表示接下来对于这个集合要进行m次询问,之 ...

  2. Java并发编程:锁的释放

    Java并发编程:锁的释放 */--> code {color: #FF0000} pre.src {background-color: #002b36; color: #839496;} Ja ...

  3. homestead修改php版本

    登录后 如果之前没有设置过root密码 sudo passwd root 以root 权限执行如下命令,选择对应php版本 # 查看所有 php 版本和当前版本 update-alternatives ...

  4. 提高CUI测试稳定性技术

    GUI自动化测试稳定性,最典型的表现形式就是,同样的测试用例在同样的环境上,时而测试通 过,时而测试失败. 这也是影响GUI测试健康发展的一个重要障碍,严重降低了GUI测试的可信性. 五种造成GUI测 ...

  5. Python 入门之数据类型之间的相互转换 以及 在编程中会遇到的数据类型的坑

    Python 入门之数据类型之间的相互转换 以及 在编程中会遇到的数据类型的坑 1.数据类型总结: 可变,不可变,有序,无序 (1)可变的数据类型:list dict set (2)不可变的数据类型: ...

  6. FFmpeg SDK开发模型之中的一个:解码器

    简单介绍 本例解说了怎样使用ffmpeg SDK解码媒体文件: 參考源代码是ffmpeg 自带的apiexample.c 一.源代码#include <stdlib.h>#include ...

  7. 3.css3文字与字体

    1.css3文字与字体: ①Font-size:大小. ⑴通常使用px.百分比.em来设置大小: ⑵xx-small.x-small.small.medium.large.x-large.xx-lar ...

  8. 前端Unicode字符图标

    前端Unicode字符图标 原文链接地址:http://www.htmleaf.com/ziliaoku/qianduanjiaocheng/20141225979.html

  9. 20140919-FPGA-有效观察设计中的差分信号

    今天回来坐在电脑前,打开Xilinx的Documentation Navigator寻找NCO相关的User Guide,但是在不经意中发现了一个这样的IP,我感觉对于观察设计中的查分信号十分有用.之 ...

  10. VS2017报错:未提供初始值设定项

    今天在使用VS2017写程序时,报错: 出错的代码如下: #include "pch.h" #include <iostream> #include <threa ...