Safely Shutting Down SIMATIC Process Historian via Command-Line Utilities

Safely Shutting Down SIMATIC Process Historian via Command-Line Utilities

Never terminate SIMATIC Process Historian (PH) using generic Windows commands like 'net stop' or 'SC stop HISTORIAN', as doing so risks corrupting active Microsoft SQL Server transaction logs and pending archive segments. Instead, execute the official Siemens utility StoppProcessHistorian.exe (located in C:\Program Files\Siemens\ProcessHistorian\bin). This utility sets Process Historian to IDLE, finishes processing in-flight OS server data packages, flushes cache buffers to disk, and systematically shuts down dependent services and the database engine. Incorporate this executable into automated UPS power-loss scripts or scheduled maintenance workflows.

Table of Contents

Risks of Abrupt Windows Service Termination on Process Historian

SIMATIC Process Historian serves as the centralized long-term archiving backbone for PCS 7 and WinCC SCADA systems. It continuously streams high-volume telemetry, alarm logs, and batch records from redundant OS Servers into partitioned Microsoft SQL Server databases. When an operator or automated script executes a raw service stop—such as SC \\localhost stop HISTORIAN or taskkill—the operating system abruptly aborts active database writes.

Consequences of unsafe shutdown include:

  • SQL Database Recovery Pending: Uncommitted SQL transactions remain unwritten, forcing the database into Recovery Pending or Suspect mode upon restart.
  • Archive Segment Fragmentation: Active archive segments fail to detach cleanly, leaving database catalog tables out of sync.
  • Loss of OS Store-and-Forward Cache: The OS servers, assuming the PH is in an orderly shutdown, may fail to trigger their local buffer caching mechanism properly, leading to permanent data gaps.

Architecture of StoppProcessHistorian.exe and State Transitions

To prevent database corruption and preserve complete data integrity, Siemens provides a dedicated shutdown utility:

  • Executable Path: C:\Program Files\Siemens\ProcessHistorian\bin\StoppProcessHistorian.exe

When invoked, StoppProcessHistorian.exe executes a rigorous multi-stage shutdown protocol:

  1. Signal State Transition to IDLE: It instructs the Process Historian management engine to transition from Active to Idle.
  2. Flush Network Buffers: It finishes receiving and writing all queued data packets currently in transit from connected OS Servers.
  3. Commit Database Transactions: It forces Microsoft SQL Server to commit all dirty buffer pages to physical disk storage.
  4. Close Active Segments: Open database partitions and archive segments are dismounted cleanly.
  5. Stop Dependent Services: Once database integrity is secure, it terminates the Process Historian Windows services and SQL Server instances gracefully.

Integrating Orderly Shutdown into Automated UPS and Maintenance Scripts

For automated uninterruptible power supply (UPS) integration (e.g. APC PowerChute, Eaton Intelligent Power Manager) or scheduled server reboot scripts, create a robust batch script (Safe_PH_Shutdown.bat):

@echo off
echo Initiating orderly SIMATIC Process Historian shutdown...
cd /d "C:\Program Files\Siemens\ProcessHistorian\bin"
start /wait StoppProcessHistorian.exe
if %ERRORLEVEL% EQU 0 (
    echo Process Historian stopped successfully in IDLE mode.
) else (
    echo Warning: Shutdown utility returned error code %ERRORLEVEL%.
)

Configure your UPS power management software to trigger this script immediately when utility power failure exceeds battery hold-up thresholds, ensuring the server completes the graceful shutdown before invoking Windows shutdown /s.

Comparison of Process Historian Shutdown Methods

The following table compares different shutdown methods for SIMATIC Process Historian servers:

Shutdown MethodExecution Command / ToolRisk of Database CorruptionOS Server Store-and-Forward Triggered?Recommended Use CaseSiemens Utility (Official)StoppProcessHistorian.exeZero (Clean Flush)Yes (Clean OS Handshake)UPS automation, maintenance scriptsProcess Historian GUIPH Management Console -> StopZero (Clean Flush)Yes (Clean OS Handshake)Manual engineering shutdownsGeneric Windows Service StopSC stop HISTORIAN / net stopHigh (Uncommitted writes)Partial / UnreliableStrictly discouragedWindows Force Shutdownshutdown /f /s /t 0Extreme (Suspect database)No (Data packets dropped)Emergency hardware protection only

[!NOTE]
Commercial Accuracy Notice: SIMATIC Process Historian (6ES7652-7AX58-0YB0) requires dedicated server hardware licensing > and Microsoft SQL Server packages. Safe shutdown utilities are included in the base installation and do not consume licenses.

Verification

Confirm that Process Historian has safely stopped:

  1. Management Console State: Open the Process Historian Management Console or inspect the system tray icon. Verify that the status indicator transitions to Idle or Stopped (yellow/gray icon).
  2. Event Log Inspection: In the Windows Event Viewer, navigate to Applications and Services Logs -> Siemens -> Process Historian. Confirm that the shutdown sequence concludes with an informational entry: 'Process Historian stopped cleanly'.
  3. Clean Restart Test: Restart the server. Verify that SQL Server database partitions mount immediately without triggering recovery phases or missing archive segments.

Limitations and Operational Precautions

Observe these operational limits when shutting down Process Historian:

  1. Shutdown Duration: Flusing deep buffer queues can take from 30 seconds to several minutes depending on plant size. Configure UPS battery run-time thresholds with at least 5 minutes of grace time.
  2. OS Server Caching Capacity: While PH is offline, OS Servers cache data locally in circular buffers. Ensure PH is not kept offline longer than the configured OS local store-and-forward retention time.
  3. Redundant Process Historian Pairs: If operating a redundant Process Historian pair, shut down the standby node first, verify master failover, and ensure redundancy synchronization completes upon restart.

Engineer FAQ

Where is the StoppProcessHistorian.exe utility located?

It is located in the Process Historian installation binary directory: C:\Program Files\Siemens\ProcessHistorian\bin\.

Why shouldn't I use 'net stop' to halt the Historian service?

Generic service commands do not notify the active SQL storage engine to flush transactions or close open partitions cleanly, which can lead to database corruption.

How do OS servers behave when Process Historian is stopped cleanly?

OS servers detect the graceful disconnect, close the active TCP socket, and begin spooling process values and messages into their local hard drive store-and-forward buffers.

Can I restart Process Historian automatically using a script?

Yes. Siemens provides StartProcessHistorian.exe in the same bin directory to resume active archiving cleanly after server maintenance.

Technical References

Related Articles

Related Tags

  • Process Historian
  • Safe Shutdown
  • StoppProcessHistorian
  • SQL Server
  • Store and Forward
  • UPS Script
6 respuestas