We know that the Flashback Table can restore the drop Table from the recycle bin, but not everything about the Table can be returned by Flashback, such as foreign key constraints.
- Duzz $ scott @ orcl>Create TableD (deptno numberPrimary Key, Deptname varchar2 (20 ));
- TableCreated.
- Elapsed: 00:00:00. 28
- Duzz $ scott @ orcl>Create TableE (empno numberPrimary Key, Ename varchar2 (20), deptno number,ConstraintFk_deptForeign Key(Deptno)ReferencesD (deptno ));
- TableCreated.
- Elapsed: 00:00:00. 39
- Duzz $ scott @ orcl>Select*FromD;
- DEPTNO DEPTNAME
- ---------------------
- 10 IT
- 20 HR
- Elapsed: 00:00:00. 03
- Duzz $ scott @ orcl>Select*FromE;
- EMPNO ENAME DEPTNO
- ---------------------------------
- 1 KING 10
- 2 HARI 20
- Elapsed: 00:00:00. 00
- Duzz $ scott @ orcl>SelectConstraint_name, constraint_type, table_nameFromUser_constraintsWhereTable_nameIn('D','E');
- CONSTRAINT_NAME CON TABLE_NAME
- ------------------------------------
- SYS_C005553 P D
- SYS_C005554 P E
- FK_DEPT R E
- Elapsed: 00:00:00. 00
- Duzz $ scott @ orcl>Insert IntoEValues(2,'Cott', 10 );
- Insert IntoEValues(2,'Cott', 10)
- *
- ERRORAtLine 1:
- ORA-00001:Unique Constraint(SCOTT. SYS_C005554) violated
- Elapsed: 00:00:00. 01
- Duzz $ scott @ orcl>Insert IntoEValues(3,'Ing', 55 );
- Insert IntoEValues(3,'Ing', 55)
- *
- ERRORAtLine 1:
- ORA-02291: integrityConstraint(SCOTT. FK_DEPT) violated-parentKey NotFound
- Elapsed: 00:00:00. 01
- Duzz $ scott @ orcl>Drop TableE;
- TableDropped.
- Elapsed: 00:00:00. 09
- Duzz $ scott @ orcl> flashbackTableEToBeforeDrop;
- Flashback complete.
- Elapsed: 00:00:00. 10
- Duzz $ scott @ orcl>SelectConstraint_name, constraint_type, table_nameFromUser_constraintsWhereTable_nameIn('D','E');
- CONSTRAINT_NAME CON TABLE_NAME
- --------------------------------------
- SYS_C005553 P D
- BIN $ MzYoteesSWeEWRlJ P E
- Afkfcg = $0
- Elapsed: 00:00:00. 00
- Duzz $ scott @ orcl>Insert IntoEValues(2,'Cott', 10 );
- Insert IntoEValues(2,'Cott', 10)
- *
- ERRORAtLine 1:
- ORA-00001:Unique Constraint(SCOTT. BIN $ MzYoteesSWeEWRlJAfkfcg ==$ 0) violated
- Elapsed: 00:00:00. 01
- Duzz $ scott @ orcl>Insert IntoEValues(3,'Ing', 55 );
- 1 row created.
- Elapsed: 00:00:00. 00
- Duzz $ scott @ orcl>
In addition, tables with Fine-Grained Auditing and Virtual Private Database policies cannot be recovered. Please refer to the official Oracle Flashback description:
A table and all of its dependent objects (indexes, LOB segments, nested tables, triggers, constraints and so on) go into the recycle bin together, when you drop the table. likewise, when you perform Flashback Drop, the objects are generally all retrieved together.
It is possible, however, that some dependent objects such as indexes may have been reclaimed due to space pressure. In such cases, the reclaimed dependent objects are not retrieved from the recycle bin.
Due to security concerns, tables which have Fine-Grained Auditing (FGA) and Virtual Private Database (VPD) policies ies defined over them are not protected by the recycle bin.
Partitioned index-organized tables are not protected by the recycle bin.
The recycle bin does not preserve referential constraints on a table (though other constraints will be preserved if possible ). if a table had referential constraints before it was dropped (that is, placed in the recycle bin ), then re-create any referential constraints after you retrieve the table from the recycle bin with Flashback Drop.
REF:
Http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/flashptr004.htm