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;