Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Foreign Key contraint error after copying database.

Highlighted
Grant Giller
Acclaimed Contributor

Foreign Key contraint error after copying database.

Hi:
I've made a copy of our production database using SQL, restoring it over a blank database. The application server connects to the database properly, but I can't update a record with a servicedesk rep account that I've just created in the new database. The built-in System account can make updates but not a newly created user. The following is an error from trying to change priority on a Service Call record.

JDBC error 547: [CAC54206R3\SERVICEDESK]UPDATE statement conflicted with COLUMN FOREIGN KEY constraint 'SER_REG_MODIFIED_BY_OID_FK'. The conflict occurred in database 'servicedeskDB', table 'REP_ACCOUNTS', column 'ACC_OID'., SQL state: 23000 for query: UPDATE itsm_servicecalls
SET ser_pri_oid= ?
,reg_modified_by_oid= ?
,reg_modified= CONVERT(DATETIME,?,120)
,ser_maximumduration= ?
,ser_deadline= CONVERT(DATETIME,?,120)
,ser_lockseq= ser_lockseq + 1
WHERE ((((ser_oid = ?)
AND (ser_lockseq = ?))))
Values:
3094610073
281478296830066
2005/12/23 19:53:58
2.0
2005/11/22 21:54:22
281478350439300
6

Looks like there was something from the original database that needs to be reset, any idea what it is and how to do it?

Thanks
Grant
6 REPLIES
Akies
Occasional Visitor

Re: Foreign Key contraint error after copying database.

Hi Grant,

What are the rights that are defined with that account?
Also have you changed the host name of previous accounts with new hostname of your new server if changed?

Regards,
Akhil
Grant Giller
Acclaimed Contributor

Re: Foreign Key contraint error after copying database.

Hi Akhil:

I did change the Host setting under the Application Account to the new server, and have made the account a System Administrator but still have the same problem.

Thanks for the quick response.

Grant
Ruth Porter
Honored Contributor

Re: Foreign Key contraint error after copying database.

Hi there,

This is a known probelm - see the attached

Hope this helps

Ruth
http://www.teamultra.net
Robert S. Falko
Honored Contributor

Re: Foreign Key contraint error after copying database.

Grant,

We regularly use the Oracle Export and Import tools to do this sort of thing and never have a problem such as you mention and only need to reset the rows in rep_sessions.

I wonder what you mean by "copy...using SQL" ? Could this be the source of the problem ?

-Josh
Grant Giller
Acclaimed Contributor

Re: Foreign Key contraint error after copying database.

I'll use the Export/Import process, it doesn't seem to work using SQL to copy the database. Thanks to all for your assistance.
Grant Giller
Acclaimed Contributor

Re: Foreign Key contraint error after copying database.

Thanks
//Add this to "OnDomLoad" event