question

OracleApprender avatar image
OracleApprender asked

Is it possible to do flashback after truncate?

Is there any possibility of doing flashback after truncate ? Thank you in advance.

oracledatabase
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

The answer is yes.
0 Likes 0 ·
OraLearner avatar image
OraLearner answered

No, cannot do flashback after a ddl, because it invalidated undo data for the object. Both flashback table and flashback query will fail with error: ORA-01466: unable to read data - table definition has changed

1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Yes, you can. Read my expanded answer.
0 Likes 0 ·
KillerDBA avatar image
KillerDBA answered

Yes, using 'flashback database'. See this link:

Flashback Examples

which appears pertinent to 10g.

Also, see this link:

Oracle New Features Incl. Flashback Improvements

And this one, which includes another example:

10g Flashback Examples

Note: The question asked about 'flashback' not 'flashback table'. While 'flashback table' still won't undo a truncate, you CAN undo a truncate using 'flashback database...'.

1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I've posted the answer with the query..pls find it.
0 Likes 0 ·
OraLearner avatar image
OraLearner answered

Flashback will not work if u perform DDL in between..not in any version of oracle.. if you want to test flashback..there should not be ddl performed on the the object in question.

I am trying to query between versions for flashback and am getting the following error:

SQL> SELECT versions_startscn, versions_starttime, 
2 versions_endscn, versions_endtime,
3 versions_xid, versions_operation,
4 description 
5 FROM flashback_version_query_test 
6 VERSIONS BETWEEN TIMESTAMP TO_TIMESTAMP('2004-07-06 11:29:48', 'YYYY-MM-DD HH24:MI:SS')
7 AND TO_TIMESTAMP('2004-07-06 11:30:32', 'YYYY-MM-DD HH24:MI:SS')
8 WHERE id = 1;
FROM flashback_version_query_test
*
ERROR at line 5:
ORA-01466: unable to read data - table definition has changed
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.