Database Cleanup Script For Qlik Sense Enterprise 2.x and 3.xArticle Number: 000017620 | Last Modified: 2019/02/18
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 for details.
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.
- 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
- Make complete backup of the environment.
- Have your PostgreSQL administrator password available. This was chosen when you installed Qlik Sense Enterprise.
- Windows Management Framework 4.0 needs to be installed. Note, installing/upgrading this will require a reboot of Windows Server.
- If Windows Server 2012 R2 has issue to run the script, install Windows Management Framework 5.0 https://www.microsoft.com/en-us/download/details.aspx?id=50395
- 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.
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"):
Have a Question?
Search Qlik's Support Knowledge database or request assisted support for highly complex issues.Submit a case
Experiencing a serious issue, please contact us by phone. View phone numbers and hours by region.