Maximo List Archive

This is an archive of the Maximo Yahoo Community. The content of this pages may be a sometimes obsolete so please check post dates.
Thanks to the community owner Christopher Wanko for providing the content.



Resetting all Maximo Sequences DB2

From: mlevinson (2014-06-12 09:46)

I have managed to get my Maximo (DB2) sequences all out of order. What I would like to do is somehow select the max values for all tables in the schema and then update all of the sequences to the max value +100.

I have tried the following, but it simply looks at the current sequence value and adds 100.
SELECT 'ALTER SEQUENCE MAXIMO.'||SEQNAME||' RESTART WITH '||((COALESCE(LASTASSIGNEDVAL,0)+100))||'' from
sysibm.syssequences

For example if I run the following:
select max(REPORTLABELID) from MAXIMO.REPORTLABEL;

I get 30030


When I run the following I get a value of 15100 for the REPORTLABEL sequence

SELECT 'ALTER SEQUENCE MAXIMO.'||SEQNAME||' RESTART WITH '||((COALESCE(LASTASSIGNEDVAL,0)+100))||'' from
sysibm.syssequences

I would like to create a script that will check for the max value on a table and add 100. If the max value is NULL i would like to reset the sequence to 100.

I sure hope someone has done this before or can help me get all of my sequences back on track. The -803 errors are killing me.



From: swkim (2014-06-13 08:31)

Based on your SQL, looks like you looked up this article already: IBM Changing PREVVAL values for all sequences in Maximo DB2 database - United States http://www-01.ibm.com/support/docview.wss?uid=swg21601299

IBM Changing PREVVAL values for all sequences in Maximo DB2 database - United States http://www-01.ibm.com/support/docview.wss?uid=swg21601299 Question How to change PREVVAL for every sequence in the Maximo DB2 Database to resolve unique index violation error. Cause



View on www-01.ibm.com http://www-01.ibm.com/support/docview.wss?uid=swg21601299
Preview by Yahoo




Here's another one though on restarting sequences one by one... maybe the SQL syntax can be altered. Worse case, do it one by one. Hopefully, its just a one time fix:

IBM Restarting Sequence with the specific value on DB2 - United States http://www-01.ibm.com/support/docview.wss?uid=swg21291596

IBM Restarting Sequence with the specific value on DB2 - United States http://www-01.ibm.com/support/docview.wss?uid=swg21291596 You will see an error similar to the one in the following stack trace: Reading script file : hf_008 -------------------------------------------------------------------



View on www-01.ibm.com http://www-01.ibm.com/support/docview.wss?uid=swg21291596
Preview by Yahoo