Tuesday, March 20, 2012

flashback oracle 11g

flashback is a feature of oracle database, whcih use undo to get old version of your data.

it is very useful for human error like misdeletion.

1. you can get old version of your data from flashback query:

select * from tablename as of timestamp sysdate -1/24/60*20; ( data twenty minutes ago)

2. you can restore the table by

insert into tablename
select * from tablename as of timestamp sysdate -1/24/60*20;

commit;

3. you might get error: ORA-01466: unable to read data - table definition has changed

the problem is the timestamp is too old. change 20 to 10 or 15 might get ride of the error.


reference:
http://it.toolbox.com/blogs/surachart/rewinding-a-table-using-oracle-flashback-table-33812
http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm
http://snandan.blogspot.com/2007/09/flashback-query-error-ora-01466-unable.html

No comments:

Post a Comment