UCMDB and UD Practitioners Forum (Previously CMS)
cancel

UCMDB - unique constraint violated

SOLVED
Go to solution
Highlighted
Andy Wolin
Trusted Contributor.

UCMDB - unique constraint violated

Greetings,

I am seeing many error messages in the J2F_all.ejb.log file along the paraphrased lines of 'unable to insert into history schema table due to unique constraint violation'. I can't think of anything that I changed to the UCMDB before I started noticing this. There are no failures in the app when using it but these errors seem to indicate that the HISTORY schema is no longer being updated.

I have a case open with support but I have only been recommended to check that space exists for the database to write to (which it does).

= A sample excerpt from the log (I have attached a larger log sample with multiple instances of this error with surrounding log entries): =

Can't execute BATCH prepared statement [INSERT INTO HIST_EVENTS(ID,OBJECT_ID,OBJECT_CLASS,EVENT_ID,EVENT_TIME,CHANGER_INFO,IS_OBJECT,END1_ID,END2_ID,CUSTOMER_ID,CHANGER_TYPE) values (?,?,?,?,?,?,?,?,?,?,?)], due to exception: com.mercury.jdbc.base.BaseBatchUpdateException: [mercury][Oracle JDBC Driver][Oracle]ORA-00001: unique constraint (CMDBHISTORY.PK_HIST_EVENTS) violated

 

 

P.S. This thread has been moved from Application Perf Mgmt (BAC / BSM) Support and News Forum to CMS and Discovery Support and News Forum. - Hp Forum Moderator

5 REPLIES
Alexander Arkhi
Acclaimed Contributor.
Solution

Re: UCMDB - unique constraint violated

It seems that your system was upgraded, right?
I'd suggest to do the following:
* Stop UCMDB
* Execute select max(id) from .HIST_EVENTS
* Remember that number
* Execute
update .ID_CATALOG
set IDC_ID = +1
where IDC_KEY = 'HISTORYDB'
* Start UCMDB
Andy Wolin
Trusted Contributor.

Re: UCMDB - unique constraint violated

Thanks a lot for the response. I have upgraded this UCMDB but the problem did not happen till a few months after. In any case, since this is the dev instance I can still try what you are recommending and see what happens.

Andy Wolin
Trusted Contributor.

Re: UCMDB - unique constraint violated

That worked and I majorly appreciate it, you rock! Here is the complete output of the solution:

c:\>net stop "ucmdb server"
The UCMDB Server service is stopping.................
The UCMDB Server service was stopped successfully.

c:\>
c:\>sqlplus ucmdbadmin@mamd

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 5 11:57:50 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Enter password:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> select max(id) from cmdbhistory.hist_events;

MAX(ID)
----------
9462363

SQL> update foundation.id_catalog set idc_id=9462364 where idc_key='HISTORYDB';

1 row updated.

SQL> /

1 row updated.

SQL> commit;

Commit complete.

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

c:\>
c:\>net start "ucmdb server"
The UCMDB Server service is starting..
The UCMDB Server service was started successfully.


c:\>
loghanath
Respected Contributor.

Re: UCMDB - unique constraint violated

Hi,

Im facing an similar kind of error in the error.log file

[791976@qtp0-21] (JDBCExceptionReporter.java:101) ERROR - [mercury][Oracle JDBC Driver][Oracle]ORA-00001: unique constraint (CMDB.SYS_C006849) violated

Behaviour, unable to update any CI (either manullay / by auto discovey)
Could you suggest if this is the same, you was with?

Alexander Arkhi
Acclaimed Contributor.

Re: UCMDB - unique constraint violated

Hi loghanath,

I would suggest you to use "db consistency tool" - you can contact HP Support to get more details on how to use this tool.
It should help to solve the issue you're facing.

Regards,
Alex