Cleaning and converting the shared files

The QlikView shared file cleaning tool is a command line tool that allows system administrators to verify (analyze) and purge (repair) shared files. This tool can also be used to convert between different shared file formats, see Converting the shared files. You can invoke it 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 uses the suffix _clean after the format (.Shared or .Tshared), and the original shared file is not overwritten. You can then decide to replace the original shared file with the clean version.

Converting the shared files

When you create shared files, you can save them in original or transactional format. The original format is recognizable by the .Shared ending, while the transactional shared file format ends with .TShared. A shared file using the transactional .TShared format is more reliable in case of failures, such as network issues, power outages, or insufficient storage space on disk. We recommend to use the .TShared format for files larger than 2 GB, because this format can handle file size up to 16 EB (exabyte).

You can use the two different formats, original and transactional, simultaneously for different applications on the same server. However, only one format (either .Shared or .TShared) should be used in a given application. You can decide which format to use when creating a new shared file by configuring the Settings.ini file. For QlikView Server, the Settings.ini file is located in C:\ProgramData\QlikTech\QlikViewServer.

Set the file format:

DefaultBlobDbType=0
With this setting, the .Shared format is used when creating new shared files.

DefaultBlobDbType=1
With this setting, the .TShared format is used when creating new shared files.

You can also convert the shared files using the QlikView shared files cleaning command as shown in the tab below, and in the example n.4 in the Examples section at the bottom of the page.

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> <Output format> <Ownership> <Delete_user_entries> [-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.
Cleaning_tool_mode
  • -p for purge mode
  • -v for verify mode
Output format

[Optional] The -f (specify output format) parameter allows to use the cleaning tool to convert between shared file formats.

The format can be specified as same, orig or tx (e.g. -f tx).

  • same the file format of the input file will be used
  • orig the original .Shared format is used as output format
  • tx the .TShared (transactional file) format is used as output format

When the format (-f parameter) is not specified, the default option is same.

Ownership
  • -so user to set ownership
  • -ro from_user to_user to replace ownership
Delete_user_entries
  • -du0 user deletes non-shared entries from the user

  • -du1 user deletes all entries from the user

This field accepts a path to a file if more than one user needs to be removed

  • -df0 file.txt deletes non-shared entries from the users listed in the file file.txt
  • -df1 file.txt deletes all entries from the users listed in the file file.txt

To obtain a list of users that have accessed the QlikView servers, the Governance Dashboard application can be used. It is available for free in our download site (see associated documentation here).

The list of users can be easily extracted by exporting to 'csv' format the ListBox 'Athenticated User' in the Operations/Session sub-tab of the Governance Dashboard. This list can then be edited (keep only the users to be removed from the shared file) and passed on to the Cleaning Tool as an input.

-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.

Using the shared file cleaning tool

The share file cleaning tool is run by using the Windows Command Prompt in Administrator mode. Do the following: 

It is recommended to run the cleaning tool with a copy of the QVS.exe and the shared file in a (temporary) folder different from %ProgramData%Qliktech\Documents. The user running the cleaning tool on the %ProgramData%Qliktech\Documents folder must have administrator rights over it.

The cleaning process completely regenerates the shared file. Issues regarding fragmentation of the file will disappear and file size and access time may be reduced.
You can run the cleaning tool for a folder by using the option -subF. It is very important to take into account that the list of users to be removed will be common to all shared files within the folder.
Backup your shared files before using the cleaning tool.
  1. Create a copy of the QVS executable. By default the QVS.exe is installed in C:\Program Files\QlikView\Server .
  2. Navigate to the folder where the copy of the QVS.exe is located and run the cleaning tool in verify mode. For example:
    "C:\<Temporary_path>\QVS.exe –x “C:\ProgramData\QlikTech\Documents\FinanceAnalysis.qvw.Shared” –v
  3. Locate the CleaningTool_MACHINENAME.log verify 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 corrupted 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 file identified by the suffix _clean (for example: MYFILENAME.QVW.TShared_clean) is placed in the same folder as the source shared file.

  5. 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 no QlikView Server services are running.

Examples

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.TShared" -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.TShared" -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

Example 4: Changing output format

Running the following command in the windows command prompt allows to convert a file in the original shared file format to the new format:

QVS.exe -x "C:\Temp\1.QVW.Shared" -p -f tx

Example 5: Removing non-shared entries from a specific user

Running the following command in the windows command prompt removes all non-shared entries associated to a specified user UserX:

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

Example 6: Removing all entries from a set of users specified in a text file

Running the following command in the windows command prompt removes all entries (including the ones that are shared) associated to a list of specified users in the Users.txt column text file.:

QVS.exe -x "C:\ProgramData\QlikTech\Documents\TESTFILE.QVW.Shared" -p -df1 "C:\temp\Users.txt"

Example of the Users.txt file:

DOMAIN\User1

DOMAIN\User2

DOMAIN\User3

DOMAIN\UserX

Example 7: Removing all entries from a set of users specified in a text file for a whole folder

There is also the possibility of processing a whole set of shared files contained within a folder with a common list of users to be removed from them.

Running the following command in the windows command prompt removes all (including the ones that are shared) entries associated to a list of specified users in the Users.txt column text file. For all shared files within the folder 'Documents':

QVS.exe -x "C:\ProgramData\QlikTech\Documents" -p -subF -df1 "C:\temp\Users.txt"

Example of the Users.txt file:

DOMAIN\User1

DOMAIN\User2

DOMAIN\User3

DOMAIN\UserX

Did this information help you?

Can you tell us why it did not help you and how we can improve it?

Thanks for helping us improve!