What is flashback Query? Explain its uses - oracle

What is flashback Query? Explain its uses with an example

Oracle Flashback Query allows users to see a consistent view of the database as it was at a point in the past.

Turning on flashback query:-
EXECUTE Dbms_Flashback.Enable_At_System_Change_Number(123);
EXECUTE Dbms_Flashback.Enable_At_Time('28-AUG-01 11:00:00');
Turning off flashback query:

EXECUTE Dbms_Flashback.Disable;

DECLARE
CURSOR c_emp IS
SELECT *
FROM employees;
v_row c_emp%ROWTYPE;.
BEGIN
Dbms_Flashback.Enable_At_Time('28-AUG-01 09:00:00');
OPEN c_emp;
Dbms_Flashback.Disable;

LOOP
FETCH c_emp INTO v_row;
EXIT WHEN c_emp%NOTFOUND;
INSERT INTO employees VALUES
(v_row.employee_id, v_row.first_name,
v_row.last_name, v_row.email,
v_row.phone_number, v_row.hire_date,
v_row.job_id, v_row.salary,
v_row.commission_pct, v_row.manager_id,
v_row.department_id, v_row.dn);
END LOOP;
CLOSE c_emp;
COMMIT;
END;
Tablespace purposes and significances - oracle
Tablespace purposes and significances - A tablespace is a logical container unit within an Oracle database. It does not exist physically on a filesystem...
Sequence and sequence cache - oracle
Sequence and sequence cache - Seqences are often used to generate autonumber fields. A sequence is an object in Oracle used to create a number sequence...
Difference between formula column and place holder - oracle
Formula column and place holder - Difference between formula column and place holder...
Post your comment