This is a discussion on Change a table's tablespace within the DB2 forums, part of the Database Server Software category; --> Hi, i need to change the tablespace of a table, ie. use another tablespace for the table and stop ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, i need to change the tablespace of a table, ie. use another tablespace for the table and stop the use of the existing tablespace. Is there any way i can accomplish this? One solution might be export the data from the table, re-create the tables in the new tablespace, drop the original tablespace and load the data. But i would prefer another simple and less time-consuming way. Any suggestions would be highly appreciated. Thanks in advance, Sandip. |
| |||
| sandip wrote: > Hi, > > i need to change the tablespace of a table, ie. use another tablespace > for the table and stop the use of the existing tablespace. Is there any > way i can accomplish this? One solution might be export the data from > the table, re-create the tables in the new tablespace, drop the > original tablespace and load the data. But i would prefer another > simple and less time-consuming way. You could create a new table in the other tablespace CREATE TABLE <new-table> LIKE <old-table> IN <new-ts> copy the data INSERT INTO <new-nable> SELECT * FROM <old-table> correct foreign keys to point to the new table and then remove the old table. -- Knut Stolze Information Integration Development IBM Germany / University of Jena |
| |||
| sandip wrote: > Hi, > > i need to change the tablespace of a table, ie. use another tablespace > for the table and stop the use of the existing tablespace. Is there any > way i can accomplish this? One solution might be export the data from > the table, re-create the tables in the new tablespace, drop the > original tablespace and load the data. But i would prefer another > simple and less time-consuming way. > > Any suggestions would be highly appreciated. > > Thanks in advance, > Sandip. > You can do a "load from cursor". One way or another the data needs to move. Cheers Serge -- Serge Rielau DB2 SQL Compiler Development IBM Toronto Lab |