Microsoft SQL Server Database Management Rules in SIMATIC PCS 7

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

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:

  1. Archive Segment Switching Deadlocks: Running DBCC SHRINKDATABASE or 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.
  2. 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.
  3. 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:

  1. 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.
  2. 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.
  3. 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:

Database Maintenance TaskStandard IT Enterprise PracticeSIMATIC PCS 7 WinCC RuleReason / Consequence in PCS 7Database Shrinking (DBCC SHRINK)Executed periodicallySTRICTLY PROHIBITEDCauses segment switching locks; stalls runtime archivingIndex Defragmentation / RebuildScheduled nightly/weeklySTRICTLY PROHIBITEDCircular segments are transient; locks active tablesTable Modification / Foreign KeysCustom schema tuningSTRICTLY PROHIBITEDCorrupts WinCC DataManager catalog; voids warrantyOnline Project BackupThird-party SQL VSS agentUse 'Copy WinCC Project'Safely captures WinCC runtime state without file locksArchive Space ManagementManual purge scriptsAutonomous Circular BufferWinCC automatically purges oldest segment by size/time

[!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:

  1. 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.
  2. Copy WinCC Project Test: Execute CCCopyProject.exe while WinCC Runtime is active. Verify that the backup completes with status 'Project copied successfully' and that the backup opens cleanly on an ES.
  3. 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:

  1. Dedicated Drive Partition: Always store WinCC project files and archive segments on a dedicated high-speed partition (e.g. D:\ or E:\) separate from the Windows operating system drive (C:\).
  2. Antivirus Exclusions: Configure antivirus software to exclude all SQL Server database files (*.mdf, *.ldf) and temporary archive directories from real-time file locking.
  3. UPS Protection: Industrial servers running Microsoft SQL Server must be connected to an automated UPS to ensure orderly shutdown via StoppProcessHistorian.exe or 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

Related Articles

Related Tags

  • Microsoft SQL Server
  • WinCC Database
  • Copy WinCC Project
  • Database Maintenance
  • Tag Logging
  • Archive Segments
6 respuestas