Correct calculation and running of current_scn in Oracle10g

Source: Internet
Author: User

The following articles mainly explain how current_scn in Oracle10g is correctly computed and run. We all know that Oracle10g introduces current_scn in the v $ database view. In fact, this SCN comes from the underlying table, indicates the current SCN.

In Oracle9i, we can use dbms_flashback.get_system_change_number to obtain the SCN of the system.

But note that current_scn is still different. Let's take a look at the next query:

Copy code

 
  1. oracle@danaly ~]$ sqlplus '/ as sysdba'   
  2. SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 21 10:15:08 2007  
  3. Copyright (c) 1982, 2005, Oracle. All rights reserved.  
  4. Connected to:  
  5. Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production  
  6. With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options  
  7. SQL> @scn  
  8. SQL> col current_scn for 99999999999999999  
  9. SQL> select current_scn from v$database;  
  10. CURRENT_SCN  
  11. 8910961765228  
  12. SQL> select dbms_flashback.get_system_change_number current_scn from dual;  
  13. CURRENT_SCN  
  14. 8910961765228  
  15. SQL> select dbms_flashback.get_system_change_number current_scn from dual;  
  16. CURRENT_SCN  
  17. 8910961765228  
  18. SQL> select current_scn from v$database;  
  19. CURRENT_SCN  
  20. 8910961765229  
  21. SQL> select dbms_flashback.get_system_change_number current_scn from dual;  
  22. CURRENT_SCN  
  23. 8910961765229  
  24. SQL> select dbms_flashback.get_system_change_number current_scn from dual;  
  25. CURRENT_SCN  
  26. 8910961765229  
  27. SQL> select current_scn from v$database;  
  28. CURRENT_SCN  
  29. 8910961765230  

We can see that the query of current_scn will directly lead to the improvement of SCN, but not in other ways. That is to say, the current_scn here is like a Sequence, and the query will increase. This is also easy to understand. Only by enhancing the Current SCN can v $ database ensure that the obtained SCN is Current. But what if no query is performed? This value will certainly not grow. The above content is an introduction to the current_scn computing of Oracle10g. I hope you will have some gains.

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.