Published by : Obay Salah , November 19, 2024

 Sometimes, as a database administrator, you may need to monitor some modifications to the fields. You need to know the values ​​that a specific field took for specific historical periods. For example, employees’ salaries may change every period, so the Salary field is modified every time period. But let’s assume that I need to know the history or previous values ​​of the salary for a specific employee since he was appointed. All that It is available to me in the table now is the last salary value.

This type was introduced in Oracle 10g and is based mainly on the Undo Tablespace, so that it brings the information it wants from the Undo Segments after we specify the specific time period

or via System Change Number (SCN).

SELECT SALARY,VERSIONS_XID AS XID,VERSIONS_STARTSCN,VERSIONS_ENDSCN,VERSIONS_O PERATION FROM SALARY VERSIONS BETWEEN SCN MINVALUE AND MAXVALUE WHERE EMP_NO=1;

In the previous example, we displayed the information using the SCN, but we can also use the Timestamp.

Note: Uncommitted values ​​are not displayed, so the Flashback Versions process will fail if the required information is not found in the Undo Tablespace. Flashback Versions cannot be done for External Tables, Temporary Tables, or Views.

Tags : Database

You May Also Like

Comments

no comment yet!