1. Checkpoint Queues checkpoint queueRBA Log block address redo block Addresslrba The first dirty address Hrba the last dirty address on disk RBA redo log (current redo log) has two addresses in the address data block of the final log, Lrba,hrba. The checkpoint queue is chained in the first dirty time of the dirty block. The checkpoint queue is linked by the Lrba address of the data block.2. CKPT process
Trigger once every 3 seconds
Record checkpoint Information
Trigger DBWR Process Full checkpoint: All dirty blocks are triggered to be written to disk. A full checkpoint will only occur when the normal shutdown occurs. A full checkpoint does not occur during normal operation. Incremental checkpoint: Ckpt logs the (LRBA) log address of the first dirty block of the checkpoint queue to the control file. An incremental checkpoint occurs every 3 seconds. When an incremental checkpoint occurs, Ckpt logs the first block of the checkpoint queue to the control file with the earliest dirty, corresponding log address. When an incremental checkpoint occurs, it is found that the checkpoint queue is too long and I/O is not too busy, triggering dbwn, partially written to disk, to shorten the length of the checkpoint queue. Dbwn write, according to Lruw write checkpoint queue very long time, will also be appropriate to trigger DBWN write. On disk RBA3, the incremental checkpoint does not update the data file header, and control the database SCN in the file and data file entry SCN information, but only every 3 seconds by the CKPT process to update the control file of the low cache RBA information, that is, the location of the checkpoint.
Select Cpdrt,cplrba_seq| | '. ' | | cplrba_bno| | '. ' | | Cplrba_bof "Lowrba", cpodr_seq| | '. ' | | cpodr_bno| | '. ' | | Cpodr_bof "on disk RBA", CPODS,CPODT,CPHBT from X$KCCCP;
The CPDRT column is the number of dirty blocks in the checkpoint queue.
The Cpods column is the SCN for on disk RBA
Cpodt column is the timestamp of on disk RBA
CPHBT is the heartbeat.
If an instance crash occurs, you only need to find the checkpoint location (low cache RBA) in the log file, and the roll-forward operation begins when all the redo log files are applied from here. After the instance crashes, start the database again, and Oracle reads the low cache RBA into the control file, which is the checkpoint location. From here, the redo log is applied to the location of the on disk RBA. On disk RBA is the RBA of the last redo record of the redo log file in the disc.
Related actions:
Select checkpoint_change# from v$database;alter system checkpoint;alter system switch Logfile;select name,checkpoint_ change# from V$datafile, select name,checkpoint_change# from V$datafile_header;select * from V$log;
CREATE TABLE t2 (id int, name VARCHAR2 (50));
Beginfor i in 1..10000 loopinsert to T2 values (1, ' xkj '); Commit;end loop;end;
select * from T2;
alter system flush Buffer_cache;
----------------------------------------------------instance Crash recovery rationale analysis: Checkpoint queue meaning: Find the starting point of the run log and speed up Oracle startup after the instance crashes. Before Oracle 8, there was no checkpoint queue to determine the starting point of the log, and to run a lot of logs, the boot speed was slow.