Oracle SCN growth Interval

Source: Internet
Author: User

View the Oracle database version
· SQL> select * from v $ version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
PL/SQL Release 11.2.0.1.0-Production
CORE11.2.0.1.0Production
TNS for Linux: Version 11.2.0.1.0-Production
NLSRTL Version 11.2.0.1.0-Production

· View the current scn as follows:
· SQL> select dbms_flashback.get_system_change_number from dual

GET_SYSTEM_CHANGE_NUMBER
------------------------
1155901
· SQL> select current_scn from v $ database;

CURRENT_SCN
-----------
1155934

· Use scn_to_timestamp to obtain the correspondence between scn and time as follows:
· SQL> select scn_to_timestamp (& scn) from dual;
Enter value for scn: 1155901
Old1: select scn_to_timestamp (& scn) from dual
New1: select scn_to_timestamp (1155901) from dual

SCN_TO_TIMESTAMP (1155901)
---------------------------------------------------------------------------
05-APR-12 01.20.41.000000000 AM

SQL>/
Enter value for scn: 1155902
Old1: select scn_to_timestamp (& scn) from dual
New1: select scn_to_timestamp (1155902) from dual

SCN_TO_TIMESTAMP (1155902)
---------------------------------------------------------------------------
05-APR-12 01.20.44.000000000 AM

SQL & gt; select scn_to_timestamp (1155901) from dual;

SCN_TO_TIMESTAMP (2608762)
---------------------------------------------------------------------------
05-APR-12 01.20.41.000000000 AM


· Mutual conversion between scn _ to_timestamp and timestamp_to_scn:
SQL> select timestamp_to_scn (to_timestamp ('05-April-12 01.20.41.000000000 am ') from dual;
Select timestamp_to_scn (to_timestamp ('05-April-12 01.20.41.000000000 am ') from
Dual
*
ERROR at line 1:
ORA-01843: not a valid month


· SQL> select timestamp_to_scn (to_timestamp ('05-APR-12 01.20.41.000000000 AM ') from dual;

TIMESTAMP_TO_SCN (TO_TIMESTAMP ('05-APR-12 01.20.41.20.00000 AM '))
---------------------------------------------------------------
1155901

· SQL> select timestamp_to_scn (to_timestamp ('05-04-12 01.20.41.000000000 AM ') from dual;

TIMESTAMP_TO_SCN (TO_TIMESTAMP ('05-04-12 01.20.41.000000000 am '))
---------------------------------------------------------------
1155901

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.