Saturday, August 9, 2008

Flashback Tables

SHOW RECYCLEBIN
/* Same as Select * from User_Recyclebin;*/

FLASHBACK TABLE table TO BEFORE DROP;
/* retrieve a dropped table */
FLASHBACK TABLE table TO BEFORE DROP RENAME TO new_name;
/* bring back table when dropped name already exists */

DROP table RECYCLETEST PURGE;
/* Drop a table w/out a chance to flashback */

PURGE RECYCLEBIN;
/* a user can purge their own recycle bin */
PURGE TABLE table;
/* purge a table, its indexes, constraints, etc. after dropped */
PURGE TABLESPACE tablespace;
/* to purge by tablespace */
PURGE TABLESPACE tablespace USER user;
/* purge a tablespace by user */
PURGE INDEX index;
/* to purge an index */
PURGE DBA_RECYCLEBIN;
/* a DBA can purge all the objects in any tablespace */

No comments:

Post a Comment