Subscribe to Posts by Email

Subscriber Count

    701

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Current_SCN how it populates?

My friend has asked this question today as he got the same in one his interview...

The common answer we give is from any base table as v$database (current_scn) is populated by any base table.

However the base table is $KCCDI under column DICUR_SCN is current SCN. you can find this by querying the v$database view code in dba_views.

Lets look

	SQL> select current_scn from v$database;

	CURRENT_SCN
	-----------
	102707163


	SQL> select DICKP_SCN,DICUR_SCN from X$KCCDI;

	DICKP_SCN        DICUR_SCN
	---------------- ----------------

	102711050        102711285

	SQL> select current_scn from v$database;
	CURRENT_SCN
	-----------
	102711289
Note: DICKP_SCN is last checkpoint SCN, when the log switch happens then checkpoint will occur that SCN.

Further why this question has been asked I don't know, but this way we can find the interval of last checkpoint SCN as well. by DICKP_SCN - DICUR_SCN and then map to SCN_TO_TIMESTAMP.

-:)

Comments are closed.