This discussion is archived
4 Replies Latest reply: Nov 18, 2012 4:54 AM by Aman.... RSS

SCN & Checkpoint

asif.maqbool Newbie
Currently Being Moderated
Hi,

Is there any difference between System change number (SCN) and checkpoint or both are same?

I'm using Oracle8i.

Thanks.
Asif
  • 1. Re: SCN & Checkpoint
    rp0428 Guru
    Currently Being Moderated
    >
    Is there any difference between System change number (SCN) and checkpoint or both are same?
    >
    First - you should upgrade to 11g. Version 8i is an ancient non-supported version of Oracle DB.

    SCN and checkpoints are two completely separate things. A system change number is a tag that identifies the point in time; such as when a commit happens. A checkpoint is a background process that writes dirty buffers to disk and is also the process of updating the control file and data headers. A checkpoint INCLUDES an SCN.

    See the Database Concepts doc
    http://docs.oracle.com/cd/E14072_01/server.112/e10713/process.htm
    >
    LGWR and Commits

    Oracle Database uses a fast commit mechanism to improve performance for committed transactions. When a user issues a COMMIT statement, the transaction is assigned a system change number (SCN). LGWR puts a commit record in the redo log buffer and writes it to disk immediately, along with the commit SCN and transaction's redo entries.
    . . .
    Checkpoint Process (CKPT)

    The checkpoint process (CKPT) updates the control file and data file headers with checkpoint information and signals DBWn to write blocks to disk. Checkpoint information includes the checkpoint position, SCN, location in online redo log to begin recovery, and so on. As shown in Figure 15-4, CKPT does not write data blocks to data files or redo blocks to online redo log files.
    >
    See also the Overview of Checkpoints section in that doc.
  • 2. Re: SCN & Checkpoint
    sb92075 Guru
    Currently Being Moderated
    asif.maqbool wrote:
    Hi,

    Is there any difference between System change number (SCN) and checkpoint or both are same?

    I'm using Oracle8i.

    Thanks.
    Asif
    unwilling or incapable to Read The Fine Manual yourself?

    http://www.oracle.com/pls/db112/to_toc?pathname=server.112/e25789/toc.htm
  • 3. Re: SCN & Checkpoint
    Girish Sharma Guru
    Currently Being Moderated
    SCN

    System Change Number. A database ordering primitive. The value of an SCN is the logical point in time at which changes are made to a database.
    http://docs.oracle.com/cd/E11882_01/server.112/e25789/glossary.htm#CNCPT44569

    checkpoint

    1. A data structure that marks the checkpoint position, which is the SCN in the redo thread where instance recovery must begin. Checkpoints are recorded in the control file and each data file header, and are a crucial element of recovery.

    2. The writing of dirty data blocks in the database buffer cache to disk. The database writer (DBWn) process writes blocks to disk to synchronize the buffer cache with the data files.
    http://docs.oracle.com/cd/E11882_01/server.112/e25789/glossary.htm#CNCPT2013

    And below links may also be of your interest :
    http://vinaycustomizepc.blogspot.in/2012/07/difference-between-scn-and-checkpoint.html
    A good PDF on checkpoint concept :
    http://prutser.files.wordpress.com/2008/12/checkpointsukoug.pdf
    One of good discussion :
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::NO::P11_QUESTION_ID:48052838748707

    Regards
    Girish Sharma
  • 4. Re: SCN & Checkpoint
    Aman.... Oracle ACE
    Currently Being Moderated
    asif.maqbool wrote:
    Hi,

    Is there any difference between System change number (SCN) and checkpoint or both are same?

    I'm using Oracle8i.
    With the same suggestion that Rp has given to upgrade to a more recent version, I would say that both, Checkpoint and SCN are same in the context that both are markers but not of the same type. SCN is a marker of the timestamp when the dirty data in the redo stream is marked for being committed. This is going to be incremented (Commit SCN) at the time of the commit. Checkpoint is also a marker but its going to be increasing continuously all the time representing that in the case of the next crash , from where the recovery has to start. Read the doc links and the presentation from Harald and if there are any more doubts, we shall try to clear them up. Also do a search in this forum for the same topic as it has been discussed many of the times already.

    Aman....

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points