Resolving WinCC OS Server Startup Hangs and Corrupted Alarm Logging Runtime Databases

Resolving WinCC OS Server Startup Hangs and Corrupted Alarm Logging Runtime Databases

When a SIMATIC PCS 7 OS Server hangs indefinitely during startup specifically when 'Alarm Logging Runtime' is enabled, the failure is caused by corrupted Microsoft SQL Server message archive tables or damaged circular archive segments (Alg.mdf/Alg.ldf). Standard project reorganization ('File > Reorganize') cannot repair damaged relational SQL message pages. To restore server startup: terminate WinCC processes, navigate to the project 'ArchiveManager' directory, quarantine existing message archive segment files, restart WinCC Explorer, re-save the Alarm Logging configuration, and allow the system to generate pristine message archive databases.

Table of Contents

Executive Summary

High-availability supervisory control in SIMATIC PCS 7 (V8.0 through V9.1) relies on Microsoft SQL Server to manage millions of historical process alarms and system events. In redundant OS Server environments, an abrupt system event—such as a power failure, blue screen crash, or hard reset during a database write transaction—can introduce physical corruption into active Alarm Logging database pages. Subsequent attempts to activate WinCC Runtime hang indefinitely on the startup progress screen as the alarm logging daemon (CCAlgRtServer.exe) enters an infinite wait loop trying to attach damaged archive segments. This article details the database mechanics of alarm archiving and provides the definitive recovery procedure.

Architecture and Fundamental Mechanics

Database Mechanics of Alarm Logging Runtime and SQL Server Hangs:

  • Architecture of the Alarm Logging Engine (CCAlgRtServer.exe):
  • When WinCC Runtime activates, the Startup sequence executes components in configured order: Graphics Runtime, Tag Logging Runtime, Alarm Logging Runtime, and Redundancy.
  • During Alarm Logging initialization, CCAlgRtServer.exe performs three critical database tasks:

    1. Attaches the configuration database (<Project_Name>Alg.mdf) to read defined message classes, blocks, and event texts.
    2. Scans the ArchiveManager\AlarmLogging directory to mount active and circular historical message segment pairs (*_ALG_*.mdf and *_ALG_*.ldf).
    3. Interrogates the redundant partner server (via CCRedServer.exe) to synchronize missing alarm sequence stamps.
  • The Root Cause of Startup Freezes:

  • If an OS Server lost power while SQL Server was executing an active I/O write on an alarm archive segment, the database page header or checksum becomes corrupted.
  • When CCAlgRtServer.exe instructs SQL Server to attach the segment, SQL Server enters an internal recovery loop or deadlocks on the corrupt page. The process hangs with high CPU or zero I/O progress.

  • Why Project Reorganization Fails to Fix Archive Hangs:

  • In WinCC Explorer, the command File -> Reorganize defragments configuration tables within the primary .mcp and .dcf project database.
  • It strictly does not parse, defragment, or repair external SQL Server circular archive files residing inside the ArchiveManager folder. Consequently, corrupt archive segments remain in place and trigger identical startup hangs.

Step-by-Step Implementation Procedure

Step-by-Step Procedure to Recover from Alarm Logging Startup Hangs:

  1. Terminate All WinCC Runtime and Background Processes:
    - Open Windows Task Manager on the hanging OS Server.
    - Terminate hanging processes: CCProjectMgr.exe, CCAlgRtServer.exe, PdlRuntimeHost.exe, and CCScriptRt.exe.
    - Alternatively, execute the official Siemens cleanup script: C:\Program Files (x86)\Siemens\WinCC\bin\CCResetRT.exe (run as Administrator).
  2. Quarantine Corrupted Alarm Archive Segments:
    - Open Windows File Explorer and navigate to your WinCC project directory.
    - Open folder: <Project_Folder>\ArchiveManager\AlarmLogging.
    - Create a temporary folder on another drive or desktop: C:\Quarantine_Alarms\.
    - Select all existing segment files in the AlarmLogging folder (*_ALG_*.mdf and *_ALG_*.ldf) and MOVE (cut and paste) them into the quarantine directory.
    - Leave the AlarmLogging directory empty.
  3. Rebuild Alarm Logging Configuration:
    - Open WinCC Explorer (do not activate Runtime).
    - In the WinCC Explorer tree, double-click Alarm Logging.
    - Make a minor non-critical change (e.g. modify and revert a message text comment), then click File -> Save.
    - This forces WinCC to rewrite its internal message configuration tables cleanly.
  4. Verify Redundancy Synchronization Configuration:
    - In WinCC Explorer, double-click Redundancy.
    - Temporarily uncheck Synchronization of Alarm Logging after partner recovery to isolate the startup from partner synchronization loops.
    - Click OK.
  5. Activate WinCC Runtime:
    - Click the Activate button in WinCC Explorer.
    - Verify that Alarm Logging Runtime initializes instantaneously, creates fresh message database segments, and enters Runtime smoothly.
    - Once stable, re-enable Redundancy synchronization in Alarm Logging.

Verification

Verification Procedure:
1. Startup Completion Check: Confirm that WinCC Runtime activates completely without hanging on the startup banner, and the operator overview picture displays.
2. Message System Operation: Open the WinCC Alarm Journal. Trigger a test process alarm from the AS; confirm the message displays immediately with correct timestamp, priority, and text.
3. Diagnostic Log Verification: Inspect C:\Program Files (x86)\Siemens\WinCC\Diagnostics\WinCC_Sys_01.log. Confirm that CCAlgRtServer.exe logs clean initialization with zero database error messages.

Limitations and Operational Precautions

Operational Precautions and Historical Data Salvage:
- Historical Alarm Data Loss: Moving corrupt archive segments removes historical alarm records from the active operator journal. If historical records must be preserved for regulatory compliance (e.g. FDA 21 CFR Part 11), submit the quarantined .mdf files to Siemens Industry Support for database salvage.
- Redundant Server Coordination: When performing archive cleanup, perform the procedure on one OS Server at a time; ensure the partner server continues serving process data to operators.
- Uninterruptible Power Supplies (UPS): Ensure all OS Server racks are powered via online double-conversion UPS units to prevent power outages from corrupting SQL Server write transactions.

Engineer FAQ

Why does WinCC Runtime hang only when Alarm Logging is selected in Startup?

Because the Alarm Logging engine (CCAlgRtServer.exe) encounters corrupted SQL Server archive segment files in the ArchiveManager\AlarmLogging directory and deadlocks trying to mount them.

Why didn't WinCC 'File > Reorganize' fix the problem?

Project reorganization only defragments project configuration tables (.dcf); it does not touch or repair historical circular archive files in the ArchiveManager folder.

What command completely resets WinCC runtime processes after a crash?

Executing CCResetRT.exe (located in C:\Program Files (x86)\Siemens\WinCC\bin) terminates all orphaned WinCC runtime processes safely.

Can I recover the alarms from the quarantined .mdf files?

Yes. Quarantined segments can often be re-attached as read-only historical archives or repaired by Siemens Technical Support.

Where are WinCC process diagnostic logs stored?

They are stored in C:\Program Files (x86)\Siemens\WinCC\Diagnostics\WinCC_Sys_01.log.

Technical References

Related Articles

Related Tags

  • Alarm Logging
  • WinCC Runtime
  • SQL Database Repair
  • ArchiveManager
  • CCResetRT
20 respuestas