Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Bill.

Asked: August 15, 2019 - 12:49 pm UTC

Last updated: September 02, 2019 - 12:26 pm UTC

Version: 12.2.0

Viewed 1000+ times

You Asked

i use oracle logminer to analysis oracle redo log,and my program relied heavily on scn increase strictly,but sometimes i found that scn from result of logminer is not increase。
for example:
26942069
26942070
26942071
26942058
26942071
26942071
26942071
26942071
As we all know,scn in oracle is increased strictly,but why it break in logminer?

this is my sql:
BEGIN DBMS_LOGMNR.ADD_LOGFILE(logfilename => '/home/oracle/oracle/product/12.2.0/dbhome_2/dbs/arch1_1917_1005421687.dbf' ,options => DBMS_LOGMNR.NEW); END;
BEGIN DBMS_LOGMNR.START_LOGMNR(STARTSCN=>26942032,OPTIONS => DBMS_LOGMNR.NEW); END;



and Connor said...

my program relied heavily on scn increase strictly


Well.. your program should not :-)

The SCN is an increasing mechanism, but that is not the same as saying it *must* increase for every single commit. The SCN is all about *our* (the database's) ability to ensure changes are applied in order, including during a recovery.

If you'd like to really dig into the nitty gritty, Frits Hoogland did some very detailed analysis on this

https://fritshoogland.wordpress.com/2016/10/22/transactions-and-scns/

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database