A short entry today, which is a walk through the new Redshift Table Restore feature.
Let’s say we have a table called customers:
Then one day, the customers table is accidentally truncated –
Previously, to recover the contents of the customers table you would’ve had to restore a snapshot of the database, probably to a new cluster, unload the table to S3 then load it back into the original database. Now though, there is a new tab on the Redshift console called table restore.
Clicking the Restore table button opens a dialog from which you can select which snapshot you want to use to restore the table from. It displays both manual and automated snapshots.
So we simply select the snapshot we want, specify the details for the original table that we want to restore, and then a target table (which must not be an existing table)
The restore request is then submitted, and you can view the progress in the console screen:
Eventually the restore completes, and you can then go into the database and check this:
Now all you need to do is re-insert your data or rename your tables to get things back the way they were. Simple!