Basic concepts of Oracle scn

Source: Internet
Author: User

I. Functions of scn

The role of Scn is to ensure Database Consistency. It is the internal clock mechanism of Oracle. Scn is an important mechanism for oracle recovery.

Scn is everywhere in databases. Generally, the scn value is recorded in control files, data file headers, log files, and data files.

System scn is obtained from the view v $ database, corresponding to the checkpoint_change # field;

Datafile scn and last scn (stop scn) correspond to checkpoint_change #, last_change #,

Start scn is obtained from checkpoint_change # In v $ datafile_header.

 

Ii. view the current scn

 

There are three SCN types in the control: system SCN, datafile SCN, and last SCN (stop scn ),

 

System scn

SQL> select checkpoint_change # from v $ database;

 

CHECKPOINT_CHANGE #

------------------

451490

 

Datafile scn

SQL> select name, checkpoint_change # from v $ datafile;

 

NAME

--------------------------------------------------------------------------------

CHECKPOINT_CHANGE #

------------------

/Opt/app/oracle/oradata/wolf/system01.dbf

451490

 

/Opt/app/oracle/oradata/wolf/undotbs01.dbf

451490

 

/Opt/app/oracle/oradata/wolf/sysaux01.dbf

451490

 

 

NAME

--------------------------------------------------------------------------------

CHECKPOINT_CHANGE #

------------------

/Opt/app/oracle/oradata/wolf/users01.dbf

451490

 

Last scn (stop scn, stop scn infinity when started normally, last_change # It must be NULL)

SQL> select name, last_change # from v $ datafile;

 

NAME

--------------------------------------------------------------------------------

LAST_CHANGE #

------------

/Opt/app/oracle/oradata/wolf/system01.dbf

 

 

/Opt/app/oracle/oradata/wolf/undotbs01.dbf

 

 

/Opt/app/oracle/oradata/wolf/sysaux01.dbf

 

 

 

NAME

--------------------------------------------------------------------------------

LAST_CHANGE #

------------

/Opt/app/oracle/oradata/wolf/users01.dbf

 

The data file header contains an SCN: start SCN.

SQL> select name, checkpoint_change # from v $ datafile_header;

 

NAME

--------------------------------------------------------------------------------

CHECKPOINT_CHANGE #

------------------

/Opt/app/oracle/oradata/wolf/system01.dbf

451490

 

/Opt/app/oracle/oradata/wolf/undotbs01.dbf

451490

 

/Opt/app/oracle/oradata/wolf/sysaux01.dbf

451490

 

 

NAME

--------------------------------------------------------------------------------

CHECKPOINT_CHANGE #

------------------

/Opt/app/oracle/oradata/wolf/users01.dbf

451490

  • 1
  • 2
  • 3
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.