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 > DB2MOVE Urgent!!!!!!!!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-06-04, 10:24
allian allian is offline
Registered User
 
Join Date: Dec 2004
Posts: 54
Angry DB2MOVE Urgent!!!!!!!!!

Hi,

Please help me.

Using db2move I moved my DB from AIX to NT, everything ok, but sequences are automatically set to 1. How I can set the same sequence value as AIX DB.

Allian
Reply With Quote
  #2 (permalink)  
Old 12-06-04, 10:44
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
Alter sequence <sequence_name> restart with <numeric_constant>

regards

Mujeeb
Reply With Quote
  #3 (permalink)  
Old 12-06-04, 10:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
If they are IDENTITY columns you can use:

ALTER table mytable alter column identCol restart with X
(where X is the next value that you AIX system would generate).

HTH

Andy
Reply With Quote
  #4 (permalink)  
Old 12-06-04, 13:25
allian allian is offline
Registered User
 
Join Date: Dec 2004
Posts: 54
Angry

Hi,

I would like to know is any facility there in DB2MOVE to get exact same sequece from source db


allian
Reply With Quote
  #5 (permalink)  
Old 01-09-09, 10:36
bitofhog bitofhog is offline
Registered User
 
Join Date: Jan 2009
Posts: 1
answer?

did you ever figure out how to set these sequences automatically. I have 100s of tables. If I have to go through them one at a time it would be a very long week.
Reply With Quote
  #6 (permalink)  
Old 01-10-09, 13:34
yvanroy yvanroy is offline
Registered User
 
Join Date: Jun 2002
Posts: 12
under windows, you can use the following command to generate the alter statements required to restart the identity columns with their proper value...

db2look -z schema -d dbname -e -nofed | find /i "restart with" > restart.sql

the file restart.sql will contain the alter statements.
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