Resolving Multiproject Archiving Failures and WinCC Database Locks in SIMATIC PCS 7

Resolving Multiproject Archiving Failures and WinCC Database Locks in SIMATIC PCS 7

When archiving a SIMATIC PCS 7 multiproject fails in SIMATIC Manager with generic error messages or access violations, the primary root cause is an active Microsoft SQL Server file lock on the OS project's database files (.mdf and .ldf). Even when WinCC Runtime is stopped, background processes (such as CCProjectMgr.exe or sqlservr.exe) maintain exclusive locks if an OS project remains open in WinCC Explorer. To resolve this, open each OS project in WinCC Explorer, select 'File > Close Project', close WinCC Explorer completely, and execute Reset_WinCC.vbs if locks persist. Then re-attempt archiving via 'File > Archive' in SIMATIC Manager.

Table of Contents

Executive Summary

Regular project archiving via SIMATIC Manager (File > Archive...) is the mandatory backup standard across all SIMATIC PCS 7 automation lifecycles. However, engineers managing multi-station engineering projects (containing multiple S7 programs, safety controllers, and redundant OS servers) frequently report archiving aborts. The compression utility begins packing files, only to halt with an error dialog stating 'The archive could not be created' or 'Access denied'. While engineers often suspect corrupted project files or defective hard drives, the underlying cause is almost always an exclusive file handle lock held by the Microsoft SQL Server instance running WinCC. Releasing these database attachments allows the archiver to generate clean, complete .zip backups.

SIMATIC Manager Archiving Architecture and File Lock Mechanics

When archiving a multiproject in SIMATIC Manager:

  • The built-in archiver (PKZip engine) traverses every subdirectory of the multiproject folder structure.
  • It reads files sequentially: CFC chart files, symbol tables, SCL sources, and WinCC OS database folders.
  • In WinCC OS folders, the project configuration resides inside Microsoft SQL Server files (<ProjectName>.mdf and <ProjectName>.ldf).
  • If any operating system process holds an exclusive read/write lock on these binary database files, the archiver cannot open the file for compression and immediately terminates the entire archiving process.

Why WinCC SQL Server Handles Block ZIP Archiving

Microsoft SQL Server operates with high data integrity constraints:

  • As long as a WinCC project is loaded in WinCC Explorer, the SQL Server service (sqlservr.exe under instance WINCC) keeps the database mounted.
  • Even after closing Graphic Designer or deactivating Runtime, background processes (CCProjectMgr.exe, CCExp.exe) keep the database attached to the SQL instance.
  • Selecting File > Close Project in WinCC Explorer issues a formal sp_detach_db command, releasing the file locks and allowing external zip utilities full read access.

Diagnostic Matrix for Common Archiving Failure Symptoms

The following table summarizes common archiving errors in SIMATIC PCS 7 and their resolutions:

Error SymptomRoot CauseAffected FilesCorrective Engineering ActionArchive aborted: Access deniedSQL Server holds exclusive file lock*.mdf / *.ldf in OS folderClose project in WinCC Explorer; run Reset_WinCC.vbs.File path too long (>260 chars)Deep Plant Hierarchy directory nestingDeeply nested GraCS / picture foldersShorten destination path or archive to root drive C:\Temp.Disk full errorDestination drive lacks sufficient spaceTarget .zip archiveEnsure destination drive has at least 3x uncompressed project size.Archive corrupted on retrieve7-Zip / third-party tool incompatibilityEntire .zip fileAlways archive and retrieve using native SIMATIC Manager tools.Multiproject link missingProject moved without SIMATIC Manager*.s7p cross-pointersRe-link subproject via Multiproject > Add to Multiproject.

Step-by-Step Procedure to Unlock Projects and Archive Successfully

Method 1: Cleanly Detaching OS Projects via WinCC Explorer

  1. Open SIMATIC Manager on the Engineering Station.
  2. Navigate to each OS project container in the Component View.
  3. Right-click the OS and select Open Object (opens WinCC Explorer).
  4. In WinCC Explorer, select File > Close Project from the menu bar.
  5. Close WinCC Explorer completely.
  6. Repeat this step for all OS Servers, OS Clients, and Maintenance Stations in the multiproject.
  7. Return to SIMATIC Manager, select File > Archive..., choose Multiprojects, and click OK.

Method 2: Forcing Database Release via Reset_WinCC.vbs

  1. If archiving still fails due to background SQL processes:
  2. Close SIMATIC Manager and all engineering applications.
  3. Open the Windows Run dialog (Windows Key + R).
  4. Enter: cmd to open the command prompt.
  5. Execute the Siemens database reset script: Reset_WinCC.vbs (located in C:\Program Files (x86)\Siemens\WinCC\bin).
  6. The script terminates all hanging WinCC background tasks and cleanly detaches locked SQL databases.
  7. Re-open SIMATIC Manager and execute File > Archive....

Verification

To verify that the project archive is complete and valid:

  1. Archive Size Check: Confirm that the resulting .zip file has a realistic size (typically 100 MB to 2 GB for full multiprojects).
  2. Test Retrieval: Test the backup by selecting File > Retrieve... into a temporary directory (e.g. C:\Test_Retrieve).
  3. Integrity Validation: Confirm that the retrieved project opens with zero missing subproject warnings and all CFC charts and OS graphics load cleanly.

Limitations and Operational Precautions

  • Never Archive via Windows Explorer: Do not use Windows Explorer or third-party tools (WinRAR, 7-Zip) to compress active project folders; internal database pointer integrity is only guaranteed when using SIMATIC Manager's native archiver.
  • Do Not Reset_WinCC on Active Production Servers: Running Reset_WinCC.vbs on a live, running OS Server terminates active operator control and alarm logging; execute this utility only on the Engineering Station.
  • Destination Storage: Never archive directly to network drives or removable USB flash drives with slow write caches; archive to local high-speed SSD storage first, then copy the completed .zip file.

Engineer FAQ

Can I exclude historical trend archives from the project backup to reduce file size?

Yes, in WinCC Explorer Tag Logging / Alarm Logging properties, archives can be detached or stored in separate backup paths before archiving.

Why does SIMATIC Manager create a .zip file instead of .arj in modern versions?

Modern PCS 7 versions standardize on standard PKZip compression; older V5/V6 versions historically utilized the ARJ compression format.

Does archiving a project create a CPU download timestamp discrepancy?

No. Archiving is a passive file read operation that has zero impact on offline or online controller compilation timestamps.

Technical References

Related Articles

Related Tags

  • https://industrialautomation.net/search?query=simatic-pcs7
  • https://industrialautomation.net/search?query=archiving
  • https://industrialautomation.net/search?query=backup
  • https://industrialautomation.net/search?query=wincc
6 respuestas