Resolving Long WinCC Runtime Activation Delays Caused by SQL Message Archive Segmentation in PCS 7
Prolonged WinCC runtime activation times (such as taking 30 minutes to start up) on mature SIMATIC PCS 7 systems are primarily caused by Microsoft SQL Server mounting excessive historical archive segments. In accordance with Siemens guidelines (Entry ID 34473263), the total number of connected single archive segments across Alarm Logging, Tag Logging Fast, and Tag Logging Slow should never exceed 200 segments. When years of unmanaged data accumulate, SQL Server must verify and attach hundreds of MDF and LDF database files at startup. Engineers must configure automated archive backups, detach obsolete segments from the project directory, and prune segment retention limits.
Table of Contents
- Executive Summary
- Root Cause Analysis: Why Excessive Archive Segments Stall Runtime Startup
- The 200-Segment Threshold and SQL Server Attachment Mechanics
- Configuring Archive Limits in Alarm Logging and Tag Logging
- Step-by-Step Procedure to Prune and Detach Historical Archives
- Archive Segmentation Guidelines and Performance Thresholds Matrix
- Verification
- Long-Term Archiving Best Practices with Process Historian
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
After operating a SIMATIC PCS 7 process plant continuously for several years, maintenance personnel often observe that deactivating and reactivating WinCC Runtime on an Operator Station (OS Server or Single Station) requires 20 to 45 minutes to reach an operational state. During this prolonged startup window, the WinCC DataManager and Microsoft SQL Server consume high CPU and disk I/O resources, temporarily freezing graphic screen loading and alarming services. This operational bottleneck is rarely caused by operating system degradation; rather, it is the direct consequence of accumulating hundreds or thousands of unpruned historical archive segments (*.mdf / *.ldf) inside the project's archiving folder. This technical article details SQL segment attachment mechanics and provides actionable procedures to restore sub-two-minute runtime activation.
Root Cause Analysis: Why Excessive Archive Segments Stall Runtime Startup
SIMATIC PCS 7 utilizes Microsoft SQL Server to manage real-time process data, operator actions, and alarms:
- Partitioned Archiving: Rather than storing years of continuous operational records in a monolithic database file, WinCC segments historical data into discrete chunks called single segments across three distinct subsystems:
* Alarm Logging: Records process alarms, operator interventions, and system messages.
* Tag Logging Fast: Records high-frequency analog and digital trend values (cyclic acquisition <= 1 minute).
* Tag Logging Slow: Records low-frequency trend values (cyclic acquisition > 1 minute). - The Startup Attachment Overhead: When WinCC Runtime activates, the WinCC Archive Manager calls SQL Server routines to mount every database segment present in the
CommonArchivingfolder. Each segment requires file system locks, transaction log replay, internal consistency checks, and memory buffer allocation. - Cumulative Lag: When an automation station runs for five to six years without automated segment purging or backup detachment, the number of mounted segments can exceed 1,500. Attaching this volume of database files overwhelms disk queues, stretching startup time from two minutes to over half an hour.
The 200-Segment Threshold and SQL Server Attachment Mechanics
Siemens technical guidelines (documented in Siemens FAQ 34473263) establish a definitive performance ceiling:
- Maximum Segment Limit: The sum of all active connected single segments (
Alarm Logging+Tag Logging Fast+Tag Logging Slow) connected to the local WinCC SQL Server instance must not exceed 200 segments. - System Degradation Curve: When connected segments exceed 200, SQL Server metadata indexing degrades non-linearly. Exceeding 400 segments risks random runtime lockups, slow trend display rendering, delayed alarm generation, and severe startup latency.
- Retention Boundary: If a project requires retention periods of several years, local OS Server databases must not be used as the permanent repository. Long-term records must be transferred to an enterprise historian.
Configuring Archive Limits in Alarm Logging and Tag Logging
To enforce strict segment limits in the WinCC engineering environment:
- Open WinCC Explorer on the OS Server.
- Open Alarm Logging (or Tag Logging), right-click the root Archive Configuration folder, and select
Properties. - Under Message Archive properties:
* Set Maximum size of all segments: Specify a size boundary proportional to available hard disk capacity (e.g., 5 GB).
* Set Time period of all segments: Define a finite operational window (e.g., 1 Month or 3 Months).
* Set Max. size of a single segment and Time period covered by a single segment (e.g., 1 Day or 1 Week). - Check the box Activate backup: Configure a backup target path pointing to a separate physical disk, NAS share, or network vault.
- Repeat this exact configuration under Tag Logging Fast and Tag Logging Slow.
Step-by-Step Procedure to Prune and Detach Historical Archives
To immediately eliminate runtime startup delays on a running OS Server with thousands of accumulated segments:
- Deactivate WinCC Runtime: During a scheduled maintenance window, deactivate WinCC Runtime completely and close WinCC Explorer.
- Locate the Archiving Directory: In Windows File Explorer, open the project path:
<Project_Folder>\<OS_Name>\ArchiveManager\. - Inspect Subfolders: Inspect
AlarmLogging,TagLoggingFast, andTagLoggingSlow. - Relocate Older Database Files:
* Identify MDF and LDF segment files older than 30 to 60 days.
* Move these files out of the project directory to an external backup storage drive or network archive folder.
* Do not delete active segments corresponding to the current operational day. - Reset Active Database Connections: In WinCC Explorer, open the project and restart WinCC Runtime.
- Observe Startup Duration: SQL Server will now attach only the remaining recent segments (< 50 files), activating runtime in under two minutes.
Archive Segmentation Guidelines and Performance Thresholds Matrix
The following engineering table outlines sizing thresholds and configuration parameters for WinCC archive management:
Verification
To verify that archive pruning successfully restored system performance:
- Runtime Startup Benchmark: Deactivate WinCC Runtime and measure the time required to re-activate runtime. Confirm that runtime activation completes within 60 to 120 seconds.
- SQL Segment Count Verification: Open Windows Command Prompt and execute a query via
sqlcmdor inspect SQL Server Management Studio (SSMS) under the WinCC instance. Confirm that attached single segment databases count fewer than 200. - Alarm and Trend Responsiveness: Open the WinCC Alarm Control and historical trend screens. Verify that operator screen navigation and historical curve queries load instantaneously without SQL Server timeout faults.
Long-Term Archiving Best Practices with Process Historian
For industrial manufacturing facilities subject to regulatory compliance (FDA 21 CFR Part 11, GAMP, or environmental reporting) requiring years of historical data retention:
- Deploy SIMATIC Process Historian (PH): Offload historical data from local OS Servers to a centralized SIMATIC Process Historian. Local OS Servers retain only 1 to 2 weeks of operational cache, while the Process Historian provides scalable long-term storage.
- Reporting Integration: Utilize SIMATIC Information Server (IS) to generate automated web-based reports directly from the Process Historian repository without placing load on plant operating stations.
- Automated Archive Purging: Configure the WinCC Archive Backup service to purge backed-up local files automatically once they have been successfully transmitted to secondary storage.
Limitations and Operational Precautions
Never manually delete or move active archive segments while WinCC Runtime is running. Manipulating active MDF/LDF files during runtime can corrupt the SQL transaction log and crash the WinCC DataManager.
When procuring additional storage hardware, OS archive expansion licenses (such as WinCC Archive Tags licenses), or SIMATIC Process Historian software packages, all configurations and MLFBs must be validated against official Siemens catalogs and confirmed through an authorized Siemens distributor quotation.
Engineer FAQ
Can detached historical segments be viewed later if needed?
Yes. Detached archive segments can be temporarily re-attached to the WinCC runtime via the Alarm Logging or Tag Logging 'Link archive' function for ad-hoc auditing.
What is the hard upper limit for SQL Server database attachments?
While Microsoft SQL Server has higher theoretical boundaries, Siemens PCS 7 officially supports a maximum of 200 single segments to preserve real-time control performance.
Does Tag Logging Fast store data differently than Tag Logging Slow?
Yes. Tag Logging Fast uses highly compressed binary structures optimized for sub-minute process sampling, whereas Tag Logging Slow is designed for hourly or daily averages.
Will purging archive files delete the process graphics?
No. Graphic screens (*.pdl files) and project configuration databases are entirely independent of the historical archive segment files in the ArchiveManager directory.