Import Query Tracking

post

/essbase/rest/v1/applications/{applicationName}/databases/{databaseName}/settings/querytracking/import

Import query tracking data from a text file to an Essbase aggregate storage (ASO) database. Essbase tracks query data to optimize aggregate views based on usage.

When an ASO cube is refreshed or restarted, query data is not persisted. As an optimization technique, before refreshing or restarting, you can export query tracking data to a text file. To rebuild aggregate views after a refresh or restart, import the query tracking data from the text file. Essbase uses the query data to select the most appropriate set of aggregate views to materialize.

To perform this operation, query tracking must be enabled for the current ASO cube. Query tracking is enabled by default. To ensure that query tracking is enabled, use Get General Settings and ensure that queryTracking is true.

Request

Path Parameters
Body ()

File name.

Root Schema : QueryTrackingInputs
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

OK

Query data imported successfully.

400 Response

Bad Request

Failed to import query data.

500 Response

Internal Server Error.

Back to Top

Examples

The following example shows how to export and import query tracking data for an Essbase aggregate storage cube.

Workflow to Export / Import Query Tracking

  1. Verify that query tracking is enabled.

    curl -X GET "https://myserver.example.com:9001/essbase/rest/v1/applications/ASOSamp/databases/Basic/settings?links=none" -H "Accept:application/json"

    Response should be:

    {
      "general" : {
        "description" : "",
        "queryTracking" : true
      }
    }
    
  2. Run some queries in your test environment (or wait a while for normal usage queries to establish a pattern).

  3. Perform an aggregation based on query data.

    curl -X POST "https://myserver.example.com:9001/essbase/rest/v1/jobs?links=none" -H "Accept:application/json" -H "Content-Type:application/json" -d '{"application": "ASOSamp", "db": "Basic", "jobtype": "buildAggregation", "parameters": {"ratioToStop": "1.1", "basedOnQueryData": "true", "enableAlternateRollups": "false" }}' -u %User%:%Password%
  4. Export query tracking data to a file.

    curl -X POST https://myserver.example.com:9001/essbase/rest/v1/applications/ASOSamp/databases/Basic/settings/querytracking/export -H "accept: application/json" -H "Content-Type: application/json" -d '{ "fileName": "exportfile" }' -u %User%:%Password%
  5. To rebuild aggregate views after the cube is refreshed or restarted, import the query tracking data from the saved export file.

    curl -X POST https://myserver.example.com:9001/essbase/rest/v1/applications/ASOSamp/databases/Basic/settings/querytracking/import -H "accept: application/json" -H "Content-Type: application/json" -d '{ "fileName": "exportfile.txt" }' -u %User%:%Password%
Back to Top