Oracle Multiversion Concurrency Control (MVCC)
Version 12.2.0.1

General Information
Library Note Morgan's Library Page Header
Coming to OpenWorld 2018? Be sure to visit the TidalScale booth in Moscone South and learn how to solve performance problems and lower costs with Software Defined Servers. Before you visit the booth, or if you can't make it this year, check out TidalScale at www.tidalscale.com. Be sure to click on the Solutions link and look through the Oracle resources.
The Multi-Version Concurrency model is the single most important concept to understand about Oracle and how it works. The underlying mechanisms are the control files, system change numbers (SCN), and how Oracle utilizes ROLLBACK/UNDO segments.
First Available version 4.0
 
SQL*Plus Demo
conn uwclass/uwclass@pdbdev

CREATE TABLE mvcc_test AS
SELECT * FROM all_objects;

SELECT COUNT(*) FROM mvcc_test;

variable x REFCURSOR

BEGIN
  OPEN :x FOR
  SELECT COUNT(*) FROM mvcc_test;
END;
/

DELETE FROM mvcc_test WHERE rownum < 20001;

COMMIT;

SELECT COUNT(*) FROM mvcc_test;

variable y REFCURSOR

BEGIN
  OPEN :y FOR
  SELECT COUNT(*) FROM mvcc_test;
END;
/


DELETE FROM mvcc_test;

COMMIT;

SELECT COUNT(*) FROM mvcc_test;

print x
print y

DROP TABLE mvcc_test PURGE;

CREATE TABLE mvcc_test AS
SELECT * FROM all_objects;

SELECT COUNT(*) FROM mvcc_test;

variable z REFCURSOR

set timing on

BEGIN
  OPEN :z FOR
  SELECT * FROM mvcc_test;
END;
/

set timing off

DELETE FROM mvcc_test;

COMMIT;

SELECT COUNT(*) FROM mvcc_test;

print z
Try the above demo substituting TRUNCATE for DELETE and COMMIT. What is the difference?

Related Topics
DBMS_FLASHBACK
DBMS_TRANSACTION
Flashback Query
Transactions
What's New In 12cR1
What's New In 12cR2

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2017 Daniel A. Morgan All Rights Reserved