Configuring Database Segment Sizes in WinCC and PCS 7: The 200 Single Segment Rule and Backup Strategy
In SIMATIC PCS 7 and WinCC, database archiving for Tag Logging and Alarm Logging must be configured according to the manufacturer limit of a maximum of 200 connected single segments in Microsoft SQL Server (Siemens FAQ 34473263). Setting segment sizes to 1 hour generates 168 segments per week, rapidly crashing the SQL Server. Conversely, setting segment durations to 1 or 2 years risks hitting the 2 GB / 24 GB single-segment file size boundary and complicates backup recovery. The industrial best practice is to configure segments between 1 day and 1 month, targeting individual segment sizes between 500 MB and 2 GB, with automatic background backup enabled.
Table of Contents
- Microsoft SQL Server Circular Archiving Architecture in WinCC
- The 200 Single Segment Limit: Engine Scalability and Stability
- Risks of Extreme Configurations: The 1-Hour vs 2-Year Segment Trap
- Single Segment File Size Boundaries: MDF/LDF Storage Limits
- Comparative Architecture Matrix: Archive Segment Duration Strategies
- Step-by-Step Configuration of Sustainable Archive Segments and Backups
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Microsoft SQL Server Circular Archiving Architecture in WinCC
SIMATIC PCS 7 and WinCC record historical process values (Tag Logging Fast and Slow) and events (Alarm Logging) into Microsoft SQL Server. Because continuous manufacturing generates hundreds of millions of records annually, WinCC structures storage into discrete single segments (paired .mdf data files and .ldf transaction logs). Each segment encapsulates a specific time slice (e.g. 1 week of data).
WinCC manages these segments dynamically: querying, attaching, detaching, and archiving them. However, Microsoft SQL Server has finite limits regarding how many active database files it can maintain attached concurrently before memory buffer pools and thread pools become exhausted.
The 200 Single Segment Limit: Engine Scalability and Stability
The authoritative guideline from Siemens development (SIOS FAQ ID 34473263) establishes:
-
Maximum 200 Single Elements Connected: Across all archive categories (Alarm Logging + Tag Logging Fast + Tag Logging Slow), the total number of active segments attached to the
WINCCSQL Server instance must not exceed 200. -
The Degradation Threshold: When the attached segment count approaches or exceeds 200, SQL Server query execution plans degrade, disk I/O queues saturate, faceplate trend curves take tens of seconds to load, and WinCC Data Manager throws internal COM exceptions.
-
When designing an archive strategy, the formula is:
(Total Retention Time / Single Segment Time) * Number of Active Archive Types <= 200.
Risks of Extreme Configurations: The 1-Hour vs 2-Year Segment Trap
Engineers attempting to align WinCC with corporate IT backup schedules frequently make two catastrophic design errors:
-
The 1-Hour Trap: Setting segment creation to 1 hour to facilitate hourly backups creates 24 segments per day. In just 8 days, the system hits 192 segments, crashing the SQL Server.
-
The 1-to-2 Year Trap: Setting segment duration to 1 or 2 years avoids creating new segments but produces massive monolithic database files. If a computer suffers an unexpected power loss, SQL Server database consistency checks (
DBCC CHECKDB) on a 100 GB single segment can take hours, during which the entire SCADA runtime is offline. -
Correct Alignment: Keep segment duration at 1 week (or 1 month for moderate tag counts) and let WinCC handle backups automatically.
Single Segment File Size Boundaries: MDF/LDF Storage Limits
Individual segment sizing must adhere to physical database bounds:
- In 32-bit and 64-bit WinCC architectures, standard practice limits a single segment MDF to under 2 GB (optimal 500 MB to 1 GB).
- Total active online database size (all attached segments combined) should not exceed 24 GB to 40 GB on standard OS Servers.
- Facilities requiring multi-year historical retention must deploy SIMATIC Process Historian (PH), which offloads detached segments into an enterprise-grade long-term archive repository.
Comparative Architecture Matrix: Archive Segment Duration Strategies
The following table compares different segment configuration strategies against technical constraints:
Step-by-Step Configuration of Sustainable Archive Segments and Backups
Follow this engineering procedure to establish a stable archiving setup in WinCC:
- Calculate Influx Volume: Determine total tag count and logging cycle. (E.g. 60 tags every 20 seconds = 3 tags/sec = ~259,200 records/day = ~15 MB/day = ~105 MB/week).
- Open Archive Configuration: In WinCC Explorer, expand Tag Logging. Right-click Archive Configuration -> TagLogging Slow (and Fast).
- Configure Time Parameters:
- Time period covered by a single segment: Select 1 Week (or 1 Month if total weekly size is < 50 MB).
- Max size of a single segment: Set to 1000 MB (1 GB).
- Time period of all segments: Set to 3 Months (keeps ~12 segments online).
- Max size of all segments: Set to 10 GB. - Configure Automatic Backup: Check 'Automatic backup'. Select a destination directory on a separate physical hard drive (
D:\WinCC_Archive_Backup). - Repeat for Alarm Logging: Open Alarm Logging -> Messages -> Archive Configuration. Configure matching 1-week / 1000 MB parameters.
- IT Backup Integration: Instruct corporate backup agents (e.g. Microsoft DPM or Veeam) to back up the destination directory
D:\WinCC_Archive_Backup, never locking the active runtime files in the WinCC project directory.
Verification
Verify database health and segment rotation through these checks:
- Attached Database Audit: Open SQL Server Management Studio (SSMS). Expand Databases. Count all databases matching
<Project>_ALG_*and<Project>_TLG_*. Confirm the total is well below 200. - Segment File Sizing: In Windows Explorer, check the project directory
\ArchiveManager\. Confirm MDF files are between 50 MB and 1000 MB. - Backup Folder Verification: Confirm that detached older segments appear in
D:\WinCC_Archive_Backup\without manual intervention. - Trend Retrieval Speed: Open a trend window spanning 30 days of data in WinCC Runtime. Confirm the curve renders in under 2 seconds.
Limitations and Operational Precautions
Observe the following storage safeguards:
-
Never Lock Active MDF/LDF Files: Anti-virus software and external file backup agents must have exclusions configured for
*.mdfand*.ldfin the active WinCC project directory to prevent file locking crashes. -
Do Not Use SQL Maintenance Scripts for Segmenting: WinCC internal Data Manager manages segment creation; running third-party SQL scripts to detach WinCC segments corrupts the runtime archive index.
-
Commercial Accuracy Disclaimer: Software order numbers (MLFBs), package structures, and hardware capacity prerequisites vary across PCS 7 versions and hardware platforms. System integrators must confirm exact software entitlements and licensing requirements against the official Siemens Catalog CA 01 and obtain an authorized Siemens distributor quotation prior to purchasing.
Engineer FAQ
What is the recommended segment duration for standard industrial plants?
Configuring a single segment duration of 1 week (or 1 month for smaller tag counts) with a max size of 500 MB to 2 GB provides optimal stability.
How do I archive historical data for years without exceeding the 200 segment limit?
Use WinCC's automatic backup path to offload detached segments to network storage, or deploy SIMATIC Process Historian for enterprise long-term storage.
Can external backup software back up active WinCC SQL files directly?
No. External backup tools must back up the exported backup directory, never the active runtime MDF/LDF files which are locked by SQL Server.
Technical References
- Siemens Industry Online Support (SIOS) FAQ: Connected Segments to SQL Server in PCS 7 (Entry ID: 34473263)
- SIMATIC WinCC V7.4 / V7.5 WinCC Information System: Working with Archives (Entry ID: 109746516)
- SIMATIC Process Control System PCS 7 OS Process Control System (Entry ID: 109746517)
- Microsoft SQL Server Database Engine Scalability Limits Guide (Entry ID: 109751825)
Related Articles
- Resolving Empty WinCC Event Lists and SQL Transaction Log Ballooning in SIMATIC PCS 7
- Configuring WinCC Alarm Logging Segmentation, Automatic Backup, and Long-Term Archiving
- Diagnosing Process Historian IPC Hardware Sizing, Memory Starvation, and Storage Threshold Failures
Related Tags
- SIMATIC WinCC
- Tag Logging
- Alarm Logging
- Database Segments
- SQL Server
- 200 Segment Limit
- Backup Strategy