Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

change tablespace

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: change tablespace
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

Senior Member


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

PostPosted: Wed Mar 13, 2013 3:53 pm    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Wed Mar 13, 2013 11:26 pm    Post subject: Reply to: change tablespace
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts How to change dataset attributes of m... ignich7 JCL & VSAM 3 Thu Jul 21, 2016 9:17 pm
No new posts Image Copy of a tablespace that conta... Robin Sulsona DB2 4 Thu Jun 02, 2016 1:47 am
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm
No new posts IBMHPU - Tablespace and Imagecopy chaitanya bharath DB2 1 Fri Apr 15, 2016 5:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us