Microsoft SQL Server Database Management Rules in SIMATIC PCS 7
Do not create custom scheduled SQL maintenance jobs (such as index rebuilds, table defragmentation, or DBCC SHRINKDATABASE) on SIMATIC PCS 7 OS Servers or OS Clients. The Microsoft SQL Server instance (WINCC) is autonomously managed by WinCC Alarm Logging and Tag Logging circular archive engines. Executing manual SQL maintenance tasks or SQL Server Agent scripts causes table locks, interferes with high-speed cyclic segment switching, and risks catalog corruption. Approved maintenance is strictly limited to periodic runtime project backups using the official Siemens 'Copy WinCC Project' tool (CCCopyProject.exe), disk volume monitoring, and offloading historical segments to SIMATIC Process Historian.
Table of Contents
- WinCC Cyclic Multi-Segment Architecture vs Standard IT Relational Databases
- Why Manual SQL Maintenance Plans and Shrinking Are Forbidden
- Approved Backup and Maintenance Workflows in SIMATIC PCS 7
- IT SQL Maintenance vs PCS 7 WinCC Database Comparison Matrix
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
WinCC Cyclic Multi-Segment Architecture vs Standard IT Relational Databases
In enterprise IT environments, Microsoft SQL Server databases are typically maintained using scheduled SQL Server Agent maintenance plans that perform nightly index rebuilds, integrity checks (DBCC CHECKDB), and transaction log shrinking. IT administrators and plant engineers frequently inquire whether similar maintenance is required on SIMATIC PCS 7 OS Servers.
In SIMATIC PCS 7, the WinCC SQL Server instance (named WINCC) operates under an entirely different architecture:
- Dynamic Circular Segments: Historical alarms and process values are not logged into a monolithic static table. Instead, WinCC creates dynamic database segments (e.g.
<Project>_TLG_F_20180716_...mdf) covering specific time windows or size limits. - Autonomous Segment Lifecycle: When an archive segment reaches its configured size or duration, WinCC dismounts the segment from SQL Server, transfers it to long-term storage or Process Historian, and automatically purges the oldest segment from disk.
- Self-Maintaining B-Trees: Because segments are short-lived circular buffers that are detached rather than updated, index fragmentation within historical data never accumulates to performance-degrading levels.
Why Manual SQL Maintenance Plans and Shrinking Are Forbidden
Applying generic IT database management scripts to a live PCS 7 WinCC server introduces severe operational risks:
- Archive Segment Switching Deadlocks: Running
DBCC SHRINKDATABASEor manual table reorganization locks database pages. If WinCC attempts to switch or dismount a circular segment while a maintenance script holds exclusive locks, the archive manager crashes, freezing plant trend recording. - Catalog Desynchronization: WinCC maintains an internal master catalog (
dbo.CC_ArchiveCatalog). Modifying SQL structures or indexes directly corrupts this mapping, preventing WinCC from locating historical records. - Excessive Disk Thrashing: Shrinking SQL files only causes the database engine to immediately re-expand them during the next high-volume alarm burst, causing unnecessary write wear on solid-state drives and RAID arrays.
Approved Backup and Maintenance Workflows in SIMATIC PCS 7
To maintain long-term server reliability and database health, adhere strictly to Siemens-approved procedures:
- Runtime Project Backups via 'Copy WinCC Project':
- Never copy active WinCC project files using Windows Explorer while runtime is running, as open SQL file handles will result in corrupted copies.
- Use the official Siemens utility Copy WinCC Project (CCCopyProject.exe), located in the WinCC bin folder.
- This utility detaches a shadow copy of the database, packages the runtime and configuration files safely, and saves a consistent backup without interrupting plant operations. - Archive Storage Allocation:
- Configure Tag Logging and Alarm Logging archive limits in WinCC Explorer so that total archive size does not exceed 70% of the physical hard drive capacity. - Centralized Long-Term Archiving: Deploy SIMATIC Process Historian (
6ES7652-7AX58-0YB0) to automatically ingest and consolidate historical archive segments from OS servers, allowing OS server disk partitions to remain compact and responsive.
IT SQL Maintenance vs PCS 7 WinCC Database Comparison Matrix
The following table compares standard IT database practices against PCS 7 WinCC operational rules:
DBCC SHRINK)[!IMPORTANT]
Siemens System Guarantee: Directly altering the Microsoft SQL Server instance (WINCC) via custom SQL queries, SQL Server > Management Studio maintenance plans, or third-party database optimizers is not supported by Siemens and can lead to irreversible > archive failure.
Verification
Confirm that WinCC SQL Server operates cleanly without external maintenance:
- Archive Segment Health: Open WinCC Explorer -> Tag Logging -> Archive Configuration. Confirm that active segments show mounted status and that total archive size conforms to the configured ceiling.
- Copy WinCC Project Test: Execute
CCCopyProject.exewhile WinCC Runtime is active. Verify that the backup completes with status 'Project copied successfully' and that the backup opens cleanly on an ES. - SQL Server Error Log: Open SQL Server Management Studio and inspect the SQL Server Error Log. Confirm that no deadlock entries or database corruption warnings (
Page Audit Faults) are logged.
Limitations and Operational Precautions
Observe these guidelines for WinCC SQL database management:
- Dedicated Drive Partition: Always store WinCC project files and archive segments on a dedicated high-speed partition (e.g.
D:\orE:\) separate from the Windows operating system drive (C:\). - Antivirus Exclusions: Configure antivirus software to exclude all SQL Server database files (
*.mdf,*.ldf) and temporary archive directories from real-time file locking. - UPS Protection: Industrial servers running Microsoft SQL Server must be connected to an automated UPS to ensure orderly shutdown via
StoppProcessHistorian.exeor WinCC runtime deactivation during power failures.
Engineer FAQ
Do I need to schedule SQL Server Agent maintenance jobs on a PCS 7 OS Server?
No. The WinCC runtime engine autonomously manages its SQL databases. Scheduled maintenance jobs cause database locks and are strictly discouraged by Siemens.
Why shouldn't I shrink the WinCC SQL database files?
Shrinking causes extreme disk fragmentation and file locking. WinCC will immediately re-expand the database files as new process tags are logged, rendering shrinking counterproductive.
How do I back up a WinCC project while Runtime is running?
Use the Siemens tool 'Copy WinCC Project' (CCCopyProject.exe), which safely duplicates the project database without interrupting active process control or causing SQL file access violations.
What happens when the archive hard drive becomes completely full?
If the disk runs out of free space, WinCC cannot mount new circular segments and runtime trend/alarm archiving will stop. Always configure archive size limits in Tag Logging to leave at least 20–30% free disk space.
Technical References
- WinCC V7.4 Database Architecture and Storage Manual (Entry ID 109736223)
- SIMATIC PCS 7 Operator Station OS Configuration Guide (Entry ID 109780813)
- How to Backup/Copy WinCC Projects During Runtime (Entry ID 38493803)
- Siemens Industry Online Support FAQ on WinCC SQL Server Maintenance (Entry ID 109756829)
Related Articles
- Preserving Historical Tag Logging Archives When Moving Plant Hierarchy Folders
- Safely Shutting Down SIMATIC Process Historian via Command-Line Utilities
- Resolving Faulty 1995 Alarm Timestamps in PCS 7 WinCC Alarm Logging
- Installing Process Historian Microsoft Office Add-in and Architecture Rules
Related Tags
- Microsoft SQL Server
- WinCC Database
- Copy WinCC Project
- Database Maintenance
- Tag Logging
- Archive Segments