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 > reset identity column count

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-17-08, 11:44
iskander iskander is offline
Registered User
 
Join Date: Sep 2007
Posts: 50
Question reset identity column count

hello

is there any other way of resetting the identity column count besides doing an alter column restart with ?
Also, is it just me or if you do an alter table alter column restart, when doing so it drops all contraints on that table first, then performs the alter table and then recreates the constraints?
Reply With Quote
  #2 (permalink)  
Old 01-17-08, 13:08
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
1) no
2) I have not seen that happen

Andy
Reply With Quote
  #3 (permalink)  
Old 01-17-08, 18:22
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
1) What's wrong with the ALTER TABLE ... ALTER COLUMN ... RESTART?
2) Could you explain to us how you deduced that this is happening?
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #4 (permalink)  
Old 01-17-08, 18:54
iskander iskander is offline
Registered User
 
Join Date: Sep 2007
Posts: 50
well, there's nothing wrong with alter column restart, unless it requires special permissions on the executing user (to alter table). Would be nice if there was a way to do that without that sort of permissions.
about point 2, I didn't deduce that is the case, I just assumed. I was running a stored proc that does:
delete from table
alter column restart id
many inserts ...
and the job was failing and on the extremely long log I could see attempts to drop all constraints, then beggining a rollback and then attempting to recreate all constraints. Then I removed the alter statements and the job worked fine. I assumed the alter table would cause the drop/recreate constraints and that my user wouldn't have the persmissions (which would trigger the rollback). Again, this was just a long shot trying to explain something I didn't understand and I couldn't find anything to support this theory on the net so I thought I'd ask here. Any help would be greatly appreciated.
Reply With Quote
  #5 (permalink)  
Old 01-17-08, 19:07
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Sorry, I don't get this part: "and on the extremely long log I could see attempts to drop all constraints". How exactly did you see that constraints were dropped? What was the error message you got? And could you also give us a reproducable scenario? I'm just asking because I don't believe that any constraints were dropped at all and that you were seeing some symptoms and may not interpret them correctly.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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