Drop Columns
I have an Oracle table with 60million records in it. I have about 35 columns in it and it takes about 40GB of tablespace in the database. I would like to drop some columns to reduce the table size (& also to reduce tablespace usage). Am using Oracle 9i and tried the drop column command. I get the ORA-30036 unable to extend the segment by 8192 in undo tablespace 'UNDOTBS1'. How to I overcome this issue? Is there any effecient way to drop columns from such a large table? Please advise
>>Actually after we 've made column UNUSED, we lost it.
Right.
>>Because if there is no resource consumption we also can just DROP when the database is less use. So there is no much logic to make it UNUSED and then DROP.
I maybe not very well explained.
Yes there is logic, if you don't want anymore a column, but the application is in used, it can be interesting to set the column as "unused" - that doesn't consumme too much resource, and really drop the column later. Because drop a column implies a reading a every block of the table, which can slow down the database, and all the system.
Create a new table may be better for performance, if you're allowed to do this, that implies the tale is no more accessible during the operation. And constraints, indexes should be rebuild as well.
Nicolas.
Similar Messages
-
Hello. When I right click a cube in the solution explorer and click browse, I am presented with a Details field area which doesn't have "Drop Row Fields" area like in BIDS 2008, and doesn't have "Drop Column Fields" area like in BIDS. It just has one details
area with the message "Drag levels or measures here to add to the query".
How do I include the "Drop Row Fields" area and the "Drop Column Fields" area in this Details area so it can be like 2008?I am using MDX query to build SSRS report.
How do i get MDX query from Excel ?
Hi Vishal,
We can use "OLAP PivotTable Extension" to get MDX query in Excel, please download it from:
http://olappivottableextend.codeplex.com/
In addition, I would suggest you open a new case if you have any more questiosn.
Regards,
Elvis Long
TechNet Community Support -
Alter table tablename drop column col
I tried to drop a column from a table created by sys user. Being a sys user I am unable to drop the column. Please explain.
SQL> alter table test move tablespace users;
Table altered.
SQL> alter table test drop column two;
alter table test drop column two
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS
Here two is the column name.
Regards
Vijay KumarHello Gasparotto
It is amazing to me. Being a sys user I created a table and then I tried to alter the table by dropping a column but it is giving me error as I have already stated. Please explain over this issue.
Regards
Vijay Kumar -
Shutdown hangs after drop column
Hi,
We were trying to drop column on a very big table, after that we cancelled that operation, and given shutdown immediate command.
Now shutdown is taking too much time, going on from last 9 hours.....
We want to start the database, what can be the best possible solution.
Shutdown abort and startup will help ?
Thanks
Dilipkumar Patel.We were trying to drop column on a very big table, after that we cancelled that operation, and given shutdown immediate command.I guess SMON was doing rollback the transaction when you cancelled the operation. Since it was a big table, it was taking lot of time.
Can you check the alter log is there any error or info msg in it?
I am afraid if you give shutdown abort, may cause serious issues.
Before you execute 'shutdown abort', make sure you have good backup, in case of recovery.
Jaffar -
Dealing with errors due to newly added/dropped columns
DB version:11g
I am not sure if i have created an unnecessarily large post to explain a simple issue. Anway, here it is.
I have been asked to code a package for Archiving .
We'll have two schemas;The original schema and an Archive schema (connected via a DB Link)
ORIGINAL Schema -------------------------> ARCHIVE Schema
via DB Link When records of certain tables in the ORIGINAL schema meet the archiving criteria (based on Number of Days Old, Status Code etc), it will be moved ('archived') to the ARCHIVE schema using the INSERT syntax
insert into arch_original@dblink
col1,
col2,
col3,
select col1,
col2,
col3,
from original_tableThe original table and its archive table has the same structure, except that the Archive table has an additional column called archived_date which just records when a record got archived.
create table original
col1 varchar2(33),
col2 varchar2(35),
empid number
create table arch_original
col1 varchar2(33),
col2 varchar2(35),
empid number,
archived_date date default sysdate not null
);We have tables with lots of columns(there are lots of tables with more than 100 columns) and when all column names are explicitly listed like the above syntax, the code becomes huge.
Alternative Syntax:
So i thougt of using the syntax
insert into arch_original select original.*,sysdate from original; -- sysdate will populate archived_date columnEventhough the code looks simple and short, i've noticed a drawback to this approach.
Drawback:
For the next release, if developers decide to add/drop a column in the ORIGINAL table in the Original Schema, that change should be reflected in the archive_table's (ARCHIVE schema) DDL script as well. It is practically impossible to keep track of all these changes during the development phase.
If i use
insert into arch_original select original.*,sysdate from original; syntax, you will realise that there is change in the table structure only when you encounter an error(due to missing/new column) in the Runtime. But, if you have all the column names listed explicitly like
insert into arch_original@dblink
(col1,
col2,
col3,
select col1,
col2,
col3,
from original_tablethen you'll encounter this error during the Compilation itself. I prefer the error due to a missing/new column during the Compilation itself rather than in Runtime.
So what do you guys think? I shouldn't go for
insert into arch_original select original.*,sysdate from original; syntax because of the above Drawback. Right?What advantage would it bring if i make ARCHIVED_DATE as the first column in the ARCHIVE tables?The advantage is that if you'll add a column in the future on both original and archived tables the insert statement will work anyway...
SQL> create table x (a number, b number);
Table created.
SQL> create table y (arc_date date, a number, b number);
Table created.
SQL> insert into x values (1,1);
1 row created.
SQL> insert into x values (2,2);
1 row created.
SQL> select * from x;
A B
1 1
2 2
SQL> insert into y select sysdate, x.* from x;
2 rows created.
SQL> alter table x add (c number);
Table altered.
SQL> alter table y add (c number);
Table altered.
SQL> alter table x drop column b;
Table altered.
SQL> alter table y drop column b;
Table altered.
SQL> insert into x values (3,3);
1 row created.
SQL> insert into y select sysdate, x.* from x
2 where a=3;
1 row created.
SQL> select * from x;
A C
1
2
3 3
SQL> select * from y;
ARC_DATE A C
25-JAN-10 1
25-JAN-10 2
25-JAN-10 3 3Max
[My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/]
Edited by: Massimo Ruocchio on Jan 25, 2010 12:44 PM
Added more explicative example -
Hi,
We have a table of size above 500GB. To satisfy some business need there was a requirement to drop one column. The column needed to be dropped contained huge data. Hence before dropping the column it was made unused and then we tried to drop the same. At this point we are facing some issues. The drop unused column has been executed before 18 hours and till now it is not completed.
Suspecting some discrepancy the session conducting the drop command has been killed. Now the table could be described but we are not able to select the table. I am providing the steps followed so far.
First the column was set to unused:
SQL> alter table table_name set unused (column_name);
At some later time the drop command had been executed:
SQL> alter table table_name drop unused columns checkpoint 1000;
The above statement was running for last 18 hours and till now not completed.
Then the corresponding session was killed.
After this the table could be described but select operation could not be performed and returned the following error:
ORA-12986:
columns in partially dropped state. Submit ALTER TABLE DROP COLUMNS CONTINUE
The above command was also executed but without any sign of completion and again killed.
DB Version: 10.2.0.3.0
OS: Sun Solaris 10
Environment: DWH
Kindly guide me at this point on how to resolve this and made the table available to the user.
Thanks in advance for your valuable time.
Regards,
Joyuser8686720 wrote:
The above command was also executed but without any sign of completion and again killed. Was the session waiting on anything?
According to the documentation you don't have many options:
CHECKPOINT Specify CHECKPOINT if you want Oracle Database to apply a checkpoint for the DROP COLUMN operation after processing integer rows; integer is optional and must be greater than zero. If integer is greater than the number of rows in the table, then the database applies a checkpoint after all the rows have been processed. If you do not specify integer, then the database sets the default of 512. Checkpointing cuts down the amount of undo logs accumulated during the DROP COLUMN operation to avoid running out of undo space. However, if this statement is interrupted after a checkpoint has been applied, then the table remains in an unusable state. While the table is unusable, the only operations allowed on it are DROP TABLE, TRUNCATE TABLE, and ALTER TABLE DROP ... COLUMNS CONTINUE (described in sections that follow).
You cannot use this clause with SET UNUSED, because that clause does not remove column data. -
Drop column from compressed table
NLSRTL
11.2.0.3.0
Production
Oracle Database 11g Enterprise Edition
11.2.0.3.0
64bit Production
PL/SQL
11.2.0.3.0
Production
TNS for Linux:
11.2.0.3.0
Production
Hello,
I read about how to drop column from a compressed table - first set it unused and then drop the unused columns. However, in the example below on the database I ran it, it does not work. Please, can you tell me WHEN this approach does not work. What it is dependent on - parameters or something else. Why I cannot drop the unused columns?
And the example along with the errors:
create table tcompressed compress as select * from all_users;
> table TCOMPRESSED created.
alter table tcompressed add x number;
> table TCOMPRESSED altered.
alter table tcompressed drop column x;
>
Error report:
SQL Error: ORA-39726: unsupported add/drop column operation on compressed tables
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).
alter table tcompressed set unused column x;
> table TCOMPRESSED altered.
alter table tcompressed drop unused columns;
>
Error report:
SQL Error: ORA-39726: unsupported add/drop column operation on compressed tables
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).
As you can see even after altering the table by setting the column X as unused I still cannot drop it by using DROP UNUSED COLUMNS.
Thank you.check this link it might help. At the end it has also mentioned of a bug check the same.
http://sharpcomments.com/2008/10/ora-39726-unsupported-adddrop-column-operation-on-compressed-tables.html -
Cannot drop column from table owned by SYS
Hello everybody,
How can I drop a column of table which is owned by sys? thanks!
Result as follows:
SQL> ALTER TABLE HELLO_TB DROP COLUMN NUM;
ALTER TABLE HELLO_TB DROP COLUMN NUM
ERROR at line 1:
ORA-12988: cannot drop column from table owned by SYS
newbie vYou can not 'change' the ownership.
You can, however, 'move' or 'clone' most objects by exporting and importing. As follows:
I create a table under SYS (shudder).
I then export it
- using userid SYS in this case,
- under normal circumstances I'd either use a DBA account or the owner's userid
- since I want a table, I use the TABLES option - a list is comma separated and in quotes
I then import it using a 'userid' switch - fromuser & touser options
- in this case from SYS to HR
Finally, I verify it was transported.
Actual console session in Linux follows:
pop2@fuzzy:~> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 10 19:58:01 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> create table test1 ( x1 number );
Table created.
SQL> insert into test1 values (2);
1 row created.
SQL> select * from test1;
X1
2
SQL> Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
pop2@fuzzy:~> exp file=exp.dmp tables='TEST1'
Export: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:07 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys/????? as sysdba
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TEST1 1 rows exported
Export terminated successfully without warnings.
pop2@fuzzy:~> imp file=exp.dmp fromuser=sys touser=hr
Import: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:44 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys/????? as sysdba
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
. importing SYS's objects into HR
. . importing table "TEST1" 1 rows imported
Import terminated successfully without warnings.
pop2@fuzzy:~> sqlplus hr/hr
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 10 20:00:57 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> select * from test1;
X1
2
SQL>The export/import pair are incredibly powerful - and few people understand them well. If you are interested in digging into their capability, check out their chapters in the Utilities manual (under the Books tab) at http://www.oracle.com/pls/db102/portal.portal_db?selected=1 -
Problem dropping column in sqlplus.
I write
alter table u_gotobank drop column u_bacdamnt;
and it says i'm missing a key word at column.
what could be the problem?Jens, I don't think that's the problem :
SQL> desc test10
Name Null? Type
X NUMBER
Y CHAR(1)
Z CHAR(1)
W CHAR(1)
SQL> alter table test10 drop column w;
Table altered.
SQL> -
Error in Dropping columns from Subject Area to selected Columns section
While Dropping columns from Subject Area to selected Columns section in Analytics nothing is happening.There is no error in the RPD.I am using OBIEE 11g and windows7.I am also getting page error like below:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Timestamp: Tue, 4 Sep 2012 08:31:07 UTC
Message: 'kmsgPickerUIJSCantAddColumns' is undefined
Line: 1
Char: 1781
Code: 0
URI: http://localhost:7001/analytics/res/b_mozilla/picker.js
Message: 'kmsgPickerUIJSCantAddColumns' is undefined
Line: 1
Char: 1781
Code: 0
URI: http://localhost:7001/analytics/res/b_mozilla/picker.js
Can you guys please help?That error usually means it is still mapped, maybe it is used in another interface if you say the mapping has definitely been removed.
You can expand the datastore > Used In > "As a Target" or "As a Source" or "In a Package" - that should tell you if it being used anywhere else.
Cheers
John
http://john-goodwin.blogspot.com/ -
HOWTO drop column from Designer instead of warning
Hi,
is there possibility to tell designer to generate scripts for dropping columns that are no longer in repository? I'm using Designer 6i.
Thank you,
RadekThis functionality is not available in Designer at this point. The decision not to drop the column was in order to try to preserve data integrity.
However, as the database now allows you to do this, we have decided to add this functionality to Designer. In the short term you will need to
update your DDL scripts manually, but we hope to bring you this functionality automatically from Designer by the end
of this calendar year or early next year in a maintenance release.
Regards
Sue Harper -
Hi,
I need to know the command to drop columns from primary key constraints.(some columns)
Please help on this,
Thanks,826854 wrote:
is there any other way to drop only some columns without recreating it.
just i want to know alternate , if iam wrong please ignore.
Thanks for the answer.Its there any issue you face to just drop and add new primary key in your setup i.e. you fear that volum is high and dropping and adding back would take time? -
Drop column from compressed partitioned table
Hi,
DB version is 11.2.02.
We have table which is range partitioned and sub-partitioned by list.
Table is also compressed.
When I try to drop a column, I get error.
CREATE TABLE DWH_REP.P_RATING (
id_source$ NUMBER(38,0) NULL,
time_insert$ DATE ,
time_update$ DATE ,
FLG_CURRENT$ NUMBER(38,0) ,
FLG_CHANGED$ NUMBER(38,0) ,
id_audit$ NUMBER(38,0) ,
ID_DATE_PSTING NUMBER(38,0) ,
partner_rating_id VARCHAR2(256) ,
partner_id VARCHAR2(256) ,
id_partner NUMBER(38,0) ,
rating_system_id VARCHAR2(256) ,
rating_id VARCHAR2(256) ,
date_rating DATE ,
date_follow_up DATE ,
risk_team_id VARCHAR2(256) ,
risk_team_descr VARCHAR2(256) ,
risk_team_changed_id VARCHAR2(256) ,
risk_team_changed_descr VARCHAR2(256) ,
date_risk_team_changed DATE ,
assignment_id VARCHAR2(256) ,
date_assignment DATE ,
date_assignment_confirmed DATE ,
date_assignment_expiration DATE ,
flg_exception VARCHAR2(256) ,
exception_id VARCHAR2(256) ,
date_exception DATE
-- TABLESPACE DWH_REP_DATA
PARTITION BY RANGE (FLG_CURRENT$, ID_DATE_PSTING)
SUBPARTITION BY LIST (ID_SOURCE$)
(PARTITION P_RATING_2010
VALUES LESS THAN (0, 20110101)
SUBPARTITION P_RATING_2010_UCS VALUES (10) TABLESPACE DWH_O_2010_TBS,
SUBPARTITION P_RATING_2010_UCM VALUES (11) TABLESPACE DWH_O_2010_TBS,
-- SUBPARTITION P_RATING_2010_ORBI30 VALUES (30) TABLESPACE DWH_O_2010_TBS,
-- SUBPARTITION P_RATING_2010_ORBI31 VALUES (31) TABLESPACE DWH_O_2010_TBS,
SUBPARTITION P_RATING_2010_CETELEM VALUES (40) TABLESPACE DWH_O_2010_TBS,
-- SUBPARTITION P_RATING_2010_MILES VALUES (60) TABLESPACE DWH_O_2010_TBS,
-- SUBPARTITION P_RATING_2010_BHI VALUES (80) TABLESPACE DWH_O_2010_TBS,
SUBPARTITION P_RATING_2010_DF VALUES (DEFAULT) TABLESPACE DWH_O_2010_TBS),
PARTITION P_RATING_2011
VALUES LESS THAN (0, 20120101)
SUBPARTITION P_RATING_2011_UCS VALUES (10) TABLESPACE DWH_O_2011_TBS,
SUBPARTITION P_RATING_2011_UCM VALUES (11) TABLESPACE DWH_O_2011_TBS,
-- SUBPARTITION P_RATING_2011_ORBI30 VALUES (30) TABLESPACE DWH_O_2011_TBS,
-- SUBPARTITION P_RATING_2011_ORBI31 VALUES (31) TABLESPACE DWH_O_2011_TBS,
SUBPARTITION P_RATING_2011_CETELEM VALUES (40) TABLESPACE DWH_O_2011_TBS,
-- SUBPARTITION P_RATING_2011_MILES VALUES (60) TABLESPACE DWH_O_2011_TBS,
-- SUBPARTITION P_RATING_2011_BHI VALUES (80) TABLESPACE DWH_O_2011_TBS,
SUBPARTITION P_RATING_2011_DF VALUES (DEFAULT) TABLESPACE DWH_O_2011_TBS),
PARTITION P_RATING_current
VALUES LESS THAN (maxvalue, maxvalue)
SUBPARTITION P_RATING_CUR_UCS VALUES (10) TABLESPACE DWH_O_CRT_UCS_TBS,
SUBPARTITION P_RATING_CUR_UCM VALUES (11) TABLESPACE DWH_O_CRT_UPM_TBS,
-- SUBPARTITION P_RATING_CUR_ORBI30 VALUES (30) TABLESPACE DWH_O_CRT_ORBI30_TBS,
-- SUBPARTITION P_RATING_CUR_ORBI31 VALUES (31) TABLESPACE DWH_O_CRT_ORBI31_TBS,
SUBPARTITION P_RATING_CUR_CETELEM VALUES (40) TABLESPACE DWH_O_CRT_CETELEM_TBS,
-- SUBPARTITION P_RATING_CUR_MILES VALUES (60) TABLESPACE DWH_O_CRT_MILES_TBS,
-- SUBPARTITION P_RATING_CUR_BHI VALUES (80) TABLESPACE DWH_O_CRT_BHI_TBS,
SUBPARTITION P_RATING_CUR_DF VALUES (DEFAULT) TABLESPACE DWH_O_CRT_DF_TBS))
ENABLE ROW MOVEMENT
NOLOGGING
COMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE DWH_REP.P_RATING DROP COLUMN ID_PARTNER;
ORA-39726: unsupported add/drop column operation on compressed tableslittleboy wrote:
Hi,
DB version is 11.2.02.
We have table which is range partitioned and sub-partitioned by list.
Table is also compressed.
When I try to drop a column, I get error.
CREATE TABLE DWH_REP.P_RATING (
id_source$ NUMBER(38,0) NULL,
time_insert$ DATE ,
time_update$ DATE ,
FLG_CURRENT$ NUMBER(38,0) ,
FLG_CHANGED$ NUMBER(38,0) ,
id_audit$ NUMBER(38,0) ,
ID_DATE_PSTING NUMBER(38,0) ,
partner_rating_id VARCHAR2(256) ,
partner_id VARCHAR2(256) ,
id_partner NUMBER(38,0) ,
rating_system_id VARCHAR2(256) ,
rating_id VARCHAR2(256) ,
date_rating DATE ,
date_follow_up DATE ,
risk_team_id VARCHAR2(256) ,
risk_team_descr VARCHAR2(256) ,
risk_team_changed_id VARCHAR2(256) ,
risk_team_changed_descr VARCHAR2(256) ,
date_risk_team_changed DATE ,
assignment_id VARCHAR2(256) ,
date_assignment DATE ,
date_assignment_confirmed DATE ,
date_assignment_expiration DATE ,
flg_exception VARCHAR2(256) ,
exception_id VARCHAR2(256) ,
date_exception DATE
-- TABLESPACE DWH_REP_DATA
PARTITION BY RANGE (FLG_CURRENT$, ID_DATE_PSTING)
SUBPARTITION BY LIST (ID_SOURCE$)
(PARTITION P_RATING_2010
VALUES LESS THAN (0, 20110101)
SUBPARTITION P_RATING_2010_UCS VALUES (10) TABLESPACE DWH_O_2010_TBS,
SUBPARTITION P_RATING_2010_UCM VALUES (11) TABLESPACE DWH_O_2010_TBS,
-- SUBPARTITION P_RATING_2010_ORBI30 VALUES (30) TABLESPACE DWH_O_2010_TBS,
-- SUBPARTITION P_RATING_2010_ORBI31 VALUES (31) TABLESPACE DWH_O_2010_TBS,
SUBPARTITION P_RATING_2010_CETELEM VALUES (40) TABLESPACE DWH_O_2010_TBS,
-- SUBPARTITION P_RATING_2010_MILES VALUES (60) TABLESPACE DWH_O_2010_TBS,
-- SUBPARTITION P_RATING_2010_BHI VALUES (80) TABLESPACE DWH_O_2010_TBS,
SUBPARTITION P_RATING_2010_DF VALUES (DEFAULT) TABLESPACE DWH_O_2010_TBS),
PARTITION P_RATING_2011
VALUES LESS THAN (0, 20120101)
SUBPARTITION P_RATING_2011_UCS VALUES (10) TABLESPACE DWH_O_2011_TBS,
SUBPARTITION P_RATING_2011_UCM VALUES (11) TABLESPACE DWH_O_2011_TBS,
-- SUBPARTITION P_RATING_2011_ORBI30 VALUES (30) TABLESPACE DWH_O_2011_TBS,
-- SUBPARTITION P_RATING_2011_ORBI31 VALUES (31) TABLESPACE DWH_O_2011_TBS,
SUBPARTITION P_RATING_2011_CETELEM VALUES (40) TABLESPACE DWH_O_2011_TBS,
-- SUBPARTITION P_RATING_2011_MILES VALUES (60) TABLESPACE DWH_O_2011_TBS,
-- SUBPARTITION P_RATING_2011_BHI VALUES (80) TABLESPACE DWH_O_2011_TBS,
SUBPARTITION P_RATING_2011_DF VALUES (DEFAULT) TABLESPACE DWH_O_2011_TBS),
PARTITION P_RATING_current
VALUES LESS THAN (maxvalue, maxvalue)
SUBPARTITION P_RATING_CUR_UCS VALUES (10) TABLESPACE DWH_O_CRT_UCS_TBS,
SUBPARTITION P_RATING_CUR_UCM VALUES (11) TABLESPACE DWH_O_CRT_UPM_TBS,
-- SUBPARTITION P_RATING_CUR_ORBI30 VALUES (30) TABLESPACE DWH_O_CRT_ORBI30_TBS,
-- SUBPARTITION P_RATING_CUR_ORBI31 VALUES (31) TABLESPACE DWH_O_CRT_ORBI31_TBS,
SUBPARTITION P_RATING_CUR_CETELEM VALUES (40) TABLESPACE DWH_O_CRT_CETELEM_TBS,
-- SUBPARTITION P_RATING_CUR_MILES VALUES (60) TABLESPACE DWH_O_CRT_MILES_TBS,
-- SUBPARTITION P_RATING_CUR_BHI VALUES (80) TABLESPACE DWH_O_CRT_BHI_TBS,
SUBPARTITION P_RATING_CUR_DF VALUES (DEFAULT) TABLESPACE DWH_O_CRT_DF_TBS))
ENABLE ROW MOVEMENT
NOLOGGING
COMPRESS
NOCACHE
NOPARALLEL
MONITORING;
ALTER TABLE DWH_REP.P_RATING DROP COLUMN ID_PARTNER;
ORA-39726: unsupported add/drop column operation on compressed tables
can you checkwith following?
SQL>alter table t set unused column x;
SQL>alter table t drop unused columns;Tom explains it ->http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:69076630635645 -
hello all
i would like to drop one of column of view.
but i unable to drop.
ashish>alter view magazine drop column author;
alter view magazine drop column author
ERROR at line 1:
ORA-00905: missing keyword
but same process i had done on table which work.
ashish>ed
Wrote file afiedt.buf
1* alter table magazines drop column author
ashish>/
Table altered.
can u please tell me why i m fail to do so??
with regards
ashishA view is nothing more than a stored query, change the query and you change the view.
SQL> create view vw
2 as
3 select object_name
4 , object_type
5 from all_objects
6 where rownum < 10
7 /
View created.
SQL> select *
2 from vw
3 /
OBJECT_NAME OBJECT_TYPE
/1005bd30_LnkdConstant JAVA CLASS
/10076b23_OraCustomDatumClosur JAVA CLASS
/10297c91_SAXAttrList JAVA CLASS
/103a2e73_DefaultEditorKitEndP JAVA CLASS
/1048734f_DefaultFolder JAVA CLASS
/10501902_BasicFileChooserUINe JAVA CLASS
/105072e7_HttpSessionBindingEv JAVA CLASS
/106ba0a5_ArrayEnumeration JAVA CLASS
/106faabc_BasicTreeUIKeyHandle JAVA CLASS
9 rows selected.
SQL> create or replace view vw
2 as
3 select object_name
4 from all_objects
5 where rownum < 10
6 /
View created.
SQL> select *
2 from vw
3 /
OBJECT_NAME
/1005bd30_LnkdConstant
/10076b23_OraCustomDatumClosur
/10297c91_SAXAttrList
/103a2e73_DefaultEditorKitEndP
/1048734f_DefaultFolder
/10501902_BasicFileChooserUINe
/105072e7_HttpSessionBindingEv
/106ba0a5_ArrayEnumeration
/106faabc_BasicTreeUIKeyHandle
9 rows selected.
SQL>You beat me to it, Rob. And you're absolutely right about the triggers!
Message was edited by:
Alex Nuijten -
Drop column impact on dependencies
Hello,
i dropped a column on a table,, which was fine, but i have a view and package. when a drop a column from a table will not automatically drop from the view? do i have to alter view test drop column exra_col;
could someone let me know how to handle this...
Thank you..Have you tried putting a test case together?
SQL > SELECT * FROM V$VERSION;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL > CREATE TABLE TEST
2 ( col_a NUMBER
3 , col_b NUMBER
4 , col_c NUMBER
5 );
Table created.
SQL > CREATE VIEW TEST_VIEW
2 AS
3 SELECT col_a
4 , col_b
5 , col_c
6 FROM test
7 ;
View created.
SQL > SELECT * FROM test_view;
no rows selected
SQL > ALTER TABLE TEST DROP COLUMN col_c;
Table altered.
SQL > SELECT * FROM test_view;
SELECT * FROM test_view
ERROR at line 1:
ORA-04063: view "TEST.TEST_VIEW" has errors
SQL > CREATE OR REPLACE VIEW TEST_VIEW
2 AS
3 SELECT col_a
4 , col_b
5 FROM test
6 ;
View created.
SQL > SELECT * FROM test_view;
no rows selected
SQL >
Maybe you are looking for
-
Multiple iphones one itunes account
ok my mom is getting a new iphone and i already have one will she have to have her own apple id or can she use mine and if she does use my id will she have access to my contacts???
-
I just recently built a new computer, using the same hard drive i had but reformatting it with all the new components. I backed up all my files on the old version of the hdd, and i thought of using my iPod nano as a backup for all my music files, con
-
How to transform data received from file adapter
hi', I am reading the data from XML file using file adapter, now I want to write the same contents which I have read from this file to a different/new XML file, the issue is I am unable to perform a transform here, when I use a transform with source
-
Embedded AS3 SWF access in Flex 2
I have an SWF (Action Script 3) created in Flash 9 Alpha Public. I can access all its methods and variables when using SWFloader, but fail to do so when embedding it by using [Embed] tag. I need to do it to use it as a custom cursor (CursorManager ac
-
Oracle 8i : How To Know The User Password
Hi Everyone I' am a developer, Developing Business System with Oracle 8i Ver 8.1.6 and Developer 6i I Create a schema called Bank_Acct, and I Created many users and grant each user a role on some tables according to his work, I Notice That, Some User