May 272013
 
insert into data_you_thought_was_gone
  select how_it_looked_before,
         the_users_hit_delete
  from   data_you_thought_was_gone
           as of timestamp 
           sysdate - interval '1' hour
  minus
  select how_it_looked_before 
           as how_it_looks_now,
         the_users_hit_delete
  from   data_you_thought_was_gone;

Flashback to the rescue again! This approach will only work if you're notified of the data deletion 
before your undo retention runs out, otherwise you've got to go your backups. You may need to add 
further filtering if there's been updates to your data as well as deletions too. Still can come in very 
handy in certain scenarios though :)

For a script to see this in action, click here. For a thorough explanation of flashback, have a look at this oracle-base article.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>