Database Reference
In-Depth Information
176 01-JAN-07 31-DEC-07 SA_MAN 80
200 01-JUL-02 31-DEC-06 AC_ACCOUNT 90
10 rows selected.
Now, let's simulate a user accidentally dropping a row:
SQL> delete from job_history where employee_id = 102;
1 row deleted.
SQL> commit;
Commit complete.
You can see that the row has indeed been deleted:
SQL> select * from job_history;
EMPLOYEE_ID START_DAT END_DATE JOB_ID DEPARTMENT_ID
----------- --------- --------- ---------- -------------
101 21-SEP-97 27-OCT-01 AC_ACCOUNT 110
101 28-OCT-01 15-MAR-05 AC_MGR 110
201 17-FEB-04 19-DEC-07 MK_REP 20
114 24-MAR-06 31-DEC-07 ST_CLERK 50
122 01-JAN-07 31-DEC-07 ST_CLERK 50
200 17-SEP-95 17-JUN-01 AD_ASST 90
176 24-MAR-06 31-DEC-06 SA_REP 80
176 01-JAN-07 31-DEC-07 SA_MAN 80
200 01-JUL-02 31-DEC-06 AC_ACCOUNT 90
9 rows selected.
Now, we can use Flashback Query to view the data that existed prior to the delete, as
shown here:
SQL> select *
2 from job_history as of timestamp(
3 to_timestamp('23-AUG-2013 11:50:00','DD-MON-YYYY HH24:MI:SS'))
4 where employee_id = 102;
EMPLOYEE_ID START_DAT END_DATE JOB_ID DEPARTMENT_ID
----------- --------- --------- ---------- -------------
102 13-JAN-01 24-JUL-06 IT_PROG 60
Search WWH ::




Custom Search