Oracle Recyclebin

来源:互联网 发布:维棠 mac 编辑:程序博客网 时间:2024/06/08 17:01

从10G开始,Oracle引入了类似Windows回收站的recyclebin.


There are two recyclebin views: USER_RECYCLEBIN and DBA_RECYCLEBIN. For convenience, the synonym RECYCLEBIN points to your USER_RECYCLEBIN. The recyclebin is enabled by default in 10g, but you can turn it on or off with the RECYCLEBIN initialization parameter, at the system or session level.

When the recyclebin is enabled, any tables that you drop do not actually get deleted. Instead, when you drop a table, Oracle just renames the table and all its associated objects (indexes, triggers, LOB segments, etc) to a system-generated name that begins with BIN$. 


Initial parameter:  RECYCLEBIN. Default value is on, can be changed at session and system levels

alter system set recyclebin=off scope=both;


Save a table:
FLASHBACK TABLE ... TO BEFORE DROP

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. You cannot roll back a PURGE statement, nor can you recover an object after it is purged.
PURGE TABLE test;PURGE RECYCLEBIN;
直接删除Recyclebin中的表,会得到一个错误:

ORA-38301: can not perform DDL/DML over objects in Recycle Bin


0 0
原创粉丝点击