1、SCN The meaning of ?system change number

     Time
     successively 、 Old and new

select dbms_flashback.get_system_change_number,
SCN_TO_TIMESTAMP(dbms_flashback.get_system_change_number) from dual;
SCN Number , To ensure data consistency ;
2、 common SCN
  2.1 Three of the control files SCN
         System SCN

select checkpoint_change# from v$database;

file SCN

select name,checkpoint_change# from v$datafile;

end SCN

select name,last_change# from v$datafile;

Checkpoint information

 Incremental checkpointing does not update the data file header , And the database in the control file SCN And the entry of the data file SCN Information , It's just that every 3 Second by CKPT Process to update... In the control file low cache rba Information , That's the location of the checkpoint .
  2.2 Data file header
    Start SCN

select name,checkpoint_change# from v$datafile_header;
Data block header ITL Transaction slot ( In the following chapters, I will elaborate on )
journal change vector in
    Running log 、 The flight log
In the rollback segment transaction table ( In the following chapters, I will elaborate on )
  2.3 Log file header
    first、next
-- Check the history log first_change#,next_change#
select recid,sequence#,first_change#,next_change# from v$log_history where rownum<6;
select * from v$log;
select * from v$archived_log;
Under normal circumstances , The system that controls the files SCN file SCN With the header of the data file SCN It should be the same .
 
The database is closed normally ,buffer cache 
Update system SCN, file SCN, End SCN. The header of the data file SCN.
 
Abnormal shutdown , End SCN It's empty , Everything else is the same , Abnormal shutdown requires instance recovery . need redo log, No need to file log.
3、 Instance recovery
     Just need redo log:active、current
     Instance recovery judgment basis : When starting the database , Termination of control file detected SCN If it is empty, you need to do instance recovery
     demonstration SCN change

If an instance crash occurs , Just find the checkpoint location in the log file (low cache rba), Apply all redo log files from here , The roll forward operation is completed . After the instance crashes , Start the database again ,oracle It will be read into the control file low cache rba, This is the checkpoint location . Apply redo logs from here , Applied to the on disk rba The location of .on disk rba Is the last redo record in the redo log file on disk rba.

 
Recover the technical terms involved :
① Running log
    It doesn't matter if you run too much , It won't be applied repeatedly 2 Time , It's just a run away , Don't worry .
② promote SCN, For example, a data file is old , You need to apply archive logs 、 Redo the log to make it SCN Up to the system SCN Agreement .
Every log entry has SCN.
Each log file The head has two SCN,first and next SCN.

In the control file 3 individual SCN:

The header of the data file SCN:

4、fast_start_mttr_target

fast_start_mttr_target Parameters ,
The default is 0, Express oracle Automatic adjustment
The unit is seconds .
If it is 20 second , When the instance is restored , Need to roll forward logs ,oracle I'll try to keep it under control 20 Within seconds . Will increase DBWn The frequency of writing .
If the time is too short ,DBWn Write too often ,I/O It's going to be busy , Something could go wrong .

