The SCN and checkpoint mechanism of Oracle

Source: Internet
Author: User

The SCN and checkpoint mechanism of Oracle

The SCN appears in several forms on Oracle's documentation, one for system change number and one for system Commit, and in most cases, the definition of Systems change numbers is more accurate.

The SCN (System change number) is what is commonly referred to as an alteration, a very important data structure in the database that identifies the version that the database commits at some exact moment. When a transaction commits, it is given a unique SCN that identifies the transaction. The SCN is also used as the internal clock mechanism of the Oracle database, and can be seen as a logical clock, with each database having a global SCN generator.

As a logical clock inside the database, database transactions are sorted by SCN, and Oracle also implements important database functions such as consistent read (read consistency) based on the SCN, and for distributed transactions (distributed transactions), The SCN is also extremely important. The SCN is unique in the database and increases over time, but may not be consistent. The value of the SCN will never be reset to 0 unless the database is rebuilt.
There has been a lot of controversy over SCN, and many people think that SCN refers to system commit number, and usually the SCN changes when committed, so many times these two nouns are often repeated in the document. Even in Oracle's official documentation, the SCN often appears in the system change/commit number two form.
Which word is actually not the most important, it is important to know that the SCN is the clock mechanism within Oracle, Oracle maintains database consistency through the SCN, and implements Oracle's critical recovery mechanism through the SCN.

SCN is ubiquitous in the database, and the common transaction table, control file, data file header, log file, data block, etc. are recorded with SCN values. With different prefixes, the SCN also has a different name, such as the checkpoint SCN (Checkpoint SCN), Resetlogs SCN, and so on. The SCN consists of two parts, the high-level SCN wrap is recorded by 2 bytes, and the low SCN base is recorded by 4 bytes, as shown in 2-1.

There are several ways to get the current or approximate SCN for a database.

Select Current_scn from V$database;

The SCN and checkpoint mechanism of Oracle

Related Article

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.