ORA-01466: unable to read data - table definition has changed

1. Oracle建议我们等待大约5分钟之后再进行flashback query新创建的表,否则可能会碰到这个错误ORA-01466: unable to read data – table definition has changed. 注意这个5分钟时间间隔正好是9i 中SCN和timestamp相map的时间间隔,虽然可以用timestamp来进行flashback query,但实质还是根据该timestamp对应的SCN来进行flasbback query, 由于timestamp不是实时地跟SCN对应上, 因此我们需要等段时间来让timestamp跟SCN同步上, 因此用SCN会比timestamp更准确些。注意SCN会在每个commit的时候增长。

2. 在创建好表之后,最好等几分钟让SCN增加。如果尝试去flashback一个新创建的表,可能会遇到ORA-01466: unable to read data – table definition has changed


SQL> create table fbt
  2  ( x integer,
  3    y timestamp,
  4    z varchar2(30));

Table created.

SQL> exec dbms_lock.sleep(10);

PL/SQL procedure successfully completed.

SQL> insert into fbt values(1, LOCALTIMESTAMP, ‘Initial population’);

1 row created.

SQL> commit;

Commit complete.

点赞