Error During Database Upgrade: ORA-01407: cannot update ("XXXXX"."LIB_DATA"."CONTENT_SIZE") to NULL

Error During Database Upgrade: ORA-01407: cannot update ("XXXXX"."LIB_DATA"."CONTENT_SIZE") to NULL

book

Article ID: KB0070078

calendar_today

Updated On:

Products Versions
Spotfire Server All supported versions

Description

During a Spotfire Server upgrade, the upgrade script may fail with the following error:

--------------------------------------------------------------------
Unable to upgrade database
com.spotfire.server.tools.upgrade.DatabaseUpgradeException: 
ORA-01407: cannot update ("xxxxx"."LIB_DATA"."CONTENT_SIZE") to NULL
--------------------------------------------------------------------
 

Environment

All supported operating systems

Resolution

This error can happen when there are rows in the LIB_DATA table that do not have corresponding entries in the LIB_ITEMS table. A foreign key constraint would typically prevent this issue, but it may have been disabled or removed.

To resolve the issue, please try the following steps.

Important Note:  Before executing the commands below, please restore the database and ensure that you keep a backup of the original.

1. select * from LIB_DATA ld where not exists (select 1 from LIB_ITEMS li where li.ITEM_ID = ld.ITEM_ID);
2. delete from LIB_DATA ld where not exists (select 1 from LIB_ITEMS li where li.ITEM_ID = ld.ITEM_ID);
3. alter table LIB_DATA constraint enable constraint FK_LIB_DATA_ITEM_ID
4. Run upgradetool.bat later.

Issue/Introduction

This article suggests a way to deal with the following issue: The Spotfire Server upgrade tool fails when running the upgrade script, and displays the following error message: Error while upgrading database: ORA-01407: cannot update ("XXXXX"."LIB_DATA"."CONTENT_SIZE") to NULL