ORA-02296: cannot enable database - null values found
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
要約
After migrating to or copying an Oracle based database, actions in Jira fail with interface errors such as:
Jira logs will throw an ORA-02296 error related to null values found:
02296: cannot enable (JIRAGREEN.) - null values found
原因
The full error indicates that Oracle identified a NULL value in a place where there shouldn't be NULL values. The error message will also report the query that was being executed prior to the error, such as:
Caused by: Error : 2296, Position : 0, Sql = ALTER TABLE "AO_4789DD_HEALTH_CHECK_STATUS" MODIFY ("ID" NOT NULL), OriginalSql = ALTER TABLE "AO_4789DD_HEALTH_CHECK_STATUS" MODIFY ("ID" NOT NULL), Error Msg = ORA-02296: cannot enable (JIRAGREEN.) - null values found
...
Caused by: com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
Database:
- name:Oracle
- version:Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.10.0.0.0
- minor version:0
Driver:
- name:Oracle JDBC driver
- version:19.3.0.0.0
java.sql.SQLIntegrityConstraintViolationException: ORA-02296: cannot enable (JIRAGREEN.) - null values found
at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.migrate(EntityManagedActiveObjects.java:54)
at com.atlassian.activeobjects.internal.AbstractActiveObjectsFactory.lambda$create$0(AbstractActiveObjectsFactory.java:73)
at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21)
at com.atlassian.jira.DefaultHostContextAccessor.doInTransaction(DefaultHostContextAccessor.java:50)
... 2 filtered
In this case, the column reported was "ID" of the table "AO_4789DD_HEALTH_CHECK_STATUS".
ソリューション
We'll need to compare both source and target tables to check for structural differences on the affected table/column. For example, a DESC AO_4789DD_HEALTH_CHECK_STATUS will show that the "ID" column was configured differently on source and target:
- Source: ID NOT NULL NUMBER(11)
- Target: ID NUMBER(11)
For the involved tables, we'll need to manually check if there are major dataset differences that might require a re-importing. If not, we can just remove invalid records and modify the table structure accordingly:
DELETE FROM "AO_4789DD_HEALTH_CHECK_STATUS" WHERE "ID" IS NULL;
ALTER TABLE "AO_4789DD_HEALTH_CHECK_STATUS" MODIFY ( "ID" NOT NULL);
Be sure to backup your database prior to making any direct changes such as these, as well as testing them in a lower environment in order to avoid any additional issues.
These need to be performed while Jira is shut down.