Xiang Kejun _Oracle system _ Lecture notes 010-SCN More articles about

  1. Xiang Kejun _Oracle system _ Lecture notes 002- Basics

    1. common Oracle Production library environment : chart 2-1 It's a standard production library environment , Redundancy is everywhere , Effectively prevent a single point of failure . This is it. HA( High availability ) And redundancy can be removed under certain conditions , Usually the implementation runs at the same time to provide services , If one breaks down , another ...

  2. Xiang Kejun _Oracle system _ Lecture notes 001- summary

    One .Oracle Official support 1. Official documents online http://docs.oracle.com/ 2.metalink.oracle.com, Now it's changed to :http://support.oracle.com ...

  3. Xiang Kejun _Oracle system _ Lecture notes 003- System Overview

    1. Process structure diagram Yes Oracle In terms of production base , Server process ( It can be simply understood as the foreground process ) It's a lot more than the background process . Because a user process corresponds to a server process . And the background process is not likely to go wrong , So the focus of learning is also the server process ...

  4. Xiang Kejun _Oracle system _ Lecture notes 004-shared pool

    This chapter focuses on SGA Medium shared pool. Shared pool { 1.free 2.library cache( cache sql Statement and its execution plan ) 3.row cache( Data dictionary cache ) }   ...

  5. Xiang Kejun _Oracle system _ Lecture notes 005-Database buffer cache

    This chapter focuses on SGA Medium Database buffer cache. Buffer cache { 1.pin ( The state of the moment of reading and writing ) 2.clean 3.dirty 4.unused } --Databa ...

  6. Xiang Kejun _Oracle system _ Lecture notes 006- Log principle

    Simply speaking , Study Oracle The database has two goals : Ensure the consistency of database data : Improve database performance ( This has nothing to do with the journal ).   Log function :      Just to ensure the consistency of the database data :   1.Oracle Log principle    ...

  7. Xiang Kejun _Oracle system _ Lecture notes 007-PGA

    In practice ,Oracle Two of them are important :Server Process and PGA.   PGA The function and composition of memory   1.PGA effect 2.PGA constitute 1)private SQL area   2)Sess ...

  8. Xiang Kejun _Oracle system _ Lecture notes 008- Storage structure

    Control documents . Data files . Log files     Put it on storage .   Parameter file : Read at database startup , It's not closed , But it's OK to lose it after it starts up . It's usually on the server . $ORACLE_HOME/dbs Next   Backup file {     control ...

  9. Xiang Kejun _Oracle system _ Lecture notes 009- Checkpoint queue

    1. Checkpoint queue checkpoint queue RBA Log block address redo block address LRBA The first dirty address HRBA Last dirty address on disk rba Redo log ( ...

Random recommendation

  1. JavaScript Realization TwoQueues Caching model

    This article refers to TwoQueues Caching model , It's a cache model of data in memory . Whatever the language , May need to put part of the data in memory , Avoid repetition . Read . The most common scenario is JQuery Selectors , There are some Dom The selection of elements is very time-consuming ...

  2. iOS Use Block Carry out reverse value transmission

    Like notification, it's two controllers , Then the code is created and the control is directly loaded with the code #import "ViewController.h" #import "TwoViewController.h&qu ...

  3. IIS7 Enable GZip Compress

    GZip Compression usually reaches 70% The compression ratio above , If it's a cell phone Web This will undoubtedly increase the speed of website access , Whether it's CSS Merge .JS Merge . Image merging is not as good as GZip Compression is simple and straightforward . If a web page is 100K, Then enable GZip ...

  4. $_POST Variables and $GLOBALS[&#39;HTTP_RAW_POST_DATA&#39;]

    $_POST Variable is an array , The content is made up of HTTP POST Method to send the variable name and value . $_POST Variables are used to collect data from method="post" Values in the form . From with POST Fang ...

  5. android Screen sharing between devices

    Recently, the company is developing a android Your device projects the screen onto your phone . At the same time, mobile phones can also touch . Keyboard operation . such . The purpose of screen sharing is achieved . Think about it . Main idea : 1. Use... To get the bitmap from the screenshot ffmpeg Encoded into a video stream . ...

  6. java Interview String The understanding of the ( Self understanding )

    1.String Is it a basic data type ? No , It's the object , Reference data type 2.String Is it changeable ? immutable ,String yes final Type of . 3. How to compare two strings with the same value , How to compare whether two strings are the same object ? ...

  7. EMIF Interface and FPGA Internet of ( turn )

    reference: https://blog.csdn.net/ruby97/article/details/7539151 DSP6455 Of EMIFA modular As I mentioned earlier DSP6455 Of GPIO And interrupt ...

  8. Z Font conversion

    The string  "PAYPALISHIRING"  With Z The glyphs are arranged in a given number of lines : P A H N A P L S I I G Y I R Then from left to right , Read characters line by line :"PAHN ...

  9. erlang Development environment configuration

    First step   Install from source erlang git clone https://github.com/erlang/otp The latest version is 17.X cd otp/ ./configer   Check the compilation environment sudo ...

  10. open usb Debugging method

    Method 1 : settings --> about tablet --> build number( Crazy Click )  --> Back off developer options --> USB d ...