我已经在Oracle中更改了列的大小,现在我想获取该列的上一个大小,因此无论如何我们都可以获取该列的上一个大小。
谢谢。
答案 0 :(得分: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.