SQL> oerr ora 08189
SP2-0734: unknown command beginning "oerr ora 0..." - rest of line ignored.
SQL> host oerr ora 08189
08189, 00000, "cannot flashback the table because row movement is not enabled"
// *Cause: An attempt was made to perform Flashback Table operation on a table for
// which row movement has not been enabled. Because the Flashback Table
// does not preserve the rowids, it is necessary that row
// movement be enabled on the table.
// *Action: Enable row movement on the table
未开启行移动
SQL> alter table flash_tbl enable row movement;
Table altered.
SQL> flashback table flash_tbl to scn 1227868;
Flashback complete.
SQL> select * from flash_tbl;
ID V
---------- -
10 I
11 J
12 K
13 L
14 M
15 N
117 P
118 Q
119 R
120 S
6 E
ID V
---------- -
7 F
8 G
9 H
300 r
500 t
16 rows selected.
恢复成功……
SCN:在10g中,系统平均每3秒产生一次系统时间与SCN的匹配并存入SYS.SMON_SCN_TIME表,若使用AS OF TIMESTAMP 查询UNDO中的数据,实际获取的数据是以指定的时间对应的SCN时的数据为基准。
例如:SCN TIME
123 2013-04-01 20:25:00
125 2013-04-01 20:30:00
当通过AS OF TIMESTAMP查询2013-04-01 20:25:00或2013-04-01 20:29:59这段时间内任何时间,Oracle都会将其匹配为SCN:123到UNDO表空间中查找。就是说在这个时间段内,查询返回的数据都是2013-04-01 20:25:00这个时间对应的SCN的数据。