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.