FLASHBACK TABLE

FLASHBACK TABLE — flashback a table

Synopsis

FLASHBACK TABLE name TO BEFORE DROP

Description

FLASHBACK TABLE undo the DROP TABLE. It restores the table from the recycle bin to its earlier state. Only the table owner, the schema owner, and superuser can flashback a table. You can specify either the original user-specified name of the table or the system-generated name LightDB Database assigned to the object when it was dropped.

To see the contents of your recycle bin, query the USER_RECYCLEBIN system view.

Notes on Flashing Back Dropped Tables

  • System-generated recycle bin object names are unique. Therefore, if you specify the system-generated name, then the database retrieves that specified object.

    If you specify the user-specified name, and if the recycle bin contains more than one object of that name, then the database retrieves the object that was moved to the recycle bin most recently.

  • The database retrieves all indexes, triggers and constraints defined on the table except for referential integrity constraints that reference other tables.

    The retrieved indexes, triggers, and constraints have recycle bin names. Therefore it is advisable to query the USER_RECYCLEBIN view before issuing a FLASHBACK TABLE ... TO BEFORE DROP statement so that you can rename the retrieved triggers and constraints to more usable names.

  • When you drop a table, table associated statistics, policies, publications, operators, rewrite rules(exclude view rewrite rule in LightDB oracle mode) are also dropped but are not placed in the recycle bin. Therefore, these objects cannot be flashed back along with the table.

Examples

To flashback a table, t1:

FLASHBACK TABLE t1 TO BEFORE DROP;

To flashback a table t2 of schema my

FLASHBACK TABLE my.t2 TO BEFORE DROP;

See Also

DROP TABLE, PURGE