Flashback

See How to recycle bin too
See Oracle Database Administrator's Guide 10g Release 1 (10.1).
depends on UNDO_RETENTION parameter
select * from V$FLASH_RECOVERY_AREA_USAGE;
 
Drop example

CREATE TABLE dept
(deptno NUMBER(3) PRIMARY KEY,
deptname VARCHAR2(10));

DROP TABLE dept;

FLASHBACK TABLE dept TO BEFORE DROP;
 
Example
    
create table rates(
  m varchar2(50),
  rate number
)

insert into rates values ('EURO',1.1012);
commit;
update rates set rate = 1.1014;
commit;
update rates set rate = 1.1013;
commit;
delete rates;
commit;
insert into rates values ('EURO',1.1016);
commit;
update rates set rate = 1.1011;
commit;

select versions_starttime, versions_endtime, versions_xid,
versions_operation, rates.*, rates.rowid "Rowid"
from rates versions between timestamp minvalue /* to_date(...*/ and maxvalue /*to_date(...*/
order by VERSIONS_STARTTIME

--get all info from undo tbs
--EXTREMELY SLOW, SEEMS TO SCANS THE ENTIRE UNDO
SELECT UNDO_SQL
FROM FLASHBACK_TRANSACTION_QUERY
WHERE XID = '07001B008B160000';

 

Flashback an entire table
FLASHBACK TABLE RECYCLETEST TO SCN 2202666520;

 

Flashback database
flashback database to before resetlogs;


create restore point before_monthend_200503
guarantee flashback database;
select * from v$restore_point;
...
flashback database to restore point before_monthend_200503;