IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

change tablespace


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Tue Mar 12, 2013 9:46 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 13, 2013 3:53 pm
Reply with quote

Hi,

Are you talking about DB2 LUW or DB2 for zOS?
Back to top
View user's profile Send private message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Wed Mar 13, 2013 4:01 pm
Reply with quote

DB2 for zOS
Back to top
View user's profile Send private message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Wed Mar 13, 2013 9:40 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Mar 13, 2013 11:26 pm
Reply with quote

Quote:
There must be another way!


not always You can have what You want icon_cool.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts force tablespace using LISTDEF input DB2 1
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts SELECT from data change table DB2 5
No new posts Trying to change copybook in online c... CICS 4
No new posts Change Default Scroll Setting TSO/ISPF 1
Search our Forums:

Back to Top