ITPub博客

首页 > 数据库 > Oracle > recyclebin

recyclebin

原创 Oracle 作者:zhangsharp20 时间:2016-06-13 15:49:45 0 删除 编辑
When you drop a table, the database does not immediately remove the space associated with the table. The database renames the table and places it and any associated objects in a recycle bin, where, in case the table was dropped in error, it can be recovered at a later time. This feature is called Flashback Drop, and the FLASHBACK TABLE statement is used to restore the table. 

当你删除一张表的时候,数据库不会立即释放相关表的空间,数据库会重命名表和其相关的对象,并将其放在recycle bin中

What Is the Recycle Bin?

The recycle bin is actually a data dictionary table containing information about dropped objects. Dropped tables and any associated objects such as indexes, constraints, nested tables, and the likes are not removed and still occupy space. They continue to count against user space quotas, until specifically purged from the recycle bin or the unlikely situation where they must be purged by the database because of tablespace space constraints.

recycle bin实际上是一个包含删除对象信息的字典表。被删除的表和任何一个与其相关的对象都没有被删除并且仍然占用空间。直到专门从recycle bin中被purge,或者是其他不太可能发生的情况导致这些对象必须呗purge。

Each user can be thought of as having his own recycle bin, because, unless a user has the SYSDBA privilege, the only objects that the user has access to in the recycle bin are those that the user owns. A user can view his objects in the recycle bin using the following statement:
SELECT * FROM RECYCLEBIN;

每个用户都有自己的recycle bin,每个用户只有处理自己所属的recycle bin的对象,有sysdba权限的用户除外。



Users can purge the recycle bin of their own objects, and release space for objects, by using the following statement:
PURGE RECYCLEBIN;

If you have the SYSDBA privilege, then you can purge the entire recycle bin by specifying DBA_RECYCLEBIN, instead of RECYCLEBIN in the previous statement.

Restoring Tables from the Recycle Bin

The following example restores int_admin_emp table and assigns to it a new name:
FLASHBACK TABLE int_admin_emp TO BEFORE DROP RENAME TO int2_admin_emp;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29802484/viewspace-2119575/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-08-12

  • 博文量
    382
  • 访问量
    801424