Error applying Sentinel 6.0 SP2 Hotfix 5 database patch

  • 7001554
  • 07-Oct-2008
  • 26-Apr-2012

Environment

Novell Sentinel 6.0 Support Pack 2
Novell Sentinel 6.0 Support Pack 2 Database Patch

Situation

Running mig_50220.sql: mig_50220.sql failed. see patch_db_log/mig_50220_08-10-02_00-42-43-PM.log
Error: Failed to apply database version 6.0.0.0_SP2_HOTFIX5
There was an error patching the database.  Please fix the error and rerun this script.

Applying Sentinel 6.0 SP2 Hotfix 5's database patch to an environment fails when the AUDIT_RECORD table is large.  The database patch adds partitioning to the AUDIT_RECORD table.  As a result during the patch process an index is created in the database on the new partitioned table that may, when large amounts of data already exist, require more database space than the database has available for this purpose.  In this situation a memory error is returned causing a failure to continue patching the database.

Resolution

Before running the database patch it is recommended that the AUDIT_RECORD table be checked for a large number of rows.  If there are hundreds of thousands or millions of rows those rows should be backed up by the Database Administrator (DBA) and then truncated.  In the future these data will be used for auditing purposes inside Sentinel but currently they are not used actively and truncating them is a safe step to take.  If these data are not needed they can be truncated safely without backing them up before applying the patch the first time.  With this table empty there should not be a problem allocating sufficient memory to create an index for the new table.

During the first execution of the database patch if the memory error occurs as discussed subsequent attempts at the DB patch will fail due to a different error revolving around constraints created or deleted during the first attempt at the patch.  As a result the DB patch script must be modified to prevent it from making those same changes again and failing.  In the mig_50220.sql script found in the ./db_patch/ddl/mssql/Migration directory comment out lines 106 and 111.  These lines execute commands to delete or create constraints that now exist after the first attempt of the DB patch.  With these commented out the original error will be found again unless AUDIT_RECORD has been truncated.  If the DB patch has not been attempted at all and AUDIT_RECORD is truncated these lines should be left enabled as these constraints must be modified for the database to work properly.

Steps to resolution in mssql:
1.  (Optional) Backup data in the AUDIT_RECORD table.
2.  Truncate the AUDIT_RECORD TABLE: `TRUNCATE TABLE AUDIT_RECORD;` .
3.  Comment out lines 106 and 111 in ./db_patch/ddl/mssql/Migration/mig_50220.sql .
4.  Rerun the patch.