2

I have altered the size of a column in Oracle , and now i want to get the prev size of that column, so is there anyway we can get the prev size of that column.

Thanks.

Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55
Danish
  • 189
  • 2
  • 3
  • 14
  • 1
    The teaching is, changes to the physical data model should be subject to governance, so scripted and managed in a source control repository like any other piece of code. – APC Sep 05 '18 at 06:50

1 Answers1

4

You may use flashback on 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.
Barbaros Özhan
  • 59,113
  • 10
  • 31
  • 55