Home » RDBMS Server » Server Administration » ORA-39726: unsupported add/drop column operation on compressed tables (oracle - 11.2.0.2.0 linux 2.6)
ORA-39726: unsupported add/drop column operation on compressed tables [message #539174] Wed, 11 January 2012 22:13 Go to next message
kesavansundaram
Messages: 183
Registered: October 2007
Location: MUMBAI
Senior Member
Team,
my user is trying to drop columns, but she gets below error:

SQL Error: ORA-39726: unsupported add/drop column operation on compressed tables
39726. 00000 -  "unsupported add/drop column operation on compressed tables"


i just checked whether table is compressed or not, it is not compressed it seems:

select owner, table_name,COMPRESSION,COMPRESS_FOR from dba_tables
  2  where owner = 'EQUIPMENT' AND TABLE_NAME = 'ETHRNT_VRTL_CNXN_HRLY_AGG_SWP';

OWNER                          TABLE_NAME                     COMPRESS COMPRESS_FOR
------------------------------ ------------------------------ -------- ------------
EQUIPMENT                      ETHRNT_VRTL_CNXN_HRLY_AGG_SWP  DISABLED

1 row selected
.


i am able to set one column as UNUSED. and then i am able to see the count accordingly from below view:

select * from DBA_UNUSED_COL_TABS 
where owner ='EQUIPMENT' and table_name = 'ETHRNT_VRTL_CNXN_HRLY_AGG_SWP';


but not able to drop the unused columns. if i tried to drop a column directly from the table, that also giving above error.

could you please guide me ?

thank you
kesavan

[Updated on: Thu, 12 January 2012 01:18] by Moderator

Report message to a moderator

Re: ORA-39726: unsupported add/drop column operation on compressed tables [message #539176 is a reply to message #539174] Wed, 11 January 2012 22:28 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
39726, 00000, "unsupported add/drop column operation on compressed tables"
// *Cause:  An unsupported add/drop column operation for compressed table
//          was attemped.
// *Action: When adding a column, do not specify a default value.
//          DROP column is only supported in the form of SET UNUSED column
//          (meta-data drop column).
Re: ORA-39726: unsupported add/drop column operation on compressed tables [message #539178 is a reply to message #539176] Wed, 11 January 2012 22:41 Go to previous messageGo to next message
kesavansundaram
Messages: 183
Registered: October 2007
Location: MUMBAI
Senior Member
sir,
Thank you for your reply. Just for a confirmation I am writing this mail. I just checked Oracle documentation, it says

Quote:
You cannot specify the DROP clause to drop a column from a compressed table or a partitioned table
containing any compressed partition, unless you first disable data compression for the table or partition. You can only use the SET UNUSED clause


further i checked below is partitioend or not...but it is not a partitioned table:

select owner,table_name,partitioned from dba_tables 
where owner = 'EQUIPMENT' and table_name = 'ETHRNT_VRTL_CNXN_HRLY_AGG_SWP';

OWNER                          TABLE_NAME                     PAR
------------------------------ ------------------------------ ---
EQUIPMENT                      ETHRNT_VRTL_CNXN_HRLY_AGG_SWP  NO


so, even if the table is not partitioned, the only way to drop a column is to set as UNUSED ?

the only way to check whether a table is compress or not is as below or is there any other way to find out?

select owner, table_name,COMPRESSION,COMPRESS_FOR from dba_tables
  2  where owner = 'EQUIPMENT' AND TABLE_NAME = 'ETHRNT_VRTL_CNXN_HRLY_AGG_SWP';

OWNER                          TABLE_NAME                     COMPRESS COMPRESS_FOR
------------------------------ ------------------------------ -------- ------------
EQUIPMENT                      ETHRNT_VRTL_CNXN_HRLY_AGG_SWP  DISABLED


please confirm once again..

Thank you for your time.
kesavan

[Updated on: Wed, 11 January 2012 23:10] by Moderator

Report message to a moderator

Re: ORA-39726: unsupported add/drop column operation on compressed tables [message #539189 is a reply to message #539178] Thu, 12 January 2012 01:08 Go to previous messageGo to next message
x-oracle
Messages: 380
Registered: April 2011
Location: gujarat
Senior Member
can u send me this table discription
any constraint on this column or not
Re: ORA-39726: unsupported add/drop column operation on compressed tables [message #539191 is a reply to message #539189] Thu, 12 January 2012 01:33 Go to previous messageGo to next message
kesavansundaram
Messages: 183
Registered: October 2007
Location: MUMBAI
Senior Member
Hi Shaan,

please see below traces. there is no constraints for the 3 columns ( the last 3 columns ) we try to drop ...

desc equipment.ETHRNT_VRTL_CNXN_HRLY_AGG_SWP
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ------------------------------------
 TIME_KEY                                              NOT NULL DATE
 HOUR_VALUE                                            NOT NULL NUMBER
 ETHRNT_VRTL_CNXN_KEY                                  NOT NULL NUMBER
 CLASS_OF_SERVICE_KEY                                  NOT NULL NUMBER
 AVG_INBOUND_LATENCY                                            NUMBER(20,8)
 AVG_OUTBOUND_LATENCY                                           NUMBER(20,8)
 AVG_LATENCY_ROUND_TRIP                                         NUMBER(20,8)
 AVG_LOSS_ROUND_TRIP                                            NUMBER(20,8)
 AVG_INBOUND_LOSS                                               NUMBER(20,8)
 AVG_OUTBOUND_LOSS                                              NUMBER(20,8)
 AVG_INBOUND_JITTER                                             NUMBER(20,8)
 AVG_OUTBOUND_JITTER                                            NUMBER(20,8)
 AVG_JITTER_ROUND_TRIP                                          NUMBER(20,8)
 CREATE_DT                                                      DATE
 DATA_INTERVAL                                                  VARCHAR2(10)
 DEVICE_GROUP_TYPE                                              VARCHAR2(10)
 LAST_UPDATED_DT                                                DATE



select * from DBA_CONS_COLUMNS where owner = 'EQUIPMENT' and TABLE_NAME = 'ETHRNT_VRTL_CNXN_HRLY_AGG_SWP';

OWNER           CONSTRAINT_NAME      TABLE_NAME                     COLUMN_NAME                      POSITION
--------------- -------------------- ------------------------------ ------------------------------ ----------
EQUIPMENT       SYS_C002576941       ETHRNT_VRTL_CNXN_HRLY_AGG_SWP  TIME_KEY
EQUIPMENT       SYS_C002576942       ETHRNT_VRTL_CNXN_HRLY_AGG_SWP  HOUR_VALUE
EQUIPMENT       SYS_C002576943       ETHRNT_VRTL_CNXN_HRLY_AGG_SWP  ETHRNT_VRTL_CNXN_KEY
EQUIPMENT       SYS_C002576944       ETHRNT_VRTL_CNXN_HRLY_AGG_SWP  CLASS_OF_SERVICE_KEY

4 rows selected.


pls advise further.

thank you
kesavan
Re: ORA-39726: unsupported add/drop column operation on compressed tables [message #539195 is a reply to message #539191] Thu, 12 January 2012 02:12 Go to previous messageGo to next message
John Watson
Messages: 8929
Registered: January 2010
Location: Global Village
Senior Member
You need to ALTER TABLE...MOVE. I've just tested it: if the table is compressed, you can't drop a column. Then you ALTER TABLE...NOCOMPRESS and you still can't drop a column, because the DDL doesn't affect any existing data. Move the the table to decompress it, and then you can drop columns.
Nice question.
Re: ORA-39726: unsupported add/drop column operation on compressed tables [message #539221 is a reply to message #539195] Thu, 12 January 2012 04:18 Go to previous messageGo to next message
kesavansundaram
Messages: 183
Registered: October 2007
Location: MUMBAI
Senior Member
Excellent John.
It works. I am able to drop those columns.
Thank you very much !!
Re: ORA-39726: unsupported add/drop column operation on compressed tables [message #539222 is a reply to message #539221] Thu, 12 January 2012 04:32 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Can you then post, for future readers, the list of commands you executed to achieve it?

Regards
Michel
Previous Topic: Database upgrade problem
Next Topic: Oracle Questions
Goto Forum:
  


Current Time: Fri Apr 19 17:29:04 CDT 2024