Compacting Decision Center sequences

New in 8.10.5 When your identifiers approach their maximum value, you can compact them by removing gaps in their sequence.

Each artifact in the Decision Center repository is identified with a numeric value that is constantly growing. The maximum value that is handled by Decision Center for these values is a Java™ int value of about 2 billion. These values continue growing even if some projects or branches are deleted from the repository. Because gaps are left in the set of used values, the maximum value can be reached even if the full set of values is not used. The compacting tool updates the identifier values by removing the gaps.

Important: The tool does not handle permanent links that are defined by using the Decision Center element identifiers when they are stored outside Decision Center. Updating the element identifier values that are referenced by the permanent links can make the links reference older identifiers that are no longer used or reference unexpected elements.

When to use the tool

The tool must be used when the largest identifier value approaches the maximum value. When the value is close to 1 billion, consider compacting the identifier values. Check the most recently allocated ID in the version table of the repository. The version ID is used the most often and grows faster than the other identifiers.

You can check the version ID by using a query like the following example:

select max(id) from <schemaName>.version where id < 2147483647

How to use the tool

In the same way as the migration and archiving tools, the compacting tool generates an SQL script to copy the available data into a new database schema.

First, you must update the Decision Center data source so that it references a new database schema. Either update the data source to use a different user, or update the database user so that it references a different database schema. The second option requires you to update the database user, and not the data source.

When the data source is updated to use a different database schema, you must create the Decision Center tables in this new schema, which is the same procedure for the migration and archiving tools.

Then, when you use the updated data source, the compact sequence tool must get read access to the old schema. If the access is not granted, you can use the gen-compact-sequences-role Ant task to obtain access. The task generates an SQL script file that lists the set of permissions that are needed to read data in the original schema. You must run this script with database administration permissions that grant access for the old data to the updated Decision Center data source (see Databases that require specific privileges to access another schema).

After you generate and run the role script, use the gen-compact-sequences-script Ant task to generate the SQL script that you run to compact sequences.

Tip: In Oracle, you must close and reopen the database connections to get updated privileges.

Using REST API to generate the scripts

You can also use the Decision Center REST API.
  1. To generate the role script, use the following command:
    "curl -X GET "<dcRestAPIUrl>/v1/DBAdmin/compactseqrole?oldSchemaName=<oldSchemaName>" --user rtsAdmin:rtsAdmin"
  2. To generate the compact sequence script, use the following command:
    "curl -X GET "<dcRestAPIUrl>/v1/DBAdmin/compactseq?oldSchemaName=<oldSchemaName>" --user rtsAdmin:rtsAdmin"