Oracle versions usage

Source: Internet
Author: User

Oca SQL questions
Evaluate the following statements:

 Create   Table  Digits (ID  Number ( 2  ), Description  Varchar2 ( 15  ));  Insert   Into Digits Values ( 1 ,'  One  '  );  Update Digits Set Description =  '  Two  '   Where ID =  1  ;  Insert   Into DigitsValues ( 2 , '  Two  '  );  Commit  ;  Delete   From  Digits;  Select Description From  Digits versions  Between   Timestamp Minvalue And Maxvalue;

What wocould be the outcome of the above query?

A. It wocould not display any values.
B. It wocould display the value two once.
C. It wocould display
The value two twice.
D. It wocould display the values one, two, and two.

In oracle9IDatabase, we can see that it is launched with a flash backQueryTime machine ". TheFeaturesAllows the DBA to view the column value at a specific time. You only need to provide a copy of the previous image of the data block in the restoration section. However, the flashback query only provides a fixed snapshot of the data at a specific time point, instead of the running state of the data changed between two time points. SomeApplicationProgramIf foreign currency is involvedManagementThe application may need to understand the changes in the numerical data over a period of time, not just the values at two time points. Oracle Database 10GThis task can be executed more conveniently and efficiently.
Usage:

Versions between timestamp [lower bound] and [upper bound]

Versions between SCN [lower bound] and [upper bound]

Lower Bound/Upper Bound can be a specific timestamp/SCN, or the keyword minvalue/maxvalue. these keywords allow Oracle to find all versions. Of course, this is subject to the size set by the undo_retention parameter. After all, this part of information is placed on the Undo segment.

Oracle 10 Gb provides some pseudo-columns to help us analyze the data of each version,

Versions_starttime (start Timestamp   Of  Version); versions_startscn (start SCN  Of  Version); versions_endtime (  End   Timestamp   Of  Version); versions_endscn (  End SCN Of  Version); versions_xid (  Transaction IDOf  Version); versions_operation (DML operation  Of  Version );  Select  Description, versions_starttime, versions_endtime, versions_xid, versions_operation  From  Digitsversions  Between   Timestamp Minvalue And Maxvalue;
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.