Troubleshooting WinCC SQL Server Access Loss and Database Lockups on PCS 7 OS Stations
In SIMATIC PCS 7 OS environments, the runtime error 'No access to the SQL server, data loss possible' occurs when the Microsoft SQL Server instance becomes unresponsive due to storage I/O saturation, database log file locks, or damaged service permissions following an improper shutdown. Troubleshooting requires executing 'reset_wincc.vbs', validating SQL Server service account membership in the SIMATIC HMI group, checking disk transaction latency, and detaching orphaned database segments to restore runtime operation.
Table of Contents
- Role of Microsoft SQL Server in SIMATIC PCS 7 OS Architectures
- Mechanisms of SQL Access Loss and System Lockup
- Immediate Recovery Procedure: Resetting WinCC and Detaching Locked Databases
- Validating SQL Service Logon Accounts and SIMATIC HMI Rights
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Role of Microsoft SQL Server in SIMATIC PCS 7 OS Architectures
SIMATIC PCS 7 OS (WinCC) uses an embedded Microsoft SQL Server instance (e.g., WinCC instance) as its high-performance relational database engine:
* Configuration Database (CC_xxx): Stores project metadata, graphic screen properties, alarm configurations, and tag management definitions.
* Runtime Databases (CC_xxx_R): Stores dynamic runtime states, user authorizations, and operational logs.
* Archive Databases (Tag Logging and Alarm Logging): Manages segmented circular archives (.mdf and .ldf files) that record historical process trends, sequence of events (SOE) timestamps, and operator actions.
Because WinCC runtime components continuously stream transactions into SQL Server, any interruption in database access immediately threatens data integrity and freezes the operator interface.
Mechanisms of SQL Access Loss and System Lockup
The critical alarm:
No access to the SQL server, data loss possible
indicates that the WinCC runtime data manager (CCDataMgr.exe) or archive manager failed to execute SQL read/write transactions within the allowable timeout threshold. Primary causes include:
* Storage I/O Bottlenecks: High disk queue length (greater than 2) or failing hard drives cause write operations to hang, stalling the SQL write-ahead log.
* Improper Shutdown / Blackout: An ungraceful system termination (power failure, forced process termination) leaves SQL databases in a "Recovery Pending" or "Suspect" state with locked transaction logs.
* Security Permission Drift: The SQL Server Windows service account loses the required Log on as a service right or is removed from the local SIMATIC HMI security group.
* Database File Growth: Lack of automated archive segmentation causes transaction log files (.ldf) to fill the entire physical disk partition.
Immediate Recovery Procedure: Resetting WinCC and Detaching Locked Databases
When an OS station encounters an SQL lockup:
1. Deactivate Runtime: Attempt to deactivate WinCC runtime cleanly via WinCC Explorer. If the interface is frozen, open the Windows Run dialog (Win + R), type reset_wincc.vbs, and press Enter. This script cleanly terminates all running WinCC processes and releases SQL locks.
2. Launch SQL Server Management Studio (SSMS):
* Open SSMS and connect to the local server instance .\WINCC using Windows Authentication.
* Expand Databases. Inspect the project databases (CC_ProjectName and CC_ProjectName_R).
* If any database is marked (Recovery Pending) or (Suspect), check the SQL Server error log for specific corruption markers.
3. Detach Orphaned Project Databases:
* If the project refuses to open, right-click the database, select Tasks -> Detach..., check Drop Connections, and click OK.
* Detaching clears runtime locks and allows WinCC Explorer to re-attach clean database handles upon restart.
4. Inspect Disk Capacity and Health:
* Check all physical drive partitions (especially C: and the archive drive D:). Ensure at least 20% free space remains.
* Check Windows Event Viewer under System for disk controller timeout errors or NTFS write faults.
Validating SQL Service Logon Accounts and SIMATIC HMI Rights
SQL Server services require specific security credentials to interact with WinCC:
1. Open Windows Services (services.msc).
2. Locate the service SQL Server (WINCC).
3. Double-click to open Properties and select the Log On tab.
4. Ensure the service logs on using the dedicated local account (e.g., NT Service\MSSQL$WINCC or a configured administrative local system account).
5. Open Computer Management -> Local Users and Groups -> Groups.
6. Open the SIMATIC HMI group: verify that the SQL service account and the active Windows operating account are explicit members.
7. Run the SIMATIC Security Controller utility and click Repeat Settings to re-apply all certified folder and DCOM security rights across the SQL data directories.
8. Reboot the OS station.
Verification
- Launch WinCC Explorer and open the OS project; confirm that the project database loads without SQL connection errors.
- Activate WinCC runtime: verify that graphic process screens populate with live values.
- In Alarm Logging, verify that historical alarms display without warning banners.
- In a redundant OS server pair, verify via the Redundancy Control toolbar that both servers achieve full synchronization without active SQL loss alarms.
Limitations and Operational Precautions
- Never run manual SQL
DROP,ALTER, orDELETEcommands directly against WinCC internal database tables without explicit guidance from Siemens Customer Support. - In redundant OS server configurations, never perform database detach or reset operations on both servers simultaneously; ensure one server remains online as the active master.
- Ensure third-party antivirus software excludes all WinCC SQL project folders and archive directories (
*.mdf,*.ldf) from real-time file scanning.
Engineer FAQ
- What does
reset_wincc.vbsdo during an OS freeze?
It runs an automated script that safely terminates all hung WinCC background processes, disconnects COM handles, and unloads locked DLLs. - Where is the
reset_wincc.vbsscript located on an OS station?
It is located in the WinCC installation directory underC:/Program Files (x86)/Siemens/WinCC/bin/reset_wincc.vbs. - Why does an ungraceful shutdown cause SQL databases to enter Suspect mode?
Because active transaction logs were not flushed to disk, leaving incomplete page headers that fail SQL consistency validation during startup. - Can high CPU utilization trigger the 'No access to the SQL server' alarm?
Yes, severe CPU starvation can cause SQL query execution times to exceed the WinCC Data Manager timeout threshold. - How do I prevent WinCC archive files from consuming all available hard drive space?
Configure proper circular archive limits in WinCC Tag Logging and Alarm Logging, specifying maximum total size and maximum time period. - Should SQL Server Management Studio (SSMS) be installed on every OS client?
No, SSMS is a diagnostics tool recommended primarily for Engineering Stations and OS Servers, not operator clients. - What user group grants application access to WinCC SQL databases?
The Windows local groupSIMATIC HMIgrants the necessary privileges to access WinCC SQL instances. - How does OS Redundancy recover after one server suffers SQL data loss?
Once the failed server is repaired and reactivated, WinCC Redundancy automatically executes an archive synchronization from the healthy partner server. - Can antivirus software lock WinCC SQL database files?
Yes, aggressive antivirus real-time file scanning can lock.mdfor.ldffiles, triggering SQL access loss alarms. - Where are SQL Server error logs stored in a PCS 7 installation?
In the SQL installation path, typicallyC:/Program Files/Microsoft SQL Server/MSSQLxx.WINCC/MSSQL/Log/ERRORLOG.
Technical References
- SIMATIC HMI WinCC V7.4 / V7.5 WinCC Information System Manual
- SIMATIC PCS 7 OS Fault-Tolerant Servers Manual (V9.0 / V9.1)
- Siemens Industry Online Support Entry: WinCC SQL Server Access Loss (Entry ID 298664)
- Microsoft SQL Server Database Engine Troubleshooting Guide
Related Articles
- Troubleshooting Missing CEMAT Long-Term Archive Alarms Across Multiple PLCs in PCS 7
- Configuring and Managing Alarm Logging and Message Systems in SIMATIC PCS 7 OS
Related Tags
PCS 7, WinCC, SQL Server, Data Loss, reset_wincc, SIMATIC HMI, Archive Logging, Database, Redundancy, Diagnostics