Description:
In Oracle, you can create an autonumber field by using sequences. A sequence is an object in Oracle that is used to generate a number sequence. This can be useful when you need to create a unique number to act as a primary key. In SCM r 12.0, we have about 17 sequences as evident in user_sequences view.
But if sequence counter generates already existing OBJID then we get ora-00001: unique constraint error. Then we will check and ensure the latest number sequence would generate is higher than the current max OBJID [which is also the latest] of the corresponding SCM object.
So, we could run following sql and compare:
SEQUENCE_NAME LAST_NUMBER ------------------------------ ----------- HARAUDITEVENTSEQ n HARBRANCHSEQ n HARENVIRONMENTSEQ n HARFORMATTACHMENTSEQ n HARFORMSEQ n HARITEMSSEQ n HARITEMNAMESEQ n HARPACKAGEGROUPSEQ n HARPACKAGESEQ n HARPROCESSSEQ n HARREPOSITORYSEQ n HARSTATESEQ n HARUSERGROUPSEQ n HARUSERSEQ n HARVERSIONDATASEQ n HARVERSIONSSEQ n HARVIEWSEQ n17 rows selected.
select max(branchobjid) from harbranch;select max(envobjid) from harenvironment;select max(attachmentobjid) from harformattachment;select max(formobjid) from harform;select max(itemobjid) from haritems;select max(pkggrpobjid) from harpackagegroup;select max(packageobjid) from harpackage;select max(processobjid) from harstateprocess;select max(repositobjid) from harrepository;select max(stateobjid) from harstate;select max(usrgrpobjid) from harusergroup;select max(usrobjid) from haruser;select max(versiondataobjid) from harversiondata;select max(versionobjid) from harversions;select max(viewobjid) from harview;select max(auditeventobjid) from harauditevent;select max(nameobjid) from haritemname;
Solution:
Once we identified the problem is due to sequence then ORACLE DBA with proper privilege can update and ensure that LAST_NUMBER for corresponding SEQUENCE_NAME is higher than max [latest] objid of the SCM object we are creating.