oracle scn review

SCN (system change number) system change number

RBA (redo block address) onlin redo log block address redo

SCN current system; select dbms_flashback.get_system_change_number from dual

SCN update triggered by a commit is carried out every 3 seconds the system will also refresh the SCN

CKPT process is when it happened in the current database checkpoint SCN update the database file header and control files which, DBWn process in the buffer cache of dirty data block (dirty block) is written to the data file, but ckpt update the control file and after the relevant data file header information, notification DBWn process, generating a checkpoint, when produced checkpoint, dirty data (current online redo log corresponding dirty data) DBWn process in the buffer cache will write our among the data file, is such a basic cycle, ckpt process will be recorded in the control file which RBA, this address is used to mark instance recovery time need to start from the log of that position, that is, a checkpoint corresponds to a rba, when instance recovery (instance recovery) when the oracle will know from the start that the checkpoint at the beginning of the rba redo media recovery!

  创建检查点(checkpoint)的条件:

                1.alter system checkpoint

   2.alter system switch logfile

   3.DBWn process to write dirty blocks

Check the control file scn: After performing checkpoint, (stored in the control file) Oracle will update the System checkpoint SCN current control file

select checkpoint_change# from v$database;

See scn control file recorded in the data file information stored in the control file :() control file information and records the location of each Oracle database files, which of course includes the Datafile checkpoint SCN, so in the implementation of the checkpoint, Oracle will be to update the datafile checkpoint SCN of each data file recorded in the control file

select checkpoint_change# from v$datafile;

View start scn data file header :( data stored in the file header) when performing checkpoint, Oracle will update stored in the Start SCN each actual data file header (note certainly not in the control file), the presence of SCN the purpose is to check whether the database needs to be done to start the process of media recovery (media recovery)

select checkpoint_change# from v$datafile_header;

See end scn control file stored in the data file :( control file) recorded data for each file has a corresponding header End SCN, the End SCN control file must be present in them. The SCN exist in an absolute sense is primarily used to verify that the database needs to be done to start the process instance recovery (Instance recovery).

select name,last_change# from v$datafile

The relationship between SCN and recovery, refer to:

https://blog.csdn.net/dba_waterbin/article/details/7758641

Guess you like

Origin blog.51cto.com/2012ivan/2443535