Resetting WinCC SQL Server Database Instances and Halting Services in SIMATIC PCS 7

Resetting WinCC SQL Server Database Instances and Halting Services in SIMATIC PCS 7

When WinCC Runtime fails to activate on a redundant standby OS server following an engineering download in SIMATIC PCS 7, locked database handles or stalled background services can be cleanly reset without rebooting the computer using the official Siemens utility Reset_WinCC.vbs or SQL Server Configuration Manager. In Windows, open an elevated Command Prompt and execute 'C:\Program Files (x86)\Siemens\WinCC\bin\Reset_WinCC.vbs' to terminate all hanging WinCC processes (such as CCProjectStudio.exe and pdlrt.exe). Alternatively, open SQL Server Configuration Manager, locate service 'SQL Server (WINCC)', right-click to select 'Restart', and re-initiate runtime activation.

Table of Contents

Executive Summary

Maintaining high availability across redundant SIMATIC PCS 7 Operator Stations requires compiling the master OS and downloading project updates to both the primary server (OS Master) and the secondary server (OS Standby). However, following a project download, commissioning engineers frequently encounter a condition where the OS Master activates cleanly, but the OS Standby server hangs during runtime startup or reports database connection errors. This failure occurs when residual WinCC runtime processes (CCProjectStudio.exe, pdlrt.exe, CCDataExchange.exe) or locked Microsoft SQL Server database handles remain active from the previous execution session. Rather than performing disruptive full operating system reboots, automation engineers can utilize specialized Siemens diagnostic scripts and SQL management tools to reset database instances cleanly. This guide details the recovery procedure.

WinCC Process Architecture: Daemons, Database Instances, and Locks

A running WinCC SCADA station coordinates dozens of interdependent background processes:

  • CCProjectStudio.exe: Manages project configuration and database connections.
  • pdlrt.exe (Picture Data Language Runtime): Executes the graphics display engine.
  • CCDataExchange.exe: Manages server-to-server redundancy synchronization and archive replication.
  • sqlservr.exe (MSSQL$WINCC): The Microsoft SQL Server instance hosting the runtime and configuration tables.

If a previous runtime session terminated abnormally, sqlservr.exe retains locked transaction file handles on <Project>.ldf, preventing the newly downloaded project from mounting.

Why Runtime Fails to Start After OS Standby Download

When SIMATIC Manager downloads an OS to the standby server via PLC > Download, it must overwrite existing project files. If an orphaned WinCC process is still active in Windows Task Manager, Windows blocks write access to DLLs or database files. The download finishes with warnings, leaving the standby project in a desynchronized state.

The Reset_WinCC.vbs Utility vs SQL Server Configuration Manager

Siemens supplies two primary mechanisms to clear stalled WinCC states:

  • Reset_WinCC.vbs: A specialized Visual Basic script supplied with all WinCC installations. It systematically sends termination signals to all registered WinCC processes, detaches hanging database instances, and resets the communication channel handlers without damaging project data.
  • SQL Server Configuration Manager: Allows engineers to restart the dedicated SQL Server (WINCC) service, flushing all cached buffers and releasing locked file pointers.

WinCC Service Diagnostic and Reset Method Comparison

The following table compares methods for stopping WinCC services and clearing locked database instances:

Reset MechanismExecutable / ToolTarget Process ScopeSystem ImpactRecommended ScenarioReset_WinCC.vbsSiemens VB ScriptTerminates all WinCC daemons & detaches DBsRapid (~15 s), zero data lossPrimary recovery method for frozen/hung WinCC.SQL Server RestartSQL Configuration ManagerRestarts MSSQL$WINCC service instanceFlushes SQL cache (~30 s)Resolves SQL timeout & database attachment errors.Windows Net CommandsCommand Prompt (net stop)Stops MSSQL$WINCC via CLICommand-line automationScripted server maintenance.Full Windows RebootWindows Start MenuRestarts OS and all background daemonsSlow (3-5 min), interrupts servicesLast resort if kernel drivers are hung.Manual TaskkillWindows Task ManagerKills individual .exe processesHigh risk of SQL table corruptionProhibited (Corrupts database transaction logs).

Step-by-Step Procedure to Reset Services and Databases

Method 1: Executing Reset_WinCC.vbs (Recommended)

  1. Close WinCC Explorer and SIMATIC Manager if open.
  2. Open Windows Start Menu, type cmd, right-click Command Prompt, and select Run as administrator.
  3. In the command prompt, execute the following command:
    "C:\Program Files (x86)\Siemens\WinCC\bin\Reset_WinCC.vbs"
  4. A command window appears listing terminated WinCC processes.
  5. Wait approximately 15 to 30 seconds until the command window closes automatically.
  6. Open Windows Task Manager; verify that no processes beginning with CC* or pdl* are running.

Method 2: Restarting the WinCC SQL Server Service

  1. Navigate to Start > All Programs > Microsoft SQL Server > Configuration Tools > SQL Server Configuration Manager.
  2. In the left-hand pane, click on SQL Server Services.
  3. In the right-hand list, locate SQL Server (WINCC).
  4. Right-click SQL Server (WINCC) and select Restart.
  5. Once the service returns to state 'Running', open the OS project in WinCC Explorer and activate Runtime.

Verification

To verify that WinCC databases and services are operational:

  1. Runtime Activation Test: On OS Standby, click the Activate button in WinCC Explorer. Confirm that the startup progress bar advances through 'Alarm Logging', 'Tag Logging', and 'Graphics' without halting.
  2. Redundancy State Inspection: In the Windows taskbar tray, open the WinCC Redundancy icon. Confirm that the status reports 'Standby: In Runtime' and 'Master: In Runtime' with active synchronization.
  3. Diagnostic Log Check: Open C:\Program Files (x86)\Siemens\WinCC\Diagnostics\WinCC_Sys_01.log. Confirm that no Database open error or Sharing violation entries appear.

Limitations and Operational Precautions

  • Never Force Kill sqlservr.exe: Never terminate sqlservr.exe via Windows Task Manager 'End Process Tree'; terminating SQL Server mid-write can corrupt the transaction log (.ldf), requiring database restoration from backup.
  • Redundant Master Protection: Ensure you execute Reset_WinCC.vbs strictly on the affected standby node; never run reset scripts on an active OS Master while production is running.
  • Archive Synchronization Delay: Following a database reset and runtime start, allow 5 to 15 minutes for the WinCC Redundancy Control to synchronize historical archive gaps before testing client failover.

Engineer FAQ

Does running Reset_WinCC.vbs delete my project tags or graphic screens?

No. Reset_WinCC.vbs merely terminates stuck application processes and releases locked file handles; it does not delete or modify project files.

Where is Reset_WinCC.vbs located on 32-bit vs 64-bit Windows?

On 64-bit Windows, it is located at C:\Program Files (x86)\Siemens\WinCC\bin\Reset_WinCC.vbs. On older 32-bit systems, it resides under C:\Program Files\Siemens\WinCC\bin\.

Why does WinCC Explorer display 'Project is already open on another computer' after a crash?

A crash leaves the hidden lock file <ProjectName>.lck in the project directory. Running Reset_WinCC.vbs and deleting the .lck file clears this condition.

Technical References

Related Articles

Related Tags

  • https://industrialautomation.net/search?query=simatic-pcs7
  • https://industrialautomation.net/search?query=wincc-scada
  • https://industrialautomation.net/search?query=sql-server
  • https://industrialautomation.net/search?query=troubleshooting
6 respuestas