It is highly recommended for administrators to run the Qlik Sense Enterprise clean-up script before upgrading to Qlik Sense Enterprise 2.2 or 3.x, if the repository database has large amounts of data.
The cleanup script can also be executed after upgrading to Qlik Sense Enterprise 2.2 or 3.x, and also for version June/11.x and newer if this script was never run before upgrading.
It is recommended in an instances where the Qlik Sense Repository service can not start due to database query timeouts or other database issues. If using Sense version June 2017 (11.x) or newer, please use the new "recursive" database cleanup script. See No Hub or QMC access after upgrade to Sense November 2017 or higher - recursive script
The cleanup script addresses bug QLIK-55229, Repository consumes a lot of ram if a large AD is imported with many user attributes.
Brief instruction for using the cleanup script can be found in attached readme.txt file. To access this file, please log in to the support portal. For full instructions please see below.
SenseClenupScript.ps1 is a Windows PowerShell script that executes SQL queries to:
Execute cleanup script
- Remove left over foreign key relations between entities for soft deleted items
- Remove soft deleted items that are older than 10 days
- Remove all soft deleted Users and UserAttributes
- Remove all FileReferences for logs that are older than 10 days
- Remove all Reload execution results with relations that are older than 10 days
- Stop all Qlik Sense services on all nodes.
- On the Central node, start only the Qlik Sense Repository Database service
- Run SenseCleanupScript.cmd as Administrator
- Select the installation path to Qlik Sense Enterprise, default location is C:\Program Files\Qlik\Sense\
- Enter the password for the database administrator ‘postgres’. Note, after pressing enter, it may take a few minutes. Be patient.
- When this is complete on the central node, stop the Qlik Sense Repository Database service.
- On the first rim node, start only the Qlik Sense Repository Database service.
- Run SenseCleanupScript.cmd on the first rim node, by repeating steps as described in steps 3 - 5.
- When this is complete, stop the Qlik Sense Repository Database service on the first rim node.
- Repeat steps 7 thru 9 for all remaining rim nodes.
- When all nodes have been cleaned up, start all Sense services only on the central node.
- Confirm all services are up and running on the central node by using the QMC.
- Start all Qlik Sense services on all RIM nodes.
This script does keep an error log and will be written to a location like the following:
If prompted with a message like below, then enter A for (yes to all) and continue the process:
Running SQL script
Finished running SQL script
Removing Sync transaction logs...
The item at
saction Logs\export has children and the Recurse parameter was not specified.
If you continue, all children will be removed with the item. Are you sure you
want to continue?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "Y"):