IBM Support

Error: An error was detected in the middle of upgrading database

Troubleshooting


Problem

This technote provide a few possible solutions to the following error message that may occur when upgrading a user database to the latest schema version in IBM® Rational® ClearQuest® in Microsoft® SQL Server environments.

Symptom

The following error has been reported to occur when upgrading Microsoft SQL Server based databases from ClearQuest:

    Error! An error was detected in the middle of upgrading database <user database name> to the schema <schema name> version <number>:....
    SQL statement"alter table defect add CONSTRAINT fk_16779650 FOREIGN KEY (analyzer_1) REFERENCES users (dbid)".......
    There are no primary or candidate keys in the referenced table 'users' that match the referencing column list in the foreign key 'fk_16779650'
    The database may be in an inconsistent state. The database will be locked to prevent users from logging on until it is restored from the latest backup........"
    The logfile C:\Doc........upgrade.log may be useful in resolving this problem.

Cause

Possible causes could be:

  1. The table could be corrupt, as described in technote: 1131752.
  2. The database configuration was changed after the database was setup.
  3. The database indexes have been removed from the offending table.

Environment

This error is known to occur in Microsoft SQL Server environments.

Diagnosing The Problem

If an explicit error message was not given nor was there any in the log, the problem could be with the database configuration. If the database permission or role was changed after ClearQuest was setup, there could be a failure in upgrading the user database with no specific SQL error. Check the database account that ClearQuest uses.

The only way to determine what indexes need to be added back is to turn on ClearQuest diagnostic tracing and create a new user database. This way, you can see in the logs what indexes are created for each table. Then use SQL tools to see if those indexes exist. Contact Rational Support for help in setting up tracing.

Resolving The Problem

This solution is known to resolve this issue if the back-end database vendor is SQL Server.

Make a backup of the schema repository and all the user databases and then move the user database from SQL Server 2000 to SQL Server 7 and then back to SQL Server 2000 using the ClearQuest Designer.

After that, the upgrade should go through successfully.

If the back-end is SQL Server 2005, move the database. Moving the database rebuilds the indexes, and this may resolve the problem.


[{"Product":{"code":"SSSH5A","label":"Rational ClearQuest"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Database Configuration\/Connectivity - SQL Server","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2003.06.00;2003.06.10;2003.06.12;2003.06.13;2003.06.14;2003.06.15;2003.06.16;7.0;7.0.0.1;7.0.0.2;7.0.1;7.0.1.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Historical Number

157780301

Document Information

Modified date:
04 December 2018

UID

swg21147345