Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alter table Move

Status
Not open for further replies.

gunjan14

Programmer
Sep 18, 2003
156
IN
Hi,
I am trying to move the table from one tablespace to another and I am getting this error.

SQL> alter table omc.temp_anuj move tablespace users;
alter table omc.temp_anuj move tablespace users
*
ERROR at line 1:
ORA-14004: missing PARTITION keyword


SQL> alter table omc.temp_anuj move parallel nologging tablespace users;
alter table omc.temp_anuj move parallel nologging tablespace users
*
ERROR at line 1:
ORA-14004: missing PARTITION keyword

The Oracle Version is Oracle 8.0.6.0.0

Why this is happening?
 
Is there any way we can achieve this in Oracle 8.0.6?
 
yes - export table, drop table, create table in new tablespace, import table with IGNORE=Y

Alex
 
You could also do a create table <name> as select * from <table_name> tablespace <new_tablespace_name>.

Then drop the old table and rename the newly created table.
 
As a warning when using Aryeh's suggestion: The only declarative constraints that migrate with &quot;CREATE TABLE...AS SELECT...&quot; are the &quot;NOT NULL&quot; constraints. All other declarative constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, and CHECK) will disappear in the newly created table unless explicitly added after the CREATE.

Dave
Sandy, Utah, USA @ 19:23 GMT, 12:23 Mountain Time
 
Hi,

I tried that method (as suggested by aryeh) and that is workable. But there is 1 minor change.
Have to give the tablespace name before as Select statement
Its like
create table <new_table_name> tablespace <tablespace_name>
as SELECT * FROM <old_table_name>
drop table <old_table_name>
rename <new_table_name> to <old_table_name>.
But one thing Dave, if we are not able to create other constraints and its not possible to do MOVE in 8.0.6 than what option do I have to transform the constraints also with the table?


Gunjan
 
At the risk of repeating myself

export table, drop table, create table in new tablespace, import table with IGNORE=Y


Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top