DB version: 12.1.0.2
OS : Oracle Linux 6.5
In the below metioned example, How can I bring the table to the pre-TRUNCATE state ? I tried doing a FLASBHACK TABLE , but it errored out as shown below
SQL> grant select on v_$database to scott;
Grant succeeded.
SQL> conn scott/tiger
Connected.
SQL>
SQL>
SQL> CREATE TABLE test2 ( id NUMBER(10));
Table created.
SQL> INSERT INTO test2 (id) VALUES (2016);
1 row created.
SQL> commit;
Commit complete.
SQL> ALTER TABLE test2 ENABLE ROW MOVEMENT;
Table altered.
SQL> SELECT current_scn FROM v$database;
CURRENT_SCN
-----------
1831058
SQL>
SQL> truncate table test2;
Table truncated.
SQL> SELECT current_scn FROM v$database;
CURRENT_SCN
-----------
1831137
SQL> flashback table TEST2 to SCN 1831058;
flashback table TEST2 to SCN 1831058
*
ERROR at line 1:
ORA-01466: unable to read data - table definition has changed
We have FLASHBACK DATABASE enabled in this DB, but we don't want to take the entire DB to past point in time just to get records from one table.