About Checkpoint CNT and Checkpoint SCN
The relationship between CheckPoint CNT and Checkpoint SCN is illustrated by experiments.
1. Dump control files under different conditions
SQL> Alter Session Set Events 'Immediate Trace Name Controlf Level 10'
Session altered.
SQL> ALTER TABLESPACE SYSTEM Begin BACKUP
TableSpace altered.
SQL> Alter Session Set Events 'Immediate Trace Name Controlf Level 10'
Session altered.
SQL> ALTER System Checkpoint;
SYSTEM altered.
SQL> ALTER Session Set Events' Immediate Trace Name Controlf Level 10'2 /
Session altered.
SQL> ALTER TABLESPACE SYSTEM END BACKUP;
TableSpace altered.
SQL> Alter Session Set Events 'Immediate Trace Name Controlf Level 10'
Session altered.
NOTES:
Alter Session Set Events 'Immediate Trace Name Controlf Level 10'
Used to dump control files.
?
2. Get the following tracking file information (only the SYSTEM tablespace record, please pay attention to the red part):
a. Under normal circumstances, dump control files
*********************************************************** **********************************************************************************************************************************TION *********************************************************** *** (BLKNO = 0x6, size = 180, max = 100, in-use = 24, last-recid = 574) Data file # 1: (Name # 4) /opt/oracle/roadata/hsjf/system01.dbfcreation size = 32000 block size = 8192 status = 0xe head = 4 tail = 4 dup = 1tablespace 0, index = 1 krfil = 1 prev_file = 0unrecoverable scn: 0x0000.00000000 04/23/2004 01: 20: 52Checkpoint cnt: 1567 scn: 0x0000.0148181C 06/22/2004 18: 58: 46Stop SCN: 0xffff.fffffffff 06/22/2004 18: 58: 05CREATION CHECKPOINTED AT SCN: 0x0000.000000AE 07/16/2003 03: 40: 10Thread: 1 RBA :( 0x1.3.10) enabled threads: 01000000 00000000 00000000 00000000 00000000 0000000000000000 00000000Offline scn: 0x0000.013b46fd prev_range: 0Online Checkpointed at scn: 0x0000.013b46fe 05/28/2004 23: 37: 17thread: 1 rba: (0x1.2.0) enabled threads : 01000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_File IS not definedb. After executing Begin Backup
We noticed that CheckPoint CNT added 1, which triggered a tablespace checkpoint.
*********************************************************** **********************************************************************************************************************************TION *********************************************************** *** (BLKNO = 0x6, size = 180, max = 100, in-use = 24, last-recid = 574) Data file # 1: (Name # 4) /opt/oracle/roadata/hsjf/system01.dbfcreation size = 32000 block size = 8192 status = 0xe head = 4 tail = 4 dup = 1tablespace 0, index = 1 krfil = 1 prev_file = 0unrecoverable scn: 0x0000.00000000 04/23/2004 01: 20: 52Checkpoint cnt: 1568 scn: 0x0000.01481939 06/22/2004 19: 02: 22Stop SCN: 0XFFFFFFFFFFF 06/22/2004 18: 58: 05CREATION CHECKPOINTED AT SCN: 0X0000.000000AE 07/16/2003 03: 40: 10Thread: 1 RBA :( 0x1.3.10) enabled threads: 01000000 00000000 00000000 00000000 00000000 0000000000000000 00000000Offline scn: 0x0000.013b46fd prev_range: 0Online Checkpointed at scn: 0x0000.013b46fe 05/28/2004 23: 37: 17thread: 1 rba: (0x1.2.0) enabled threads : 01000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_File IS not definedc. Perform a manual checkpoint
We noticed that at this time, checkpoint CNT increases, but SCN no longer change
*********************************************************** **********************************************************************************************************************************TION *********************************************************** *** (BLKNO = 0x6, size = 180, max = 100, in-use = 24, last-recid = 574) Data file # 1: (Name # 4) /opt/oracle/roadata/hsjf/system01.dbfcreation size = 32000 block size = 8192 status = 0xe head = 4 tail = 4 dup = 1tablespace 0, index = 1 krfil = 1 prev_file = 0unrecoverable scn: 0x0000.00000000 04/23/2004 01: 20: 52Checkpoint cnt: 1569 scn: 0x0000.01481939 06/22/2004 19: 02: 22Stop SCN: 0XFFFFFFFFFFF 06/22/2004 18: 58: 05CREATION CHECKPOINTED AT SCN: 0X0000.000000AE 07/16/2003 03: 40: 10Thread: 1 RBA :( 0x1.3.10) enabled threads: 01000000 00000000 00000000 00000000 00000000 0000000000000000 00000000Offline scn: 0x0000.013b46fd prev_range: 0Online Checkpointed at scn: 0x0000.013b46fe 05/28/2004 23: 37: 17thread: 1 rba: (0x1.2.0) enabled threads : 01000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_File Is Not Defeed?
Situation after D.End Backup
At this time, the frozen of the data file header is canceled, the SCN starts to change
*********************************************************** **********************************************************************************************************************************TION *********************************************************** *** (BLKNO = 0x6, size = 180, max = 100, in-use = 24, last-recid = 574) Data file # 1: (Name # 4) /opt/oracle/roadata/hsjf/system01.dbfcreation size = 32000 block size = 8192 status = 0xe head = 4 tail = 4 dup = 1tablespace 0, index = 1 krfil = 1 prev_file = 0unrecoverable scn: 0x0000.00000000 04/23/2004 01: 20: 52Checkpoint cnt: 1570 scn: 0x0000.01481941 06/22/2004 19: 02: 39Stop SCN: 0xFFFFFFFFFFF 06/22/2004 18: 58: 05Creation Checkpointed AT SCN: 0x0000.000000AE 07/16/2003 03: 40: 10Thread: 1 RBA :( 0x1.3.10) enabled threads: 01000000 00000000 00000000 00000000 00000000 0000000000000000 00000000Offline scn: 0x0000.013b46fd prev_range: 0Online Checkpointed at scn: 0x0000.013b46fe 05/28/2004 23: 37: 17thread: 1 rba: (0x1.2.0) enabled threads : 01000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_File Is Not DefinedCheckPoint CNT is used to ensure that data files used in normal operations are an error version of the current version preventing recovery data files when recovery. CHECKPOINT CNT is increasing, even if the table space is in the hot backup mode.
Since the creation time of the table space is not the same, the CheckPoint CNT of different tablespace / data files is usually different.
we know:
During the database Open, Oracle is going to check twice.
The CheckPoint CNT in the data file header is consistent with the CheckPoint CNT in the corresponding control file. If equally, the second check is performed.
The second check The beginning SCN of the data file header and the end SCN in the corresponding control file may match if the SCN is equal to the start SCN, the file is not required to recover the file.
After each data file is completed, open the database. At the same time, the end SCN of each data file is set to infinity.
?
If You Have Any Question, please mail to eye@itpub.net.