Mutual conversion between the ORACLE database SCN and time, and the oracle database scn

Source: Internet
Author: User

Mutual conversion between the ORACLE database SCN and time, and the oracle database scn

SCN (System Change Number (SCN) isOracleDatabaseAfter the update, the DBMS automatically maintains a progressively increasing number, which can be understood as the timestamp of the ORACLE database. Starting from ORACLE 10 Gb, the function can be used to convert the SCN and time;

   Purpose:It is necessary to convert the SCN and time to restore the database and use the database's flash back function; Operation Method:1. Obtain the current SCN value through flock: SQL> select dbms_flashback.get_system_change_number scn from dual; SCN ----------------- 122037263 2. You can use the scn_to_timestamp function to convert SCN to a timestamp: SQL> select scn_to_timestamp (122037263) scn from dual; SCN listen 14-7 month-14 04.45.36.000000000 afternoon 3. You can also use timestamp_to_scn to convert the timestamp to SCN: SQL> select timestamp_to_scn (to_date ('1970-07-13,13: 25: 59', 'yyyy-mm-dd, hh24: mi: ss') scn from dual; SCN ---------------------
Does the oracle scn keep increasing? What event will trigger the change of this value?

In theory, this can be said. In fact, the scn is not a unique value. Only the scn value of redolog increases progressively in the + 1 mode. Others are the converted values in the timestamp mode. There are many events that trigger scn changes. It is well understood from the scn name: system change number. If there are changes, there will be scn.

Why Does oracle generate the system change number scn?

1. The occurrence of DML statements will lead to the increase of SCN (you will also increase if you don't COMMIT)
2. The internal SCN is automatically increased every 3 seconds by default, regardless of whether the database is operated.
3. the SCN is added when a checkpoint occurs.

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.