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
- Architecture of StoppProcessHistorian.exe and State Transitions
- Integrating Orderly Shutdown into Automated UPS and Maintenance Scripts
- Comparison of Process Historian Shutdown Methods
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
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 PendingorSuspectmode 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:
- Signal State Transition to IDLE: It instructs the Process Historian management engine to transition from
ActivetoIdle. - Flush Network Buffers: It finishes receiving and writing all queued data packets currently in transit from connected OS Servers.
- Commit Database Transactions: It forces Microsoft SQL Server to commit all dirty buffer pages to physical disk storage.
- Close Active Segments: Open database partitions and archive segments are dismounted cleanly.
- 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:
StoppProcessHistorian.exeSC stop HISTORIAN / net stopshutdown /f /s /t 0[!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:
- 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).
- 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'.
- 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:
- 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.
- 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.
- 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
- SIMATIC Process Historian Administration and Configuration Guide (Entry ID 109780813)
- SIMATIC PCS 7 Operator Station OS Long-Term Archiving Manual (Entry ID 109754984)
- WinCC Process Historian Store-and-Forward Best Practices (Entry ID 109751826)
- Siemens Industry Online Support Process Historian Command Line Reference (Entry ID 89257244)
Related Articles
- Installing Process Historian Microsoft Office Add-in and Architecture Rules
- Configuring OS Simulation in SIMATIC PCS 7 Engineering Stations
- Why Save As With Reorganization Turns NetPro Stations Orange in PCS 7
- Resolving Faulty 1995 Alarm Timestamps in PCS 7 WinCC Alarm Logging
Related Tags
- Process Historian
- Safe Shutdown
- StoppProcessHistorian
- SQL Server
- Store and Forward
- UPS Script