Thursday, May 15, 2008

ORA-08189: cannot flashback row movement is not enabled

Error Description:
-----------------------

Whenever I tried to Flashback Table feature of oracle the following error occurs.
SQL> FLASHBACK TABLE TEST_NUM TO TIMESTAMP SYSDATE-1;
FLASHBACK TABLE TEST_NUM TO TIMESTAMP SYSDATE-1
*
ERROR at line 1:
ORA-08189: cannot flashback the table because row movement is not enabled


Cause of The Problem:
---------------------------

Whenever you performed flashback operation(flashback table, flashback version query,flashback transaction query) of a table except flashback drop feature(which don't need to enable row movement as whole objects come from recycle bin) then above error will come.

Solution of The Problem:
------------------------------------

Row movement of the table need to be enabled in order to perform flashback table.

1)To see whether row movement enabled or disabled issue the following,

SQL> SELECT TABLE_NAME,ROW_MOVEMENT FROM USER_TABLES WHERE TABLE_NAME='TEST_NUM';
TABLE_NAME ROW_MOVE
------------------------------ --------
TEST_NUM DISABLED

2)In order to perform flashback table enable row movement by following query,

SQL> ALTER TABLE TEST_NUM ENABLE ROW MOVEMENT;
Table altered.

Check it by,
SQL> SELECT TABLE_NAME,ROW_MOVEMENT FROM USER_TABLES WHERE TABLE_NAME='TEST_NUM';
TABLE_NAME ROW_MOVE
------------------------------ --------
TEST_NUM ENABLED

3)Now perform flashback operation.
SQL> FLASHBACK TABLE TEST_NUM TO TIMESTAMP SYSDATE-1;
Flashback complete.

1 comment:

  1. Thanks a lot, it helped me a lot. I managed to correct my mistake in live database

    ReplyDelete