Cleaning the shared files

The QlikView shared file cleaning tool is command line tool that allows system administrators to verify (analyze) and purge (repair) shared files. You can invoke this tool by running the QlikView Server executable (QVS.exe) with special parameters.

There are two modes available with the cleaning tool, each is specified by a different command-line parameter.

Verify mode

Use the -v parameter to analyze the shared file specified in the command-line. During analysis, the cleaning tool detects if there is one or more invalid or corrupted object entries. The QVS then logs as much information as possible about the invalid entries.

Purge mode

Use the -p parameter to verify the shared file and then create a new shared file with the corrupt entries removed. This clean version is placed into the same folder as the original. The new file is called MYFILE.QVW.Shared_clean and the original shared file is not overwritten. You can then make a decision to replace the original shared file with the clean version.

Setting and changing ownership of shared file content

You can change the owner of server objects with QMC, but for some object types (“DocumentContent”, “InputFieldValues” and “ObjectContent”) ownership cannot be changed this way. In this case you need to use the cleaning tool to change ownership, using the -so (set ownership) or -ro (replace ownership) parameters. These parameters should be used in purge mode.

Cleaning tool command format

The cleaning tool command format is as follows:

"<QVS_executable_path>" -x "<Shared_file_path>" <Cleaning_tool_mode> <Ownership> [-l "<Log_folder_path>"] [-rBM <BM_size>] [-o "<Shared_file_save_path>"]

The following table describes each command parameter.

Parameter Description
QVS_executable_path The full path to the system folder containing the QVS executable (QVS.exe).
-x The -x parameter tells the QVS to only run the cleaning tool.
Shared_file_path The path to the shared files to clean.

It accepts a path to a directory or a path to a file.

  • If invoked with a path to a folder, the operation applies to all shared files in the folder.
  • If a single file is specified, the operation is applied to this item only.
  • -p for purge mode
  • -v for verify mode
  • -so user to set ownership
  • -ro from_user to_user to replace ownership
-l Log_folder_path [Optional] If you want to change the location of the generated log file, use -l and provide a log folder path.
-rBM BM_size [Optional] The -rBM parameter is used to remove large bookmarks from the shared file. All bookmarks larger than <BM_size> (in bytes) will be removed.
-o Shared_file_save_path

[Optional] The -o parameter is used to change the path to where shared files are saved.

Example 1: Analyzing a shared file

Running the following command in the windows command prompt analyzes the shared file and creates a log file in the C:\logs folder: 

QVS.exe -x "C:\ProgramData\QlikTech\Documents\TESTFILE.QVW.Shared" -v -l "C:\logs"

Example 2: Setting file ownership

Running the following command in the windows command prompt sets ownership of the server objects in the shared file to user UserX: 

QVS.exe -x "C:\ProgramData\QlikTech\Documents\TESTFILE.QVW.Shared" -p -so UserX

Example 3: Replacing file ownership

Running the following command in the windows command prompt replaces ownership of the server objects in the shared file from UserX to UserY: 

QVS.exe -x "C:\ProgramData\QlikTech\Documents\TESTFILE.QVW.Shared" -p -ro UserX UserY

Using the shared file cleaning tool

The share file cleaning tool can be initiated by using the Windows Command Prompt in Administrator mode. Do the following: 

Note: Backup your shared files before using the cleaning tool.
  1. Navigate to the QVS executable. By default it is installed in C:\Program Files\QlikView\Server .
  2. Run the cleaning tool in verify mode. for example QVS.exe –x “C:\ProgramData\QlikTech\Documents\FinanceAnalysis.qvw.Shared” –v
  3. Locate the CleaningTool_MACHINENAME.logverify file log. If not specified in your command, the log is stored by default in C:\ProgramData\QlikTech\QlikViewServer.

    The log lists each type of shared file object if there is corruption. If the corrupt entry can be identified, it will list the object ID.

  4. If there are corrupt entries, run the cleaning tool again in purge mode.

    The purge process will create a new shared file with the corrupt objects removed or corrected. The new MYFILENAME.QVW.Shared_clean file is placed in the same folder as the source shared file.

  5. Note: The new file may be larger than the source file.
  6. Replace the old corrupt shared file with the new file. This must be done when there are no users accessing the application on the server.