1.48 Maintenance

To perform maintenance you can interact with the maintenance resource. You should use POST or PUT as method for requests. The following requests are available.

Analytics tables clear will drop all analytics tables:

/api/26/maintenance/analyticsTablesClear

Expired invitations clear will remove all user account invitations which have expired:

/api/26/maintenance/expiredInvitationsClear

Period pruning will remove periods which are not linked to any data values:

/api/26/maintenance/periodPruning

Zero data value removal will delete zero data values linked to data elements where zero data is defined as not significant:

/api/26/maintenance/zeroDataValueRemoval

Drop SQL views will drop all SQL views in the database. Note that it will not delete the DHIS2 SQL views.

/api/26/maintenance/sqlViewsDrop

Create SQL views will recreate all SQL views in the database.

/api/26/maintenance/sqlViewsCreate

Category option combo update will remove obsolete and generate missing category option combos for all category combinations:

/api/26/maintenance/categoryOptionComboUpdate

Cache clearing will clear the application Hibernate cache and the analytics partition caches:

/api/26/maintenance/cacheClear

Re-generate organisation unit path property (can be useful if you imported org units with SQL):

/api/26/maintenance/ouPathsUpdate

Data pruning will remove complete data set registrations, data approvals, data value audits and data values, in this case for an organisation unit.

/api/26/maintenance/dataPruning/organisationUnits/<org-unit-id>

Data pruning for data elements, which will remove data value audits and data values.

/api/26/maintenance/dataPruning/dataElement/<data-element-uid>

Metadata validation will apply all metadata validation rules and return the result of the operation:

/api/26/metadataValidation

Maintenance operations are supported in a batch style with a POST request to the api/maintenance resource where the operations are supplied as query parameters:

/api/26/maintenance?analyticsTablesClear=true&expiredInvitationsClear=true&periodPruning=true
  &zeroDataValueRemoval=true&sqlViewsDrop=true&sqlViewsCreate=true&categoryOptionComboUpdate=true
  &cacheClear=true&ouPathsUpdate=true