I have one table named test
which has 3 columns:
After some time I know one column is not in use. I want to drop one column, let's say id
.
Oracle has one feature to identify a column as unused
. What is differenc between drop
column vs set unused
column?
When you drop a column it moves into recycle bin while when you mark a column unused it is like logically dropping it but physically preserving it.
Sometimes marking a column as unused and then using the alter table name drop unused column statement is useful because it allows the DBA to take away column access quickly and immediately. Later on, during a routine database maintenance weekend or after business hours, you can then remove the column with the alter table name drop unused column to reclaim the space.
On the other hand, marking the column unused won't free up any space and when there is an need to free up space and remove the columns that are not needed you would be better off dropping it.
It's a matter of convenience, actually...
see here
setting to "unused" is just like dropping, but will allow you to defer the actual physical deletion to a later date.
This is a help to DBA's maintenance window not for your use in general. For developer it means DROP column. that's it, no recovery later point. instead if you are in 12 c then use INVISIBLE option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With