Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Security Expert SQL Express Purging Access Events

Building Automation Knowledge Base

Schneider Electric Building Automation Knowledge Base is a self-service resource to answer all your questions about EcoStruxure Building suite, Andover Continuum, Satchwell, TAC…

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Knowledge Center
  • Building Automation Knowledge Base
  • Security Expert SQL Express Purging Access Events
Options
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close

Related Forums

  • Intelligent Devices Forum

Previous Next
Contributors
  • Alan_Wood
    Alan_Wood

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to Building Automation Knowledge Base
Options
  • Bookmark
  • Subscribe
  • Email to a Friend
  • Printer Friendly Page
  • Report Inappropriate Content
1 Like
409 Views

Link copied. Please paste this link to share this article on your social media post.

Trying to translate this page to your language?
Select your language from the translate dropdown in the upper right. arrow
Translate to: English
  • (Français) French
  • (Deutsche) German
  • (Italiano) Italian
  • (Português) Portuguese
  • (Русский) Russian
  • (Español) Spanish

Security Expert SQL Express Purging Access Events

Admiral Alan_Wood Admiral
‎2025-01-15 10:38 AM

on ‎2025-01-15 10:38 AM

Warning

Potential for Data Loss: The steps detailed in the resolution of this article may result in a loss of critical data if not performed properly. Before beginning these steps, make sure all important data is backed up in the event of data loss. If you are unsure or unfamiliar with any complex steps detailed in this article, please contact Product Support for assistance.

Issue

Methods are needed to purge access events with Security Expert running on SQL Express

Product Line

EcoStruxure Security Expert

Environment

  • EcoStruxure Security Expert
  • Microsoft SQL Express
  • Microsoft SQL Server Management Studio (SMSS)

Cause

Security Expert operating on Microsoft SQL Express can exceed the 10GB limitation depending on configuration and system size

Resolution

There are several things to consider when configuring Security Expert when running on Microsoft SQL Express which has a 10GB size limitation and other limitations.

This article will address the following items: Backup of the SecurityExpert and SecurityExpertEvents databases, review of the database file sizes, automatically and/or manually purge access event records, shrink the database(s) to regain hard drive space, and return the system to operational status.

 

1. Create database backups for the SecurityExpert and SecurityExpertEvents databases
(Select a method)

a. Configure options in Security Expert under Global Settings> General> Main Database Backup

b. Use Microsoft SMSS. Right-click on the database, select Backup and complete the steps

Note: It is recommended to save the databases as different file names than the original database 

names to keep a copy of the database prior to deleting records.

2. Examine the database file sizes
a.  Observe the file size In Windows Explorer, Navigate to: 
C:\Program Files\Microsoft SQL Server\MSSQL(version).SECURITYEXPERT\MSSQL\DATA

Observe the file size of the SecurityExpertEvents database

If the site is using Microsoft SQL Express and the database file size is close to or over 10GB,

events will need to be purged.

SX DB File Size.png
Note: SecurityExpertEvents files. One file is the transaction log and the other is the data file.
The file highlighted above is the data file.
b. Check the Windows Application log:
There may be a message with evidence of database size issues in the Windows application

log, i.e. "Primary Filegroup is FULL"
SX DB Primary Full App Event.png
3. Check the database recovery model configured for both databases in SMSS

If "FULL" is used instead of SIMPLE the database(s) will grow quickly

SX DB Recovery Model Full.png

See the following KB article for more details on Recovery Mode:
https://community.se.com/t5/Building-Automation-Knowledge/Security-Expert-functionality-starts-to-de...
An article with additional details about the database table sizes:
https://community.se.com/t5/Building-Automation-Knowledge/Security-Expert-Database-Table-Sizes/ta-p/...
4. Purge the SecurityExpertEvents db (Select a method)
a. Purge using Security Expert
Under Global Settings> General> Events Database
Configure Purge events older than – there is a drop-down with a list of selections
SX Global Settings Events Purge.png
See the Security Expert About> Help for more information.
Search on Purge and select Global Settings
Note: It’s best practice to delete a month or so at a time. Deleting many events at a time can 

cause the server to time out.


After the Security Expert purge, use SMSS to Shrink DB and Shrink File
(These actions remove the recently deleted records from the hard drive freeing up space
Right-click on the SecurityExpertEvents database> Shrink> database
Right-click on the SecurityExpertEvents database> Shrink> File

b. Manually delete access events using SQL queries
In SMSS, run the following query to retrieve all access events and make note of the number of

records
select * from events order by logged time asc
Example: Note 2840 rows

   
To purge the records run the following query:
(Caution: these records will be removed from the database)

Use SecurityExpertEvents;
Delete from dbo.Events
Where LoggedTime BETWEEN
'2024-06-13' AND '2024-06-14'
Adjust the above query to reflect the dates required)

8 rows affected

select * from events order by logged time asc – after running the delete query
Example:2832 rows
Note: It’s best practice to delete a month or so at a time. Deleting lots of events at a time can 

cause the server to time out.
c. Shrink database
This action removes the recently deleted records from the hard drive freeing up space
Right-click on the SecurityExpertEvents database> Shrink> database

5. Verify Security Expert functionality
Once the purge and shrink are completed, verify Security Expert is operating normally
Note: If the system is not working normally, restoring a previous version of the database(s) from earlier backups may be necessary that were taken before exceeding the 10GB limitation.

DBCC is a Microsoft tool for checking the integrity of a SQL database which is beyond the scope of SE Product Support. Please refer to Microsoft's documentation on this subject or consult a Database Analyst.

Labels (1)
Labels:
  • EcoStruxure Security Expert
Tags (1)
  • Find more articles tagged with:
  • AlanWood25
Was this article helpful? Yes No
No ratings

Link copied. Please paste this link to share this article on your social media post.

To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of