0

I have a table named e_emp3 in Oracle with these fields among others:

  • FNAME VARCHAR2(20 BYTE)
  • SAL NUMBER(8,2)
  • DEPTNO NUMBER(4,0)

I need to alter e_emp3 and set unused column(sal) with online keyword to stay dml operations for users on this table. I wrote this code:

alter table e_emp3 set unused(sal) online;

but I got the following error message

enter image description here

Please help me what is problem? When I run this code without online keyword it succeeds. When I add online keyword it fails.

asked Jul 11, 2019 at 8:35

2 Answers 2

0

Once you mark a column unusued, there is no way back, just restore from backup.

Dropping Table Columns

Removing Unused Columns

The ALTER TABLE...DROP UNUSED COLUMNS statement is the only action allowed on unused columns. It physically removes unused columns from the table and reclaims disk space.

answered Jul 11, 2019 at 8:44
0

As documented in the manual

the set unused clause does not support the online keyword:

set unused

As you can see in the syntax diagram, you can only use cascade constraints or invalidate


The online option is only valid for the move_table_clause

move_table_clause

answered Jul 11, 2019 at 10:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.