Home / Oracle DBA / FLASHBACK FEATURES

FLASHBACK FEATURES

FLASHBACK FEATURES

FLASHBACK QUERY
—————————–
  1. CREATE TABLE flashback_query_test (  id  NUMBER(10));
  1. SELECT current_scn, TO_CHAR(SYSTIMESTAMP, ‘YYYY-MM-DD HH24:MI:SS’) FROM v$database;
CURRENT_SCN TO_CHAR(SYSTIMESTAM
———– ——————-
    722452 2004-03-29 13:34:12
  1. INSERT INTO flashback_query_test (id) VALUES (1);
  2. COMMIT;
  1. SELECT COUNT(*) FROM flashback_query_test;
COUNT(*)
———-
        1
  1. SELECT COUNT(*) FROM flashback_query_test AS OF TIMESTAMP TO_TIMESTAMP(‘2004-03-29 13:34:12’, ‘YYYY-MM-DD HH24:MI:SS’);
COUNT(*)
———-
        0
  1. SELECT COUNT(*) FROM flashback_query_test AS OF SCN 722452;
COUNT(*)
———-
        0

FLASHBACK VERSION QUERY
——————————————–

  1. CREATE TABLE flashback_version_query_test (  id           NUMBER(10),
description  VARCHAR2(50));
  1. INSERT INTO flashback_version_query_test (id, description) VALUES (1, ‘ONE’);
  1. COMMIT;
  1. SELECT current_scn, TO_CHAR(SYSTIMESTAMP, ‘YYYY-MM-DD HH24:MI:SS’) FROM v$database;
  1. UPDATE flashback_version_query_test SET description = ‘TWO’ WHERE id = 1;
  1. COMMIT;
  1. UPDATE flashback_version_query_test SET description = ‘THREE’ WHERE id = 1;
  1. COMMIT;
  1. SELECT current_scn, TO_CHAR(SYSTIMESTAMP, ‘YYYY-MM-DD HH24:MI:SS’) FROM v$database;
COLUMN versions_startscn FORMAT 99999999999999999
COLUMN versions_starttime FORMAT A24
COLUMN versions_endscn FORMAT 99999999999999999
COLUMN versions_endtime FORMAT A24
COLUMN versions_xid FORMAT A16
COLUMN versions_operation FORMAT A1
COLUMN description FORMAT A11
SET LINESIZE 200
  1. SELECT versions_startscn, versions_starttime,
versions_endscn, versions_endtime,
versions_xid, versions_operation,
description
      FROM   flashback_version_query_test
      VERSIONS BETWEEN TIMESTAMP TO_TIMESTAMP(‘2004-03-29 14:59:08’, ‘YYYY-MM-DD HH24:MI:SS’)
      AND TO_TIMESTAMP(‘2004-03-29 14:59:36’, ‘YYYY-MM-DD HH24:MI:SS’)
WHERE  id = 1;
  1. SELECT versions_startscn, versions_starttime,
versions_endscn, versions_endtime,
versions_xid, versions_operation,
description
      FROM flashback_version_query_test
      VERSIONS BETWEEN SCN 725202 AND 725219

WHERE  id = 1;

View More:
ORACLE INSTANCE TUNING WITH REPORTS
ORACLE DATABASE TUNING WITH EXAMPLES
PERFORMANCE TUNING IN ORACLE
DON’T MISS OUT!
Subscribe To Newsletter
Be the first to get latest updates and exclusive content straight to your email inbox.
Stay Updated
Give it a try, you can unsubscribe anytime.

Check Also

Oracle 10g to 11g Enhancements (Difference between Oracle 10g and 11g)

Difference between Oracle 10g and 11g 1- Enhanced Automatic Memory Management System Oracle 9i automated …

Leave a Reply

Your email address will not be published. Required fields are marked *

DON’T MISS OUT!
Subscribe To Newsletter
Be the first to get latest updates and exclusive content straight to your email inbox.
Stay Updated
Give it a try, you can unsubscribe anytime.
close-link
GET OUR LATEST CONTENT IN YOUR INBOX

SUBSCRIBE 
Your information will never be shared
close-link
Enquiry
Submit
close-link
Sign-up for exclusive content. Be the first to hear about DBA Centre Blogs.
Subscribe