> For the complete documentation index, see [llms.txt](https://help.security.gallagher.com/knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/server-properties/database-maintenance.md).

# Database Maintenance

### Introduction

This tab allows a site to:

* initiate a daily update of database statistics.
* purge Cardholder history, and/or if a site is licensed for the Visitor Management feature, they can set the parameters for when expired visits will get purged from the system.
* configure how much memory SQL Server uses.

If you have the "View Site" operator privilege, you will be able to view this tab, but you will not be able to alter any of the fields. However, the "Edit Site" operator privilege allows you to view and edit fields on this tab.

### Procedure

1. Open the **Command Centre Server Properties** window. [How?](https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/server-properties/opening-the-server-properties-window.md)
2. Click the **Database Maintenance** tab.

   ![](https://3000903572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfCvaxj3suxNBzdwQndVT%2Fuploads%2Fgit-blob-46aec06a271275e4977cb9a2de457752cb74d1e8%2Fdatabasemtcetab.png?alt=media)
3. If your site licensed for Visitor Management, enter the length of time that visits are to be kept before they become eligible for purging, in the **Purge expired visits older than** field.

   (Default = 365. Must be a whole number between 1 and 9999 inclusive)

   **Note:** The "purge process" for expired visits is run every day and cannot be disabled.
4. Do you want to purge Cardholder history?

   <table><thead><tr><th width="72">If...</th><th>then...</th></tr></thead><tbody><tr><td>no</td><td>go to Step 5.</td></tr><tr><td>yes</td><td>check the <strong>Purge cardholder history older than</strong> checkbox, and enter the length of time Cardholder history is to be kept before it becomes eligible for purging.<br>(Default = 365. Must be a whole number between 1 and 9999 inclusive)</td></tr></tbody></table>
5. If your site is licensed for Shifts, the **Purge shift history older than** option displays. Do you want to purge Shift history?

   <table><thead><tr><th width="72">If...</th><th>then...</th></tr></thead><tbody><tr><td>no</td><td>go to Step 6.</td></tr><tr><td>yes</td><td><p>check the <strong>Purge shift history older than</strong> checkbox, and enter the length of time shift history is to be kept before it becomes eligible for purging.</p><ul><li>If a Shift item was deleted more than this many days ago, it will be purged so that it can no longer appear in Time Reports and Time Report - Overviews that report on historical periods.</li><li>If a Cardholder was un-assigned from a Shift more than this many days ago, the association between the Cardholder and the Shift is purged, so that Time Reports and Time Report - Overviews that report on historical periods can no longer report this Cardholder as having worked this Shift.</li></ul><p>Default = 365. Must be a whole number between 1 and 9999 inclusive.</p></td></tr></tbody></table>
6. Tick the **Optimise Indexes and update database statistics** checkbox.

   Gallagher recommend sites optimise indexes and update statistics daily at a time when the system is least busy.

   **Note:** A Database Maintenance Error event will be raised if the statistics update errors due to database permissions, lack of disk space, database corruption or other reason.
7. The time of day in the **Perform database maintenance every day at** field relates to updating statistics and purging cardholder history. It will also include purging expired visits if your site is licensed for Visitor Management.

   Enter a suitable time of day for database maintenance to run.

   (Default purge time = 3:00am local time; according to the time zone of the server)

   **Note:** The date and time shown in the 'read-only' **Maintenance last completed** field allows you to check that the database maintenance is running as expected on a daily basis.
8. Are the SQL Server Memory fields read-only or editable?

   <table><thead><tr><th width="114">If...</th><th>then CCFT has been installed using the...</th></tr></thead><tbody><tr><td>read-only,</td><td>'Network Service' service accounts.<br>These fields cannot be changed.</td></tr><tr><td>editable,</td><td>'NT Authority\System' service account.<br>Configure how much memory SQL Server uses by altering the <strong>Minimum</strong> and/or <strong>Maximum</strong> values.<br><br><strong>Note:</strong> By setting the maximum amount of memory SQL Server can use, this will ensure other applications are able to run and perform well.</td></tr></tbody></table>
9. Click **OK** to exit and save your changes.

   Click **Cancel** to exit without saving your changes.

   Click **Apply** to save your changes and stay in this window.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/server-properties/database-maintenance.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
