PURGE

Purpose
Use the PURGE statement to remove a table or index from your recycle bin and release all of the space associated with the object, or to remove the entire recycle bin, or to remove part of all of a dropped tablespace from the recycle bin.
使用PURGE语句从回收站删除一个表或索引,并释放与该对象关联的所有空间,或者删除整个回收站,或者删除回收站中丢弃的表空间的一部分。

Caution:
You cannot roll back a PURGE statement, nor can you recover an object after it is purged.
注意:purge后不能回滚和恢复

To see the contents of your recycle bin, query the USER_RECYCLEBIN data dictionary review. You can use the RECYCLEBIN synonym instead. The following two statements return the same rows:
要查看回收站的内容,请查询user_UNK clebin数据字典评审。可以使用回收的同义词。
以下两个语句返回相同的行:
SELECT * FROM RECYCLEBIN;
SELECT * FROM USER_RECYCLEBIN;

Prerequisites(先决条件)
The database object must reside in your own schema or you must have the DROP ANY... system privilege for the type of object to be purged, or you must have the SYSDBA system privilege.
数据库对象必须驻留在自己的模式中,否则您必须DROP ANY…要清除的对象类型的系统特权,或者必须具有SYSDBA权限

Syntax(语法)

TABLE or INDEX
Specify the name of the table or index in the recycle bin that you want to purge. You can specify either the original user-specified name or the system-generated name Oracle Database assigned to the object when it was dropped.
指定要清除的回收站中的表或索引的名称。可以指定原始用户指定的名称或系统生成的名称Oracle数据库,该数据库被丢弃时指定给该对象。

• If you specify the user-specified name, and if the recycle bin contains more than one object of that name, then the database purges the object that has been in the recycle bin the longest.
如果指定用户指定的名称,并且如果回收站包含不止一个该名称的对象,那么数据库就会清除在回收站中最长的对象。

• System-generated recycle bin object names are unique. Therefore, if you specify the system-generated name, then the database purges that specified object.
系统生成的回收站对象名是唯一的。因此,如果指定系统生成的名称,那么数据库就会清除指定的对象。

When the database purges a table, all table partitions, LOBs and LOB partitions, indexes, and other dependent objects of that table are also purged.
当数据库清理一个表时,所有表分区、LOB和LOB分区、索引以及该表的其他相关对象也被清除。

RECYCLEBIN
Use this clause to purge the current user's recycle bin. Oracle Database will remove all objects from the user's recycle bin and release all space associated with objects in the recycle bin.
使用此子句清除当前用户的回收站。Oracle数据库将删除用户回收站中的所有对象,并释放与回收站中的对象相关的所有空间。

DBA_RECYCLEBIN
This clause is valid only if you have SYSDBA system privilege. It lets you remove all objects from the system-wide recycle bin, and is equivalent to purging the recycle bin of every user. This operation is useful, for example, before backward migration.
此条款仅当拥有SYSDBA系统特权时才有效。它允许从系统范围内的回收站中删除所有对象,并且相当于清除每个用户的回收站。例如,该操作在向后迁移之前是有用的。

TABLESPACE tablespace
Use this clause to purge all the objects residing in the specified tablespace from the recycle bin.
使用此子句将所有驻留在指定表空间中的对象从回收站中清除。

USER user 
Use this clause to reclaim space in a tablespace for a specified user. This operation is useful when a particular user is running low on disk quota for the specified tablespace.
用户使用此子句在指定用户的表空间中回收空间。当特定的用户在指定的表空间上运行低磁盘配额时,此操作非常有用。

Examples
Remove a File From Your Recycle Bin: Example The following statement removes the table test from the recycle bin. If more than one version of test resides in the recycle bin, Oracle Database removes the version that has been there the longest:
从回收站删除一个文件:例如下面的语句从回收站删除了表测试。如果多个版本的测试驻留在回收站中,Oracle数据库删除了在那里最长的版本:

PURGE TABLE test;
To determine system-generated name of the table you want removed from your recycle bin, issue a SELECT statement on your recycle bin. Using that object name, you can remove the table by issuing a statement similar to the following statement. (The system-generated name will differ from the one shown in the example.)
要确定从回收站中删除的表的系统生成的名称,请在回收站上发布一个SELECT语句。使用该对象名称,可以通过发出类似以下语句的语句删除表。(系统生成的名称与示例中显示的名称不同)。
PURGE TABLE RB$$33750$TABLE$0;

Remove the Contents of Your Recycle Bin: Example 
删除回收站的内容:例如

To remove the entire contents of your recycle bin, issue the following statement:
删除回收箱的全部内容
PURGE RECYCLEBIN;

示例:

1) 首先查一下回收站:
Select * From RECYCLEBIN;

2)创建并删除同一表三次:

CREATE TABLE recycle_tmp(version NUMBER(10));
INSERT INTO recycle_tmp VALUES(1);
COMMIT;
SELECT * FROM RECYCLE_TMP;
DROP TABLE recycle_tmp;
SELECT object_name, original_name, operation, droptime FROM RECYCLEBIN;

此时回收站只有一条记录:

再重复2)的操作,此时回收站有两条记录:

CREATE TABLE recycle_tmp(version NUMBER(10));
INSERT INTO recycle_tmp VALUES(2);
COMMIT;
DROP TABLE recycle_tmp;
SELECT object_name, original_name, operation, droptime FROM RECYCLEBIN;


3)清空版本1(默认删除最早版本)

PURGE TABLE recycle_tmp;
SELECT object_name, original_name, operation, droptime FROM RECYCLEBIN;

