FLASHBACK QUERY Concepts

FLASHBACK  QUERY

Flashback Query allows the contents of a table to be queried with reference to a specific point in time, using the AS OF clause. Essentially it is the same as the DBMS_FLASHBACK functionality.

SQL> create table flashback_query_test  (id  number(10));

Table created.

SQL> SELECT current_scn, TO_CHAR(SYSTIMESTAMP, 'YYYY-MM-DD HH24:MI:SS')FROM v$database;

    CURRENT_SCN               TO_CHAR(SYSTIMESTAMP
 --------------            -------------------------
   4933950                     2021-07-20 00:02:36

SQL> INSERT INTO flashback_query_test (id) VALUES (1);

1 row created.

SQL> commit;
  
Commit complete.

SQL> SELECT current_scn, TO_CHAR(SYSTIMESTAMP,'YYYY-MM-DD HH24:MI:SS') FROM v$database;

CURRENT_SCN      TO_CHAR(SYSTIMESTAMP
---------------        --- ---------------------
    4934857                     2021-07-20 00:10:15

SQL> SELECT COUNT(*) FROM flashback_query_test;

  COUNT(*)
----------
         1
SOL> SELECT COUNT(*) FROM   flashback_query_test AS OF SCN 4933950;

 COUNT(*)
----------
     1

SOL> SELECT COUNT(*) FROM   flashback_query_test AS OF SCN 4934857 ;

 COUNT(*)
----------
      0

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

One thought on “FLASHBACK QUERY Concepts