oracle19crecycle-binflashback

How to restore an earlier version of a table from recyclebin?


I'm practicing on restoring tables from recyclebin in Oralce 19. I've already known about the FLASHBACK TABLE statement. However, it does restore the last version of a table only.

What if I want to restore an earlier state of my table? Here's what I've already found and tried:

By this query I get names of the deleted instances of my table and when these were deleted.

select object_name, droptime from recyclebin where original_name = 'TEST';

Then I copy an object_name of the instance I need to my flashback statement:

flashback table BIN$USnbm7YhQBu9TbSyOdqyKA==$0 TO BEFORE DROP;

this sentence gave me ORA-00905: missing keyword.

Is there a way to correct the last statement or the whole method isn't working?


Solution

  • Recycle bin objects have strange names and must be surrounded with quotation marks like this:

    flashback table "BIN$USnbm7YhQBu9TbSyOdqyKA==$0" TO BEFORE DROP;