4)清空版本2(根据回收站OBJECT_NAME清除表)

PURGE TABLE  "BIN$jw65nLiqSTO82jqDOGghDg==$0";
SELECT object_name, original_name, operation, droptime FROM RECYCLEBIN;

5)还原版本(使用闪回flashback)

FLASHBACK TABLE recycle_tmp TO BEFORE DROP;
SELECT object_name, original_name, operation, droptime FROM RECYCLEBIN;

此时回收站已空

6)删除版本3,后清空回收站

DROP TABLE recycle_tmp;
PURGE RECYCLEBIN;
SELECT object_name, original_name, operation, droptime FROM RECYCLEBIN;

回收站以清空

PURGE 的用法说明的更多相关文章

  1. Oracle purge 用法介绍

    http://blog.csdn.net/indexman/article/details/27379597

  2. 理解Docker(1):Docker 安装和基础用法

    本系列文章将介绍Docker的有关知识: (1)Docker 安装及基本用法 (2)Docker 镜像 (3)Docker 容器的隔离性 - 使用 Linux namespace 隔离容器的运行环境 ...

  3. [Linux] yum和apt-get用法及区别

    一般来说著名的linux系统基本上分两大类: 1.RedHat系列:Redhat.Centos.Fedora等 2.Debian系列:Debian.Ubuntu等 RedHat 系列 1 常见的安装包 ...

  4. linux sudo apt-get用法详解

    APT的使用(Ubuntu Linux软件包管理工具一)apt-cache search # ------(package 搜索包)apt-cache show #------(package 获取包 ...

  5. 【转】MySQL GRANT REVOKE用法

    MySQL的权限系统围绕着两个概念: 认证->确定用户是否允许连接数据库服务器 授权->确定用户是否拥有足够的权限执行查询请求等. 如果认证不成功的话,哪么授权肯定是无法进行的. revo ...

  6. Linux中yum和apt-get用法及区别

    Linux中yum和apt-get用法及区别   一般来说著名的linux系统基本上分两大类:   1.RedHat系列:Redhat.Centos.Fedora等   2.Debian系列:Debi ...

  7. [转]Oracle 清除incident和trace -- ADRCI用法

    在oracle11g中,dump file的目录已经有所改变,bdump和udump整合到trace中,cdump独立出一个. E:\ora11g\app\Administrator\diag\rdb ...

  8. robocopy的用法,数据库局域网备份

    robocopy,我主要是用来进行局域网数据库备份使用,不得不说这个小工具速度还是蛮快的,同时属于系统内置功能,用着还算方便. 这项功能就是RoboCopy,它是一个命令行的目录复制命令,自从Wind ...

  9. Docker 安装和基础用法

    理解Docker(1):Docker 安装和基础用法 本系列文章将介绍Docker的有关知识: (1)Docker 安装及基本用法 (2)Docker 镜像 (3)Docker 容器的隔离性 - 使用 ...

随机推荐

  1. Mac下开机启动rc.common不生效的问题

    经过测试在10.12.6下/etc/rc.common不生效,原因是已经被launchd守护进程所取代,虽然保留着这个文件,但是基本是不起作用的. 如果要开机启动请直接使用launchd进行操作. 同 ...

  2. RHCE 共享文件系统

    9.1 共享文件系统 概述: 共享文件系统通常有两种方式: 基于文件共享,一种直接共享文件夹给client端,常见的技术有NFS(Network File System )和 SMB (Server ...

  3. PHPStorm操作小技巧

    1.围绕选中字符输入引号或者括号 2.设置服务器部署 3.隐藏Project快捷键 Shift + Esc 4.IDE内窗口切换 Ctrl + TAB 5.关闭当前项目 File -> Clos ...

  4. Win10 VS2015 静态编译Qt5.6.2源码

    由于VS2015需要CRT等拓展组件,因此把内部编写的工具软件以静态发布,固需要编译Qt源码.Qt5.6.2版本,VS2015,Win10 1.安装python,perl,下载jom 2.改文件com ...

  5. struts2 基本流程

    一.配置过程 1.在web.xml中配置过滤器 <filter> <filter-name>StrutsPrepareAndExecuteFilter</filter-n ...

  6. 算法之经典排序-冒泡排序(bubble sort)

    冒泡排序 它重复地走访过要排序的数列,一次比较两个元素,如果他们的顺序错误就把他们交换过来.走访数列的工作是重复地进行直到没有再需要交换,也就是说该数列已经排序完成. 这个算法的名字由来是因为越大的元 ...

  7. C 标准库 - ctype.h

    C 标准库 - ctype.h This header declares a set of functions to classify and transform individual charact ...

  8. [转载]二叉树(BST,AVT,RBT)

    二叉查找树(Binary Search Tree)是满足如下性质的二叉树:①若它的左子树非空,则左子树上所有结点的值均小于根结点的值:②若它的右子树非空,则右子树上所有结点的值均大于根结点的值:③左. ...

  9. java爬虫爬取https协议的网站时,SSL报错, java.lang.IllegalArgumentException TSLv1.2 报错

    目前在广州一家小公司实习,这里的学习环境还是挺好的,今天公司从业十几年的大佬让我检查一下几年前的爬虫程序是否还能使用…… 我从myeclipse上check out了大佬的程序,放到workspace ...

  10. 基于angular2+ 的 http服务封装

    1.定义http-interceptor.service.ts服务,统一处理http请求 /** * name:http服务 * describe:对http请求做统一处理 * author:Angu ...