Powered By Blogger

Thursday, January 27, 2011

Flashback Query tested in Oracle 10g

******************** Flashback Query *****************

11:01:21 SQL> select * from a;

NO
----------
0
1
2
33
3423
44444
123123

11:01:28 SQL> select * from a as of timestamp to_timestamp('16/07/2009:10:59:36','dd/mm/yyyy:hh:mi:ss');

NO
----------
0
33
3423
44444


D)Convert Timestamp to SCN
-------------------------------------------------------------

11:22:39 SQL> SELECT TIMESTAMP_TO_SCN('16-JUL-09:10:59:36') from dual;

TIMESTAMP_TO_SCN('16-JUL-09:10:59:36')
--------------------------------------
676308

11:23:30 SQL> flashback table a to scn 676308;
Flashback complete.

11:24:00 SQL> select * from a;

NO
----------
0
33
3423
44444
123123

No comments:

Post a Comment