Restoring Corrupted WinCC Tag Logging Archives and Fast Trends Following OS Server Power Failures
In SIMATIC PCS 7, when an unexpected power outage on an Operator Station (OS) Server causes historical trend curves to freeze—showing data only up to the timestamp of the power interruption and failing to archive new process values upon reboot—the issue is caused by SQL Server database corruption within the active WinCC Tag Logging archive segments (Fast and Slow archives). Sudden power loss halts database write buffers mid-transaction, leaving active archive segments in a locked or suspect state. To restore trend archiving, close all WinCC applications, execute the CCArchiveManager command-line reset utility (CCArchiveManager.exe -reset all) or run Reset_WinCC.vbs, reconfigure archive segment durations in Tag Logging, and optionally swap healthy archived historical segments back into the CommonArchiving directory.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
Continuous process monitoring relies on uninterrupted historical trend recording within WinCC Tag Logging on PCS 7 OS Servers. When an industrial server experiences an abrupt power loss without an orderly UPS shutdown, Microsoft SQL Server database partitions frequently suffer transactional truncation. Upon reboot, WinCC Runtime may appear healthy on the surface, but process trend displays remain permanently frozen at the outage timestamp. WinCC Archive Manager cannot write new cyclic data into damaged database segments. Understanding how to execute an archive reset, purge corrupt partition pointers, and restore historical data segments recovers the trend system without requiring full project recompilation.
Architecture and Fundamental Mechanics
The historical data storage architecture of WinCC Tag Logging operates through structured relational database partitions:
- The Dual Tag Logging Architecture (Fast vs. Slow):
* Tag Logging Fast: Stores high-frequency process values (acquisition cycles under 1 minute) directly into short-term circular SQL database segments (<Project>_TLG_F_...).
* Tag Logging Slow: Stores low-frequency process values (cycles greater than 1 minute) or compressed long-term trends (<Project>_TLG_S_...). - Segment Lifecycle and Transaction Logging:
* WinCC dynamically allocates database segment pairs (.mdfand.ldf) based on configured size limits (e.g., 500 MB) or time limits (e.g., 1 day or 1 week).
* While runtime is active, write operations are continuously staged in memory and flushed to disk. - Power Outage Failure Mechanism:
* If power drops during an active write transaction, SQL Server marks the active segment as 'Suspect' or corrupts the master project database pointers (CC_PRJ_...).
* Upon system reboot,CCArchiveManager.exefails to mount the active partition. Because it cannot append new cyclic samples, logging silently halts. The trend control in WinCC displays the last recorded sample before power dropped and flatlines thereafter.
Step-by-Step Implementation Procedure
Follow these procedures to repair corrupted Tag Logging archives and restore trend functionality on the OS Server:
- Perform an Emergency Backup of the Project Directory:
* Close WinCC Explorer and ensure all runtime tasks are deactivated.
* Make a complete copy of the OS project directory onto a secure drive or external medium. - Execute WinCC System Reset (
Reset_WinCC.vbs):
* Open Windows File Explorer and navigate to the WinCC installation directory (typicallyC:/Program Files (x86)/Siemens/WinCC/bin).
* LocateReset_WinCC.vbs.
* Right-clickReset_WinCC.vbsand select Run as Administrator.
* Wait for the script to terminate all hung background database engines and WinCC processes (CCProjectMgr.exe,CCArchiveManager.exe,sqlservr.exe). - Execute Archive Manager Database Reset:
* Open Windows Command Prompt (cmd.exe) as Administrator.
* Navigate to the WinCC bin directory:cd "C:/Program Files (x86)/Siemens/WinCC/bin".
* Execute the archive reset command:
CCArchiveManager.exe -reset all
* Confirm the execution. This command clears corrupt active archive pointers and re-initializes fresh, clean SQL database segments for both Alarm Logging and Tag Logging. - Reconfigure Archive Parameters in Tag Logging:
* Launch WinCC Explorer and open the OS project.
* Open Tag Logging editor.
* Right-click Archive Configuration and inspect Fast and Slow properties.
* Verify that segment sizes (e.g., maximum segment size 512 MB, total archive size 10 GB) and time durations match your plant standard.
* Save and close Tag Logging. - Recover Historical Archive Segments (Optional):
* If you wish to restore historical trend data recorded prior to the power failure:
* In the project directory, locate the saved healthy.mdfand.ldfarchive files from theArchiveManager/TagLoggingFastfolder.
* Copy these historical segment files into theCommonArchivingfolder within the project directory.
* When WinCC Runtime starts, it automatically links historical segments into the SQL instance for trend viewing. - Restart WinCC Runtime and Verify Trends:
* In WinCC Explorer, activate WinCC Runtime.
* Verify thatCCArchiveManager.exestarts without errors.
Verification
In WinCC Runtime, open a process graphic containing an Online Trend Control. Select an analog process value (e.g., reactor temperature or discharge pressure). Verify that the trend curve begins plotting live data points dynamically past the timestamp of the power outage. Verify that the time axis advances smoothly and historical cursor readouts show continuous data.
Limitations and Operational Precautions
Executing CCArchiveManager.exe -reset all resets current archive configuration parameters back to factory defaults (1 day, 1 week) and detaches active segments; always re-verify archive settings in Tag Logging after a reset. Ensure that uninterruptible power supplies (UPS) are installed and configured to execute graceful OS Server shutdowns during power loss.
Engineer FAQ
Does 'CCArchiveManager.exe -reset all' delete my project configuration?
No. It resets runtime historical archive segments and configuration database pointers, but does not delete process pictures, tags, or CFC engineering.
Why did trends freeze instead of showing an error dialog?
WinCC Trend Control simply plots whatever data exists in SQL; when archiving halts silently, the control displays the last recorded point without raising a modal warning.
How do I restore historical trend data after an archive reset?
Copy the uncorrupted historical segment files (.mdf and .ldf) into the CommonArchiving directory while WinCC Runtime is active; WinCC will attach them dynamically.
What tool terminates all hung WinCC background processes?
Reset_WinCC.vbs located in the WinCC bin directory safely terminates all hanging WinCC and SQL communication processes.
Technical References
- WinCC V7.4 SP1: Working with WinCC - Archiving Process Values Manual (A5E41356092-AC)
- SIMATIC Process Control System PCS 7 Operator Station (V9.0 SP3) Manual
- Siemens Industry Online Support Entry 109780813 - PCS 7 Licensing and Engineering Guidelines
Related Articles
- Optimizing WinCC Fast Tag Logging Archive Sizes and Segment Configuration in SIMATIC PCS 7
- Step-by-Step Configuration of Online and Archive Trends Using WinCC Trend Control in PCS 7
- Synchronizing and Resetting Process Historian Metadata After WinCC Tag Logging Changes
Related Tags
- Tag Logging
- Trend Control
- CCArchiveManager
- Reset_WinCC
- Database Corruption