Resolving Database Context Does Not Exist Error During PCS 7 OS Download

Resolving Database Context Does Not Exist Error During PCS 7 OS Download

The error 'Database context does not exist or is invalid' during a SIMATIC PCS 7 OS download from the Engineering Station to a target Operator Station occurs when remote SQL Server and DCOM communication cannot establish a validated session. The primary causes are non-compliant computer hostnames (such as hostnames containing hyphens like 'OS5-PC'), mismatched network credentials, restricted Windows folder sharing permissions on the target OS project folder, or active WinCC runtime locks. To resolve this, rename target PC hostnames to strict NetBIOS-compliant strings (alphanumeric only, no hyphens or underscores), share the target directory with full permissions for the 'SIMATIC HMI' group, and ensure WinCC is closed on the target PC before downloading.

Table of Contents

OS Download Mechanism and SQL Server Remote Database Context

In SIMATIC PCS 7, downloading an Operator Station (OS) from the Engineering Station (ES) across the terminal bus copies project databases, graphic screens (*.pdl), scripts, and configuration metadata. The download engine relies on Microsoft SQL Server integration (WinCC SQL Instance), DCOM remote procedure calls, and Windows Network Sharing (SMB).

When the ES initiates a download, it contacts the remote OS, creates a remote database context within the SQL Server instance, and streams database transaction logs. If the ES cannot resolve the target computer name, if SQL Server rejects the remote connection token, or if the target project path is inaccessible, the transfer fails after copying initial files with the error: 'Database context does not exist or is invalid'.

Root Causes: Hostname Violations, DCOM, and Network Sharing

Three technical conditions account for this failure:
1. Invalid Computer Hostname (Hyphens / Special Characters): Siemens industrial software strictly enforces NetBIOS naming rules: computer names must be uppercase alphanumeric characters only (maximum 15 characters, A-Z, 0-9). Using hyphens (OS5-PC) or underscores (OS_SERVER_1) breaks SQL Server distributed query handlers and DCOM connection string parsing.
2. Target Folder Sharing and Security Permissions: The destination project folder on the target OS must be shared with full read/write permissions. Both Windows Sharing and NTFS Security permissions must explicitly grant Full Control to the SIMATIC HMI and Siemens TIA Engineer user groups.
3. WinCC Project State on Target PC: An OS download cannot overwrite an open or running WinCC project. If WinCC Explorer or WinCC Runtime is active on the target station, database locks prevent replacing the *.mdf database files.

Diagnostic Matrix for OS Download Failures

The table below details diagnostic indicators, root causes, and remediation actions for OS download faults:

Diagnostic IndicatorError LocationUnderlying Root CauseCorrective Engineering ActionDatabase context invalidES Download WizardHyphen in hostname (OS5-PC) or SQL connection timeout.Rename PC to strict NetBIOS name (e.g., OS5PC); update hosts file.Access Denied / 0x80070005Windows Network CopyTarget folder not shared or user not in SIMATIC HMI.Grant Full Control to SIMATIC HMI on target share and NTFS.Project already openTarget OS StationWinCC Explorer or background runtime processes running.Close WinCC on target OS; run CCResetProject.exe if necessary.PLC STOP Fear (Myth)Operational ConcernDownloading OS feared to halt AS controller.Clarify: OS downloads only affect HMI stations; zero impact on PLC RUN mode.SimaticShell red crossWindows ExplorerPre-Shared Key mismatch or network adapter priority.Configure identical PSK and bind terminal bus adapter in Simatic Shell.

Step-by-Step OS Download Remediation Procedure

  1. Enforce NetBIOS Computer Naming:
    - On the target station, open Control Panel -> System -> Change settings.
    - Rename the computer from OS5-PC to a compliant alphanumeric string, such as OS5PC (no hyphens, max 15 characters).
    - In SIMATIC Manager on the ES, update the PC Station object name in the project tree to match OS5PC.
  2. Configure Static Name Resolution:
    - On both ES and target OS, open C:\Windows\System32\drivers\etc\hosts as Administrator.
    - Add static mapping entries for IP address and computer name for all engineering and operator stations.
  3. Configure Target Folder Sharing and Permissions:
    - On the target PC, create or locate the target project folder (e.g., D:\WinCC_Projects).
    - Right-click -> Properties -> Sharing -> Advanced Sharing: enable sharing with Full Control for Everyone and SIMATIC HMI.
    - In the Security tab, grant Full Control to local group SIMATIC HMI.
  4. Synchronize Simatic Shell Communication:
    - On both ES and target OS, open Computer -> Simatic Shell -> Settings.
    - Ensure the terminal bus network card is selected as the active communication adapter.
    - If encrypted communication is used, ensure the Pre-Shared Key (PSK) matches identically.
  5. Execute OS Download:
    - Ensure WinCC is completely closed on OS5PC.
    - In SIMATIC Manager on the ES, right-click the OS object -> select PLC -> Download.
    - Select Entire Project (or Changes Only if an initial download already exists). The transfer will complete cleanly.

Verification

Verify download success through the following milestones:
1. Confirm that the ES download progress bar completes smoothly to $100\%$ without database context abort dialogs.
2. Log onto the target operator station: verify that the WinCC project directory contains all transferred *.mdf, *.ldf, and GraCS files.
3. Open WinCC Explorer on the target OS: activate Runtime and confirm that mimic screens, alarm lists, and trends display live process data.

Limitations and Operational Precautions

Renaming an existing industrial computer requires administrative planning: all Windows local group memberships, DCOM identity tokens, and SQL Server server names (@@SERVERNAME) must be updated to avoid orphaned database instances. Crucially, emphasize to operations that downloading an OS station never interrupts controller execution; the AS controllers remain in full RUN mode maintaining active plant automation throughout OS downloads.

Engineer FAQ

Technical References

Related Articles

Related Tags

  • OS Download
  • Database Context
  • Computer Names
  • Simatic Shell
  • NetBIOS
  • PCS 7 Engineering
6 respuestas