How to set up a test environment for RTC 3.0.1 with ORACLE? (error when upgrading to 4.0)
2012-07-31 11:38:07,275 ALTER TABLE RIODS.EXECRES_REQUEST_LOOKUP ADD CONSTRAINT EXECRGREQ_PK PRIMARY KEY(REQUEST_ID, EXECUTION_RESULT_ID, LINK_TYPE)
com.ibm.team.repository.common.TeamRepositoryException: ALTER TABLE RIODS.EXECRES_REQUEST_LOOKUP ADD CONSTRAINT EXECRGREQ_PK PRIMARY KEY(REQUEST_ID, EXECUTION_RESULT_ID, LINK_TYPE)
at com.ibm.team.datawarehouse.service.AbstractDataWarehouseDbProvider.internalExecuteSql(AbstractDataWarehouseDbProvider.java:247)
atetc...etc...etc...Caused by: java.sql.SQLException: ORA-00955: name is already used by an existing object.
Accepted answer
I did some research and it seems this problem happens when you try to drop the PRIMARY KEY CONSTRAINT with a newer version of Oracle than the one it was created with. I don't think we had tests that cover that scenario.
As a workaround, can you first migrate the data warehouse before upgrading to a newer Oracle version?
If not, please contact IBM support and they will work on providing a patch for this issue.
The fix should be as you suggested. We will need to append a DROP INDEX to the statement.
Comments
We are using Oracle 11G. We upgraded the DB to 11G before upgrading from 2.0.0.2 to 3.0.1.
We are in the process of upgrading to 4.0. The Jazz and JTS DB's upgraded fine, but we have the same issue with our DW upgrade.
Is there going to be a patch available? We are testing the upgrade sequence in QA, and want to have a repeatable, predictable process we can apply to the production upgrade.
Hi Mike, we delivered the fix for the upcoming 4.0.0.1 Fixpack. For a patch you will need to contact tech support.
4 other answers
I doubt that is the cause of the error. If I look at the upgrade scripts, I see the following:
ALTER TABLE RIODS.EXECRES_REQUEST_LOOKUP DROP CONSTRAINT EXECRGREQ_PK;
ALTER TABLE RIODS.EXECRES_REQUEST_LOOKUP ADD CONSTRAINT EXECRGREQ_PK PRIMARY KEY(REQUEST_ID, EXECUTION_RESULT_ID, LINK_TYPE);
The above will drop the existing contraints named EXECRGREQ_PK then will try to create a constraint with the same name.
The error you are getting is saying that the constraint already exists but it should have been deleted by the previous statement.
Please contact customer support and they will give you the sql scripts used to upgrade the data warehouse. They could get you to apply the upgrade manually. That way you can see the exact spot where the error occurs and disgnose the problem.
Comments
Rafik, I've just realized that both databases, production and sandbox are in the same version "Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production".
So, the problem is not related with versions. Do you have any idea of what could be the cause of the issue?
Did you do a dump of your production data to the sandbox to test the upgrade. That could have caused the problem.
Yes, that's what I did. But, why this affects the upgrade?
Leonardo, I really do not know. This really feels like an Oracle bug to me as opposed to a feature. Please connect with IBM support, so they can provide you with a patch to workaround the problem.
Comments
We see the same issue on our oracle upgrade.
Did using the command manually fix the issue?
ALTER TABLE RIODS.EXECRES_REQUEST_LOOKUP DROP CONSTRAINT EXECRGREQ_PK DROP INDEX ;
Mike, that script doesn't fix the issue. This is the cause of the problem: since Oracle 10.2 the way impdp does is to create index first and then add the PK constraint, which will not drop the index when you just alter table drop constraint. If you create PK without creating index first, the drop constraint will drop the index too.
I found the following workaround. You should execute something like this for each script that fails:
alter table RIODS.EXECRES_REQUEST_LOOKUP modify constraint EXECRGREQ_PK disable; drop index RIODS.EXECRGREQ_PK; alter table RIODS.EXECRES_REQUEST_LOOKUP modify constraint EXECRGREQ_PK enable;
However, if you have the issue in your production environment, I recommend you to contact IBM support.
Mike you can try the above for each of the following tables, then run the warehouse upgrade command. But I really would recommend talking to support if this is a production server.
Here is the list of tables that are affected:
RIODS.REQUIREMENT_HIERARCHY
RIODS.EXECRES_REQUEST_LOOKUP
RIODS.EXECSTEPRES_REQUEST_LOOKUP
RIODS.EXECWORKITEM_REQUEST_LOOKUP
RIODS.REQUEST_TESTCASE_LOOKUP
RIODS.REQUICOL_TESTPLAN_LOOKUP
RIODS.REQUIREMENT_REQUEST_LOOKUP
RIODS.REQUIREMENT_TESTCASE_LOOKUP
let's try the table list again:
RIODS.REQUIREMENT_HIERARCHY,
RIODS.EXECRES_REQUEST_LOOKUP,
RIODS.EXECSTEPRES_REQUEST_LOOKUP,
RIODS.EXECWORKITEM_REQUEST_LOOKUP,
RIODS.REQUEST_TESTCASE_LOOKUP,
RIODS.REQUICOL_TESTPLAN_LOOKUP,
RIODS.REQUIREMENT_REQUEST_LOOKUP,
RIODS.REQUIREMENT_TESTCASE_LOOKUP