|
View previous topic :: View next topic
|
| Author |
Message |
Seppe
New User
Joined: 01 Apr 2009 Posts: 33 Location: Rome - Italy
|
|
|
|
Hola,
i have a question...
Can i change a tablespace of a tabel without change the table?
For ex:
i have the table XXX on the tablespace ZZZ.
Now i create the tablespace YYY.
Can i copy XXX on YYY with command like "copy table XXX of DB2.ZZZ in DB2.YYY" ?!?
Thanks. |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
Are you talking about DB2 LUW or DB2 for zOS? |
|
| Back to top |
|
 |
Seppe
New User
Joined: 01 Apr 2009 Posts: 33 Location: Rome - Italy
|
|
|
|
| DB2 for zOS |
|
| Back to top |
|
 |
Seppe
New User
Joined: 01 Apr 2009 Posts: 33 Location: Rome - Italy
|
|
|
|
My problem:
from
Tab1 on the tablespace ts1
to
Tab1 on the stablespace ts2
Initially i thought:
CREATE TABLE tab2 LIKE tab1 IN ts2 ;
INSERT INTO tab2 SELECT * FROM tab1 ;
DROP tab1 ;
RENAME TABLE tab2 TO tab1 ;
...but so i lose all indexes... There must be another way!
i tried:
RENAME TABLESPACE ts1 TO ts2 ;
but it doesn't work... |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
| Quote: |
| There must be another way! |
not always You can have what You want  |
|
| Back to top |
|
 |
|
|