Resolving SIMATIC PCS 7 Archive Project Error 3020:25 and 256:67
Engineers commissioning and maintaining SIMATIC PCS 7 process control projects frequently encounter two interrelated archive errors during routine backup operations: (3020:25) and (256:67). Both errors prevent the PCS 7 engineering tool from packaging a multi-user project, an OS server, or an AS station into a self-contained archive. This technical reference provides a complete diagnostic workflow, the exact files that cause the lock, three field-proven remediation paths, verification steps, and preventive controls so the issue does not recur on the next archive attempt.
3020:25 and 256:67, not the spelling, when searching the Siemens Support knowledge base.
1. Problem Overview
The PCS 7 archive utility (Project > Archive in the SIMATIC Manager, or File > Archive Project in the project tree) packages every DBF, SDF, MDF, LDF, source file, and S7 program contained in the project root. To do this safely it must acquire an exclusive read lock on each file. When one or more files remain in use by a background process, the archive wizard aborts with the following dialog text:
Archive Project (3020:25)
Opened project cannot be archived.
Make sure that no other STEP 7 application objects from project
'<project_name>' in '<project_path>' directory are open.
When the offending files are WinCC runtime databases, the dialog expands to the more specific error code (256:67):
Archive Project (256:67):
OS(1)\OS(1)RT.mdf' because it is already being used by another application.
OS(1)\OS(1)RT.ldf' because it is already being used by another application.
OS(1)\OS(1)Tlg.ldf' because it is already being used by another application.
Both errors halt the archive. The PCS 7 project tree, AS source files, and S7 programs remain intact on disk, but the backup ZIP/CAB is never produced.
2. Affected Products and Versions
| Component | Verified Versions | Notes |
|---|---|---|
| SIMATIC PCS 7 | V7.1, V7.1 SP3, V8.0, V8.0 SP1, V8.1, V8.2, V9.0, V9.0 SP1, V9.1 | Error confirmed across all major releases since 2008 |
| SIMATIC WinCC (within PCS 7) | V7.0, V7.2, V7.3, V7.4, V7.5 | WinCC RT databases are SQL Server based from V6.2 onward |
| Microsoft SQL Server | 2005, 2008 R2, 2012, 2014, 2016, 2017, 2019 | Shipped instance: WINCCPLUS or SQLExpress for OS |
| Windows Engineering Station OS | Windows 7 SP1, Windows 8.1, Windows 10 LTSC, Windows Server 2008 R2 / 2012 R2 / 2016 / 2019 | 32-bit or 64-bit depending on PCS 7 version |
Reference: SIMATIC PCS 7 Software Documentation.
3. Error Anatomy
3.1 File Identification
The three files named in the (256:67) dialog are the live WinCC runtime databases of an Operator Station (OS) named OS(1):
| File | Type | SQL Server Role | Function |
|---|---|---|---|
OS(1)RT.mdf |
Primary data | SQL Server primary database file | Process value archive, alarm log, user archive current state |
OS(1)RT.ldf |
Transaction log | SQL Server log file | Active transaction log for RT.mdf |
OS(1)Tlg.ldf |
Transaction log | SQL Server log file | Transaction log for the alarm/tag logging subsystem |
WinCC RT databases are written into the project subdirectory:
C:\Program Files (x86)\Siemens\Automation\PCS7\<project_name>\<project_path>\OS(1)\
For PCS 7 V9.0 with WinCC V7.5, the path is renamed to ...\WinCC\<project>\OS(1)\.
3.2 Error Code Meaning
| Code | Source Module | Cause Category | Typical Trigger |
|---|---|---|---|
3020:25 |
SIMATIC Manager archive core | Generic file handle retention | Any open STEP 7 application holding a handle inside the project root |
256:67 |
WinCC archive subsystem | SQL Server exclusive lock | WinCC RT still attached to the MDF/LDF pair, WinCC service running |
Per the Siemens support KB article "PCS 7: Errors when archiving a project", both codes are categorized as handle-leak issues and are recovered identically.
4. Root Cause Analysis
SQL Server acquires an exclusive FILE_SHARE_READ handle on MDF and LDF files when the database is online. The PCS 7 archive utility uses Windows file-copy APIs and refuses to copy any file for which the exclusive lock cannot be acquired. When the WinCC RT service is active (state: Started) or when the SQL Server instance hosting the WinCC database is up, the lock persists. The same lock can also be held by:
- The
sqlservr.exeprocess running under theSQLServerMSSQLUser$<COMPUTERNAME>$<INSTANCENAME>account. - The WinCC RT service (
WinCC RT<OS name>, service display name SIMATIC WinCC Runtime). - The WinCC Alarm Logging service (
CCAlgLogSrv.exe). - A residual handle from a closed STEP 7 editor (HW Config, NetPro, CFC, SFC, SCL editor) that did not release its project handle on shutdown.
- Antivirus, backup agents, or Windows Search Indexer reading the project directory.
A typical PCS 7 engineering station boots with several of these services in Automatic startup. Engineers closing only the visible UI components assume the locks are released, but background services continue to hold the files.
5. Pre-Flight Diagnostic Workflow
- Open Task Manager > Details (Windows 8/10/Server 2012 and newer) or Task Manager > Processes (Windows 7).
- Sort by Image Name and look for the following processes:
S7WEBSVC.EXE - STEP 7 Web Service s7oiehsx.exe - S7OMM helper sqlservr.exe - SQL Server (WinCC instance) s7hsrv64.exe - S7 Home Service (64-bit) CCAlgLogSrv.exe - WinCC Alarm Logging WinCCExplorer.exe - WinCC Explorer (if project still open) - Open resmon.exe (Resource Monitor) > CPU tab > expand Associated Handles and search for
OS(1)RT.mdf. The owning PID is the lock holder. - Open cmd as Administrator and run:
Ifopenfiles /query /fo table | findstr /i "OS(1)RT"Maintain Objects Listhas been activated withopenfiles /local on, this command lists the lock owner and mode. - Cross-check WinCC Explorer: Computer > Properties > Start-up. If Runtime is enabled, the RT database is online.
6. Solution A: Kill the sqlservr.exe Process
This is the fastest path and is suitable when the project is being archived from a dedicated engineering station where the OS runtime is not required during the backup window.
- Close all SIMATIC Manager, HW Config, NetPro, CFC, SFC, SCL, and WinCC Explorer instances.
- Open Task Manager > Details.
- Locate every
sqlservr.exerow. Verify the User Name column contains the SQL Server service account, not the current user. - Right-click > End task. If the dialog states Access denied, open Task Manager as Administrator or run
taskkill /F /PID <PID>from an elevated prompt. - Confirm there are no remaining
sqlservr.exeinstances by re-sorting the list. - In SIMATIC Manager, retry Project > Archive.
- After the archive succeeds, restart the engineering station so the SQL Server service (and any dependent WinCC services) return to their configured startup state. A manual restart of the SQL Server service via
services.mscis acceptable as a temporary measure.
sqlservr.exe is a hard kill and does not roll back open transactions. For an active OS server in production, prefer Solution B or C. Solution A is intended for engineering stations where the OS runtime is offline.
7. Solution B: Stop and Restart the WinCC Service via SQL Enterprise Manager
This is the production-safe path because the SQL Server service is left running; only the WinCC database is detached.
- Open SQL Server Management Studio (SSMS) or the older SQL Server Enterprise Manager (SQL 2000 era).
- SSMS: Start > Programs > Microsoft SQL Server 2014 (or version) > SQL Server Management Studio.
- Connect to the instance that hosts the OS RT database. The instance name is typically
WINCC\WINCCor.<INSTANCENAME>.
- Expand Databases and locate the OS RT database. The convention is
<OS_name>RT(for exampleOS(1)RT). - Right-click the database > Tasks > Take Offline. Confirm the status becomes Offline.
- Verify in Windows Explorer that no process holds
OS(1)RT.mdfusingresmon.exe. - Retry the PCS 7 archive.
- After the archive completes, right-click the database > Tasks > Bring Online.
- Start the WinCC runtime via WinCC Explorer > Computer > Properties > Start-up > enable Runtime and click OK, or by restarting the SIMATIC WinCC Runtime service in
services.msc.
Reference: Microsoft Learn: Take a Database Offline.
8. Solution C: Reset WinCC with reset_wincc.vbs
The reset_wincc.vbs script is shipped with WinCC and is intended to fully detach all WinCC components from their databases.
- Close all SIMATIC applications.
- Open an elevated command prompt (Start > cmd > Run as administrator).
- Navigate to the WinCC installation directory. The default path is:
For PCS 7 V9 the path becomescd "C:\Program Files (x86)\Siemens\Automation\WinCC\bin"...\Siemens\Automation\PCS7\WinCC\bin. - Execute the script:
cscript reset_wincc.vbs - The script iterates through every WinCC service (WinCC RT, WinCC Alarm Logging, WinCC Tag Logging, WinCC Server) and stops them in dependency order, then detaches the databases.
- Wait for the
OKprompt before launching SIMATIC Manager. - Run Project > Archive.
- After the archive, restart the WinCC RT environment by either launching WinCC Explorer or by restarting the
SIMATIC WinCC Runtimeservice.
9. Service-Level Cleanup (Preventive Maintenance)
Some engineers observe the (3020:25) error even when no SIMATIC UI is open. This is caused by Windows services that were configured to start automatically and silently lock project files. The following services must be in Disabled or Manual state on the engineering station prior to archiving:
| Service Display Name | Internal Name | Recommended Startup |
|---|---|---|
| SIMATIC WinCC Runtime | WinCC_RT_<OS> |
Manual on engineering station |
| SIMATIC WinCC Server | CCWriteArchiveServer |
Manual |
| SIMATIC WinCC Alarm Logging | CCAlgLogSrv |
Manual |
| SIMATIC WinCC Tag Logging | CCTlgSvc |
Manual |
| SQL Server (WINCC) | MSSQL$WINCC |
Manual on engineering station |
| SIMATIC S7 Help Service | s7hsrvx |
Manual |
| SIMATIC S7 Web Service | S7WEBSVC |
Manual |
Set the startup type from services.msc (Start > Run > services.msc) by double-clicking each service and selecting Startup type: Manual. After a Windows reboot these services stay down, eliminating the lock and preventing the error.
10. Verification
- After applying one of the solutions, return to SIMATIC Manager > Project > Archive.
- Select the destination drive and filename. The dialog returns Archive successful without
(3020:25)or(256:67). - Open the resulting ZIP or CAB file in 7-Zip, WinRAR, or Windows Explorer and confirm the project tree, all
.s7p,.s7f,.s7l,.mdf,.ldf,.log, and.sdbfiles are present and non-zero in size. - From the OS server, reattach the RT database and verify the WinCC RT starts cleanly. Watch the WinCC diagnostic window (WinCC Explorer > Tools > Status of Connected Servers) for red status entries.
- Run
sqlcmd -S .\WINCC -E -Q "SELECT name, state_desc FROM sys.databases WHERE name LIKE '%RT%'"and confirm the RT database is inONLINEstate.
11. Prevention Checklist
- Create a scheduled task that stops the WinCC services and SQL Server instance 5 minutes before the scheduled archive window, then restarts them 5 minutes after. Use
net stop "SIMATIC WinCC Runtime"andnet start "SIMATIC WinCC Runtime". - Add the PCS 7 project directory to the antivirus exclusion list to prevent on-access scans from opening files mid-archive.
- Disable Windows Search Indexer (
WSearch) on the engineering station drive that hosts the project. - Avoid opening the project in two SIMATIC Manager instances simultaneously; use Project > Save As or a read-only project viewer instead.
- Keep WinCC and SQL Server patched to the latest cumulative update supported by the PCS 7 release. Reference SIMATIC PCS 7 Updates and Support Packs.
- Periodically validate that
reset_wincc.vbsstill exists in the installation directory. If it is missing, reinstall WinCC from the PCS 7 setup.
12. Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
(3020:25) only, no file names listed |
STEP 7 editor handle not released | Close HW Config / NetPro / CFC, kill S7OM.exe via Task Manager |
(256:67) with OS(1)RT.mdf
|
WinCC RT attached to RT database | Take database offline in SSMS (Solution B) |
(256:67) with OS(1)Tlg.ldf only |
Tag logging service holding transaction | Stop CCTlgSvc via services.msc
|
Error persists after killing sqlservr.exe
|
Antivirus or backup agent reopened the handle | Pause antivirus real-time scan; rerun archive |
| Error appears immediately after Windows boot | Auto-started WinCC services | Set services to Manual per Section 9 |
| Archive stops mid-write, no error code | Disk full or path too long ( > 260 chars) | Free up disk, shorten project path, enable Win32 long paths |
| Archive OK on engineering station, fails on terminal server | User session has no Take Offline rights on SQL | Grant db_owner on the OS RT database or run reset_wincc.vbs as administrator |
13. Related Siemens Support Resources
- SIMATIC PCS 7 - Documentation
- PCS 7: Errors when archiving a project
- PCS 7 Updates and Support Packs download area
- SIMATIC WinCC V7.5 System Manual
- SIMATIC Process Control System PCS 7 - Service Support and Diagnostics
Frequently Asked Questions
What is error 3020:25 in PCS 7 archiving?
Error 3020:25 means the SIMATIC Manager archive utility could not obtain an exclusive read lock on one or more files in the project tree because another STEP 7 or Windows process still holds a handle. Close every SIMATIC editor, stop WinCC services, and rerun Project > Archive.
What does error 256:67 with OS(1)RT.mdf mean?
It indicates that the WinCC runtime database OS(1)RT.mdf and its associated log files OS(1)RT.ldf and OS(1)Tlg.ldf are still attached to the SQL Server instance, so SQL Server holds an exclusive file handle that prevents the archive copy. Take the database offline in SQL Server Management Studio or run reset_wincc.vbs.
Is it safe to kill sqlservr.exe?
On an engineering station where the OS runtime is not actively controlling a process, yes — it is a documented field-proven workaround. On a production OS server, prefer taking the database offline via SSMS so open transactions are committed cleanly.
Where is the reset_wincc.vbs script located?
The script ships with every WinCC installation in C:\Program Files (x86)\Siemens\Automation\WinCC\bin\reset_wincc.vbs (or the matching ...\PCS7\WinCC\bin path on PCS 7 V9). Run it from an elevated command prompt with cscript reset_wincc.vbs.
How do I prevent error 3020:25 from recurring?
Set all SIMATIC WinCC and SQL Server services to Manual startup on the engineering station, exclude the PCS 7 project directory from antivirus real-time scans, and archive only after confirming no sqlservr.exe, CCAlgLogSrv.exe, or WinCCExplorer.exe instance is running.