Professional Documents
Culture Documents
Ray Smith: Oracle Flashback Technologies COUG Presentation - Feb 2010
Ray Smith: Oracle Flashback Technologies COUG Presentation - Feb 2010
Ray Smith
raymond.smith@cgi.com
1
Agenda:
2
Flashback technologies
Flashback Query
Flashback Table
Flashback Drop
Flashback Versions Query
Flashback Transaction Query
Flashback Database
Flashback Data Archive
3
Flashback technologies
Flashback Query
SQL> exec dbms_flashback package.. 9i R1.
Scary code:
DECLARE
CURSOR emp_cur IS
SELECT * FROM EMPLOYEE;
v_rec emp_cur%rowtype;
BEGIN
DBMS_FLASHBACK.ENABLE_AT_TIME ('25-FEB-10 08:10:58');
open emp_cur;
DBMS_FLASHBACK.DISABLE;
LOOP
fetch emp_cur into v_rec;
EXIT WHEN emp_cur%NOTFOUND;
INSERT INTO EMPLOYEE_TEMP VALUES
(v_rec.emp_id, v_rec.name, v_rec.age );
END LOOP;
close emp_cur;
COMMIT;
END;
4
Flashback technologies
Flashback Table
SQL> flashback table to timestamp
SQL> flashback table to SCN
Flashback Drop
Use of Recyclebin
flashback table to before drop;
5
Flashback technologies
6
Flashback technologies
7
Flashback technologies
8
Flashback technologies
9
Why are DBAs avoiding using Flashback
options?
10
Why DBAs should get to know it
11
How do you configure Flashback?
It Depends..
Flashback Query no setup required Just undo
Flashback Table no setup required Just undo
Flashback Drop Recyclebin on by default.
Flashback Versions - no setup required Just undo
Flashback Database Requires a flash recovery area / feature
to be switched on.
Flashback Transaction may require supplimental data
Flashback Data Archives needs flashback tablespace
12
How to Flashback Database?
13
Live Demo
14
Summary
15