Oracle SCN Introduction

SCN No.

    Duration of action: Comparison has, the collating sequence

    Order to compare the use of digital systems

    Oracle Database there are many places need to use the time, mainly used to confirm the chronological order, these places are SCN number to identify

 

    1, redo log records the number scn

    2, redo log file header will open two scn numbers

        first change#、next change#

        The first redo log file corresponding to the log number scn

        Next log file corresponding to the first redo log number scn

        For corrent redo log (currently being used redo log files), next change # is null (infinity)

    3, the data file header records the SCN No.

    4, the control records the file numbers of all data files SCN

        About SCN number control file for each data file has two

            File No. SCN, SCN termination No.

            No. SCN SCN number is terminated when the file is closed

            Termination SCN number is used to determine whether the data file is closed properly, if it is null, we need to be restored

    5, SCN number system

        The current system represents the latest time of SCN

    6, the data block number SCN head has, on behalf of the database recency

    7, when the order is submitted, there will SCN number, store transaction submitted

 

SCN

    1, each database SCN numbers are not comparable, can only compare their own internal

    2, SCN number only increment

    3, SCN designed to use 500 years

    When 4, when the database access between each other, especially to form a network structure, can easily lead to SCN English bug blooms, reach the roof

    5, can only rebuild the database

    6, SCN number is mainly used to compare the old and new, there is no need to update in real time

 

In both cases the system change SCN

    1, redo log switch

    2, a large number of dirty pages written back when

 

View SCN number system

 

select *from v$database;

SCN number to view the data file header

 

select CHECKPOINT_CHANGE# from v$datafile_header;

Check redo log files SCN No.

 

select FIRST_CHANGE#,NEXT_CHANGE#  from v$log;

Check the control file record SCN number

 

select last_change#,checkpoint_change# from datafiles;

 



 
 

Released four original articles · won praise 0 · Views 7

Guess you like

Origin blog.csdn.net/wysdhr/article/details/104927530