> Source: [sk92889](https://support.checkpoint.com/results/sk/sk92889)

# sk92889 - Connecting with SmartDashboard to Management Server and/or MDS Backup operation takes long time due to oversized Hit Count table

| Property | Value |
|----------|-------|
| Solution ID | sk92889 |
| Date Created | 2013-05-27 |
| Last Modified | 2023-03-23 |
| Technical Level | General |
| Products | Security Management Server, Multi-Domain Security Management Server |
| Versions | R82.10, R82, R81.20, R82.20 |
| OS | Windows, Linux, Gaia |

## Symptoms

- * Connection to Management Server with SmartDashboard takes long time.  

* SmartDashboard hangs at "`55% Loading Rules`".  

* The Hit Count table file `$FWDIR/conf/hit_count_rules_table.sqlite` on the Management Server is very large.  

* MDS Backup operation takes long time on Multi-Domain Security Management Server.  

* 'No rule bases exist for the policy package' error when connecting with SmartDashboard.

## Cause

* The Security Management server queries the managed Security Gateways few times a day for the Hit Count statistics of every rule in the rulebase. Every reply should be added to the current day hits. Instead, every reply creates a new entry. As a result, the Hit Count table becomes very large (as a rule of thumb - more than 700-800 MB).
* Hit Count file *$FWDIR/conf/hit_count_rules_table.sqlite* has become very large on Security Management Server / Domain Management Server (as a rule of thumb - more than 700-800 MB).

## Solution

This problem was fixed. The fix is included in:

* [Check Point R75.47](http://supportcontent.checkpoint.com/solutions?id=sk93448) ^(\*)^
* [Check Point R77](http://supportcontent.checkpoint.com/solutions?id=sk92965) ^(\*)^

Check Point recommends to always [upgrade to the most recent version](https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doShowproductpage&productTab=downloads&product=184).

^(\*)^ **Note:** The described issue will not occur if this version was a Clean Install. However, issue might still occur if you Upgraded to this version. In such case, follow the instructions below.

For **other / upgrade versions** , follow these steps:  

***Important: The below procedure should NOT be run on a daily basis.***

1. Download the "Hit Count unification tool" for the relevant Management Server to your computer:

   |------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
   | Operating System of Security Management Server / Multi-Domain Security Management Server | R75.40, R75.40VS, R75.45, R75.46, R75.47 ^(\*)^, R76, R77 ^(\*)^, R77.10 ^(\*)^, R77.20 ^(\*)^, R77.30 ^(\*)^                                                            |
   | Gaia / SecurePlatform / Linux / Solaris                                                  | [![](https://sc1.checkpoint.com/sc/images/download-m.png "R75.40 Hit Count unification tool - Gaia OS")](http://supportcontent.checkpoint.com/file_download?id=25034)    |
   | IPSO                                                                                     | [![](https://sc1.checkpoint.com/sc/images/download-m.png "R75.40 Hit Count unification tool - IPSO OS")](http://supportcontent.checkpoint.com/file_download?id=25035)    |
   | Windows                                                                                  | [![](https://sc1.checkpoint.com/sc/images/download-m.png "R75.40 Hit Count unification tool - Windows OS")](http://supportcontent.checkpoint.com/file_download?id=25036) |

   \* Note: The described issue will not occur if this version was a Clean Install. However, issue might still occur if you Upgraded to this version. In such case, use this tool on the upgraded version.
2. Transfer the archive file (*Hit_Count_Unification_Tool_sk92889.tar* / *Hit_Count_Unification_Tool_sk92889.zip*) to your Management Server into some directory:

   * Management Server running on Gaia / SecurePlatform / Linux / IPSO / Solaris OS:  
     for example, ***/some_path/***

   * Management Server running on Windows OS:  
     for example, ***C:\\some_path\\***

3. Close all SmartConsole windows (SmartDashboard, SmartView Tracker, SmartView Monitor, etc.).  
   If SmartConsole client is connected, running the tool might fail!

4. Connect to command line on your Security Management Server / Multi-Domain Security Management Server.

5. Log in to Expert mode.

6. Unpack the archive file (TAR / ZIP):

   * Management Server running on Gaia / SecurePlatform / Linux / IPSO / Solaris OS:

     ```
     [Expert@HostName]# cd /some_path/
     [Expert@HostName]# tar -xvf Hit_Count_Unification_Tool_sk92889.tar
     ```

   * Management Server running on Windows OS:

     Go to ***C:\\some_path\\*** .  
     Use either Windows Explorer, or any application that works with archives (WinRAR, WinZIP, 7-zip, TUGZip, IZArc, etc.) and unpack the ***Hit_Count_Unification_Tool_sk92889.zip*** file.
7. Assign the relevant permissions to new files:

   * Management Server running on Gaia / SecurePlatform / Linux / IPSO / Solaris OS:

     ```
     [Expert@HostName]# chmod 777 sqlite3
     [Expert@HostName]# chmod 777 hit_count_unification_tool.sh
     ```

   * Management Server running on Windows OS:

     Skip this step.
8. Copy the Hit Count Unification Tool files to the relevant directory:

   * Security Management Server running on Gaia / SecurePlatform / Linux / IPSO / Solaris OS:

     Copy the files to *$FWDIR/conf/* directory:

     ```
     [Expert@HostName]# cp -v /some_path/sqlite3 $FWDIR/conf/
     [Expert@HostName]# cp -v /some_path/hit_count_unification_tool.sh $FWDIR/conf/
     ```

   * Multi-Domain Security Management Server running on Gaia / SecurePlatform / Linux OS:

     Copy the files to *$FWDIR/conf/* directory in *each* involved Domain Management Server:

     ```
     [Expert@HostName]# mdsenv Domain_Name
     [Expert@HostName]# mcd conf
     [Expert@HostName]# cp -v /some_path/sqlite3 $FWDIR/conf/
     [Expert@HostName]# cp -v /some_path/hit_count_unification_tool.sh $FWDIR/conf/
     ```

   * Security Management Server running on Windows OS:

     Either use Windows Explorer, or Windows Command Prompt to copy these files to *%FWDIR%\\conf\\* folder:
   * *hit_count_unification_tool.bat*
   * *sqlite3.exe*
   * *unit_rows_commands.txt*
9. Back up the current Hit Count database:

   **Important Note:** To avoid a possible corruption in the sqlite database by copying it in a middle of a transaction, it is recommended to follow this action plan:
   1. Stop all Check Point services with '**cpstop**' command
   2. Create a back up of the current Hit Count database with '**cp**' command
   3. Start all Check Point services with '**cpstart**' command

   Instructions for creating a back up of the current Hit Count database:
   * Security Management Server running on Gaia / SecurePlatform / Linux / IPSO / Solaris OS:

     ```
     [Expert@HostName]# cp -v $FWDIR/conf/hit_count_rules_table.sqlite $FWDIR/conf/hit_count_rules_table.sqlite_ORIGINAL
     ```

   * Multi-Domain Security Management Server running on Gaia / SecurePlatform / Linux OS:

     Backup the database in the context of *each* involved Domain Management Server:

     ```
     [Expert@HostName]# mdsenv Domain_Name
     [Expert@HostName]# mcd conf
     [Expert@HostName]# cp -v $FWDIR/conf/hit_count_rules_table.sqlite $FWDIR/conf/hit_count_rules_table.sqlite_ORIGINAL
     ```

   * Security Management Server running on Windows OS:

     1. Open ***%FWDIR%\\conf\\*** folder in Windows Explorer (or any File Manager application).

     2. Right-click on the ***hit_count_rules_table.sqlite*** file - select '*Copy*'.

     3. Right-click on an empty white space in this window - select '*Paste*'.

10. Run the tool to reduce the size of *hit_count_rules_table.sqlite* file:

    * Security Management Server running on Gaia / SecurePlatform / Linux / IPSO / Solaris OS:

      ```
      [Expert@HostName]# sh $FWDIR/conf/hit_count_unification_tool.sh
      ```

    * Multi-Domain Security Management Server running on Gaia / SecurePlatform / Linux OS:

      Run the script from the context of *each* involved Domain Management Server:

      ```
      [Expert@HostName]# mdsenv Domain_Name
      [Expert@HostName]# mcd conf
      [Expert@HostName]# sh $FWDIR/conf/hit_count_unification_tool.sh
      ```

    * Security Management Server running on Windows OS:

      Right-click on the ***hit_count_unification_tool.bat*** in the ***%FWDIR%\\conf\\*** folder - select '*Run as administrator*'.

    Comments:
    * Tool will unite rows in the Hit Count table and will leave only one row per rule-gateway-day.

    * Depending on the current size of the Hit Count database, this operation may take some time (e.g., for 1.7 GB table it might take \~15 minutes; for 2.3 GB table it might take \~2.5 hrs...).

    * Upon success, '*Database was updated successfully!*' message should be displayed.

    * If "*Error: near line 11: database is locked*" is displayed on the screen, it might be due to lock of the Hit Count table. In such case, try to re-run the tool.

    * If "*Error: near line 11: no such column: UUID: error message*" is displayed on the screen, it might be due to corruption of the Hit Count table during an upgrade of Security Management Server. In such case, try to run the tool for the previous version of Security Management Server (version prior to upgrade).

    * If "*Error: near line 49: table hitcountrules has X columns but Y values were supplied* " is displayed on the screen, it might be due to the missing "`UUID`" field in the select query in the *hit_count_unification_tool* script.

      Manually add the missing "`UUID`" field in the *hit_count_unification_tool* script.:

      ```
      SessionId,
      UUID,
      max(end_date) as end_date,
      ```

    * Check Point is working on a permanent solution for this issue. Until further notice, monitor the size of *hit_count_rules_table.sqlite* file and re-run the tool based on the symptoms described above.

11. Stop Check Point services on the Security Management Server / Multi-Domain Security Management Server:

    * Security Management Server running on Gaia / SecurePlatform / Linux / IPSO / Solaris OS:

      ```
      [Expert@HostName]# cpstop
      ```

    * Multi-Domain Security Management Server running on Gaia / SecurePlatform / Linux OS:

      ```
      [Expert@HostName]# mdsstop_customer Domain_Name
      ```

    * Security Management Server running on Windows OS:

    Open the Windows Command Prompt and run the

    ***cpstop*** command.
12. Delete the SmartConsole cache as described in [sk100507](http://supportcontent.checkpoint.com/solutions?id=sk100507).

13. Start Check Point services on the Security Management Server / Multi-Domain Security Management Server:

    * Security Management Server running on Gaia / SecurePlatform / Linux / IPSO / Solaris OS:

      ```
      [Expert@HostName]# cpstart
      ```

    * Multi-Domain Security Management Server running on Gaia / SecurePlatform / Linux OS:

      ```
      [Expert@HostName]# mdsstart_customer Domain_Name
      ```

    * Security Management Server running on Windows OS:

    Open the Windows Command Prompt and run the

    ***cpstart*** command.

---

# Agent Instructions

This content is from the Check Point Support Center (https://support.checkpoint.com), the official knowledge base for Check Point cybersecurity products.

## Navigating This Knowledge Base

- **Complete index**: [llms.txt](https://support.checkpoint.com/llms.txt)
- **All SK articles**: [SecureKnowledge Sitemap](https://support.checkpoint.com/sitemaps/secureknowledge-sitemap-index.xml)
- **SK article URL pattern**: `https://support.checkpoint.com/results/sk/{skId}`
- **Markdown responses**: AI bot User-Agents automatically receive `text/markdown` content
