MicroStrategy ONE

Purge Platform Analytics Warehouse

It may become necessary to purge some of the data collected and stored in the Platform Analytics warehouse. If a large volume of stored data begins to negatively affect the performance of the Platform Analytics Consumer, or if some metadata or projects have been dropped from an environment, the commands listed in this section allow administrators to remove the associated data from the Platform Analytics warehouse.

The commands used to purge Platform Analytics warehouse data are based on different criteria, including:

  • Metadata: You can purge data from some specific metadata.
  • Projects: You can purge data from specific projects, but all those projects must be in one metadata.
  • Deleted Objects: You can purge the deleted objects and related data.
  • Deleted Projects: You can purge the deleted projects and related data.
  • DaysToKeep: You can purge data and only keep the latest data with the given number of days.

MicroStrategy provides the following valid commands to purge Platform Analytics warehouse:

Step 1 - Modify Purge Configuration File

The purgeConfig.yaml file is located in the Platform Analytics conf directory. Simply uncomment each command you would like to execute by removing the # in front of each line. There are six parameters that control the various purge commands:

  • doTestBeforePurge: The default value is true. Set to false to skip testing before command execution.

  • commandName: The name of the command to execute.

  • onlyDeletedProjects: Set to true to purge only deleted projects.

  • onlyDeletedObjects: Set to true to purge only deleted objects.

  • metadataList: By default data will only be purged from the Platform Analytics warehosue. Provide a list of metadata ids to apply the purge actions to specific metadata only.

  • projectList: By default data will only be purged from the Platform Analytics warehosue. Provide a list of project guid values to apply the purge actions to specific projects only.

  • daysToKeep: If this value is 0, it will purge all the fact table. Assume this value is a, then we will keep fabs(a) days data.

Step 2 - Execute Data Purge

  1. Open a terminal window and navigate to the Platform Analytics folder.
  2. Execute the purge script:

    Windows: platform-analytics-purge-warehouse.ps1

    Linux: ./platform-analytics-purge-warehouse.sh

  3. If you have enabled doTestBeforePurge the purge information will be displayed. Enter Y or N to confirm or abort the purge of the listed data.

View Purge Statistics

The Platform Analytics warehouse contains the purge_statistic table to track the purge operations that have been executed. Each record contains the following important information:

  • id: This column is just the Id to identify a record.
  • execute_time: This column is the time in milliseconds to execute a populate or delete SQL query.
  • insert_ts: The timestamp of when the query finished executing.
  • purge_command_id: For each purge command, it will generate a purge_command_id to identify a purge command.
  • purge_command_name: The current purge command's name.
  • rows: How many rows this query effects.
  • table_name: What table this query has effected.