Troubleshoot > Troubleshooting Administration > Troubleshooting Purging - How to View and Delete History Partitions

Troubleshooting Purging - How to View and Delete History Partitions

The PurgeHistoryTroubleshooting JMX method in the UCMDB:service=History DB Services category allows users to view history partitions and generate SQL statements for deleting the history partitions.

Check partitions

To check all partitions from DB and UCMDB, do the following:

  1. On the UCMDB server, launch the Web browser and access JMX console by providing the following address: https://localhost:8443/jmx-console.

    You may have to log in with a user name and password.

  2. Locate the PurgeHistoryTroubleshooting JMX method in the UCMDB:service=History DB Services category.
  3. Select False.
  4. Click Invoke.

    The result page displays the partitions corresponding to the values from the infrastructure settings History Months To Save Back and History purging extra months to save back removed data.

Delete partitions

You can view all partitions from UCMDB (records in the URM_RESOURCES table) and DB (physical tables in DB), and also generate the delete statements.

To delete partitions, do the following:

  1. View partitions and generate delete statements

    1. On the UCMDB server, launch the Web browser and access JMX console by providing the following address: https://localhost:8443/jmx-console.

      You may have to log in with a user name and password.

    2. Locate the PurgeHistoryTroubleshooting JMX method in the UCMDB:service=History DB Services category.
    3. Select True.
    4. Click Invoke.

      The returned result page displays all partitions from UCMDB (records in the URM_RESOURCES table) and DB (physical tables in DB), and also the delete statements generated.

      The delete statements are generated depending on the values from the infrastructure settings History Months To Save Back and History purging extra months to save back removed data.

      In the screenshot above, you can see that there exists partitions from last year ( 2017 - “hist_17” ) until June 2018 ( “hist_1806” ).

  2. Delete partitions

    1. To delete old UCMDB history partitions (from the URM_RESOURCES table), copy the first statement from the result page and then run it in the DB context.

    2. To delete old DB history partitions, copy the second statement from the result page and then run it in the DB context.

    3. The output will be a set of DROP TABLE statements which needs to be run in the DB context for the actions to take place.

  3. After running the scripts on DB, check if all old history partitions were cleaned, by invoking the same PurgeHistoryTroubleshooting JMX method with the flag setting to False.

Logging

The calls of the PurgeHistoryTroubleshooting JMX method are logged in the history.purge.log file (<UCMDBServer>\runtime\log) along with the timestamp, DB stored procedure used, value of parameters (settings).

When invoking PurgeHistoryTroubleshooting with the flag setting to true, both DB stored procedures ( SPU_SHOW_HIST_PARTITIONS and SPU_DELETE_HIST_PARTITIONS) will be executed; whereas invoking it with the flag setting to false, only the SPU_SHOW_HIST_PARTITIONS procedure will be executed.