What is Oracle SCN number ?




IMPORTANCE OF SCN -System Change Number

 The scn is an ever-increasing number. It can be used to determine the "age" of the database and its component datafiles

 

The current system SCN can be queried using dbms_flashback.get_system_change_number.
The SCN of the last checkpoint can be found in v$database.checkpoint_change#.
The SCN is needed in a flashback table .. to scn ... statement. 

Is database in a consistent state?
The SCN plays an important role to determine if the database is in a consistent state when the database is brought online. SMON checks the SCN in all datafile headers when the database is started. Everything is OK if all of these SCNs matches the SCN found in the controlfile. If the SCNs don't match, the database is in an inconsistent state. 

The role of the SCN for consistent reads
The SCN plays a vital role for providing consistent reads.
Basically, it works as follows: The query reads a db block. This block has as an attribute the SCN when it was last changed. If this SCN is greater than the SCN that was in place when query began, it means that the block was changed after we have started our query. So we have to find an older version of the block. If this block is found in the rollback segments, we use it for our query.


Share your views...

0 Respones to "What is Oracle SCN number ?"

Post a Comment

 

© 2010 Codes & Concepts All Rights Reserved Thesis WordPress Theme Converted into Blogger Template by Hack Tutors.info