2

我已经更改了 Oracle 中一列的大小,现在我想获取该列的上一个大小,所以无论如何我们可以获得该列的上一个大小。

谢谢。

4

1 回答 1

5

您可以flashback使用user_tab_columns

SQL> conn <your_schema>
SQL> create table tab( str varchar2(20) );
SQL> alter table tab modify str VARCHAR2(30);
SQL> conn / as sysdba
SQL> grant flashback on user_tab_columns to <your_schema>;
SQL> conn <your_schema>
SQL> select *
  from user_tab_columns
 as of timestamp systimestamp - interval '1' minute c 
 where c.column_name = 'STR'
   and c.table_name = 'TAB'; 
-- the period depends on your latency of issuing the commands
-- "'1' minute" may be replaced with "'10' second" as an example.
于 2018-09-05T06:46:16.123 回答