If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > alter table move on DB2 as in Oracle

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-16-07, 02:21
hariza hariza is offline
Registered User
 
Join Date: Jan 2003
Location: australia
Posts: 17
alter table move on DB2 as in Oracle

Hi Guys,

Just wondering whether is anyone have heard or know of a new db2 command equivalent to the 'alter table move' existing in Oracle. I need to move a bunch of tables to a new tablespace and I know that since DB2 8.2 became available it has a lot of new goodies so I'm hoping we have something new able to help me. Otherwise I will have to stick with export/import approach.

Cheers,

harby.
Reply With Quote
  #2 (permalink)  
Old 05-16-07, 06:55
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
i dont think so,
u have to apply same old approach export/import :-(
__________________
Rahul Singh
Certified DB2 9 DBA / Application Developer
Reply With Quote
  #3 (permalink)  
Old 05-16-07, 08:12
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You should be able to use the ALTOBJ stored procedure to change the tablespace for a table.

Andy
Reply With Quote
  #4 (permalink)  
Old 05-17-07, 07:29
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Yet another alternative:
  1. RENAME TABLE
  2. CREATE TABLE ... LIKE <renamed-table>
  3. INSERT INTO ... SELECT * FROM <renamed-table>
  4. DROP <renamed-table>
You will have to take care of constraints, however.

A problem may be that the INSERT will be logged. You can use NOT LOGGED INITIALLY in that case, or export/load (import will be logged, too!)
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 05-17-07, 08:44
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by stolze
A problem may be that the INSERT will be logged. You can use NOT LOGGED INITIALLY in that case, or export/load (import will be logged, too!)
There's also a load from cursor, which should be a bit faster than messing with files.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On