SCN-Demo [message #157234] |
Wed, 01 February 2006 03:38 |
gajini
Messages: 262 Registered: January 2006
|
Senior Member |
|
|
I'm new to DBA.I'm little bit confused with the concept of SCN & Checkpoint.Can anyone explain me,
1) what is the relationship between SCN & Checkpoint occurrence?Explain with an example.
2) How does SCN value & Checkpoint occurrence help in maintaining sync between Datafiles,Control files & Redo Log files?Explain with an example.
With regards,
Malru.
|
|
|
Re: SCN-Demo [message #157243 is a reply to message #157234] |
Wed, 01 February 2006 04:36 |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
While I can not come up with an example, here is the concepts as I understand, for both SCN and checkpoint:
1) SCN: this is like the internal clock of the database.Every time when you commit the clock advances. At any point in time you have one state of the clock and similarly one state of the database. So scn is a unique number , and it keeps increasing every time you commit.
2) Checkpoint: For a description of what it does see:
http://www.adp-gmbh.ch/ora/concepts/checkpoint.html.
regarding relation betn checkpoint and SCN:
During checkpoint, dbwr is called to write all dirty blocks back to the datafiles, thus synchronizing the database. Since a Checkpoint records the current SCN, in a recovery only redo records with a SCN higher than that of the last checkpoint need to be applied.
How it helps in sync:
When checkpoint ocurrs, all dirty buffers are written to data files..so all your changes are in the datafile and also the current SCN is recorded..(remember that this may also include UNCOMMITED CHANGES,but no problem because SCN is recorded so only transactions till that SCN will be recovered if recovery is done)
so in the event of any disaster you have all the necessary data to get the database to a consistent state.
|
|
|