Resolving XML Archive Errors and Stalled Database Synchronization in Redundant SIMATIC BATCH Servers

Resolving XML Archive Errors and Stalled Database Synchronization in Redundant SIMATIC BATCH Servers

In redundant SIMATIC BATCH servers (such as PCS 7 V9.0 SP1), the error 'An error occurred during the creation of the XML archive file' occurs because batch orders cannot transition to the 'Closed' state and cannot be archived while server database synchronization (CDV sync) is actively running or stalled. When the secondary standby server database becomes corrupted or out of synchronization (often following a process cell update or unscheduled server failover), the synchronization handshake stalls indefinitely, leaving completed batches stuck in a state of 'closing'. To resolve this, stop BATCH services on the standby server, delete or rename the corrupted SB9 database folder on the standby server, perform a fresh process cell download from the ES to recreate the SB9 directory, restart BATCH services to allow an orderly initial synchronization from the master server, execute a controlled server switchover, and complete all pending orders before re-attempting XML batch archiving.

Table of Contents

Executive Summary

In regulated chemical, pharmaceutical, and food and beverage manufacturing operations governed by SIMATIC BATCH, batch archiving represents an essential legal and regulatory compliance requirement. The BATCH Control Center (BCC) provides automated and manual XML archiving mechanisms to generate tamper-evident, permanent electronic batch records (EBR). However, in high-availability redundant BATCH server environments, engineers frequently encounter an abrupt failure mode: attempting to archive any completed batch triggers the fatal error: 'An error occurred during the creation of the XML archive file.'

Investigation into the Batch Result list invariably reveals that batch orders completed days or weeks prior remain frozen in a state of 'closing', while redundant server diagnostics show that continuous data validation (CDV) and database synchronization have been running continuously without ever completing. Because SIMATIC BATCH strictly prohibits archive generation while redundant databases are desynchronized, an unresolved database synchronization lock halts all archiving workflows. This technical guide explains the architectural relationship between redundant BATCH databases, the SB9 database structure, and XML archive generation, providing a field-proven 12-step recovery procedure to clear corrupted standby caches and restore seamless batch archiving.

Architecture and Fundamental Mechanics

The SIMATIC BATCH redundant server architecture relies on real-time database replication and strict transactional integrity:
1. Redundant Database Architecture (SB9):
* SIMATIC BATCH maintains its primary process cell data, recipe hierarchies, batch execution logs, and historical phase events within a dedicated database directory structure historically designated as SB9 (located under C:\Program Files (x86)\Siemens\Automation\Batch\Data\SB9 or configured storage paths).
* The active BATCH Master server processes recipe execution and records real-time step transitions into its local database.
* The BATCH Standby server receives real-time transaction logs and continuous data validation (CDV) frames over the terminal bus to keep its local SB9 directory identical to the master.
2. The Mechanism of Synchronization Stalls:
* If a process cell update is downloaded from the Engineering Station while batches are running, or if an abrupt server reboot occurs during heavy batch logging (e.g., in a 14 GB batch database), the transaction log sequence on the standby server can become out-of-order or corrupt.
* When the servers attempt to synchronize, the CDV engine detects checksum mismatches. Rather than aborting, the synchronization engine enters a continuous, high-overhead comparison loop that runs indefinitely.
3. Locking of Batch Closure and XML Archiving:
* A batch order cannot transition from the 'closing' state to the 'closed' state until both redundant servers acknowledge that all batch step logs, operator messages, and electronic signatures have been fully mirrored and committed across both databases.
* Furthermore, the SIMATIC BATCH XML export engine enforces a mandatory safety interlock: it will NOT generate an XML archive file if server synchronization is active or incomplete, because archiving desynchronized data could produce an incomplete or legally compromised batch record.
* Consequently, the XML archive routine throws 'An error occurred during the creation of the XML archive file', and all batches remain trapped in 'closing'.

Step-by-Step Implementation Procedure

Step 1: Verify Server Status and Stop Standby BATCH Services

  1. In SIMATIC BATCH Control Center (BCC), inspect the server status: identify which server is currently the Master (BATCH01) and which is Standby (BATCH02).
  2. Log onto the Standby server (BATCH02) with Windows administrative privileges.
  3. Open Windows Services (services.msc).
  4. Locate all SIMATIC BATCH services (including BATCH Server, BATCH CDV, and BATCH Start Coordinator).
  5. Stop the services and temporarily change their startup type to Manual to prevent automated restart during maintenance.
  6. Reboot the Standby server (BATCH02) to release all locked database handles.

Step 2: Clear Corrupted Standby Database Directory (SB9)

  1. On the Standby server (BATCH02), navigate to the BATCH data directory (typically C:\Program Files (x86)\Siemens\Automation\Batch\Data or the designated project partition).
  2. Locate the folder named SB9 (or BatchDatabase).
  3. Rename the folder to SB9_Corrupt_Backup (or delete it if sufficient external backups exist).

Step 3: Recreate Clean Database Shell via ES Process Cell Download

  1. On the Engineering Station (ES), open SIMATIC Manager.
  2. Open the BATCH process cell configuration (SIMATIC BATCH > Open).
  3. Compile the process cell: Process Cell > Compile.
  4. Perform a target system download of the process cell to the Standby server (BATCH02). This creates a clean, uncorrupted SB9 folder structure on the standby server.

Step 4: Re-enable Standby Services and Execute Master-to-Standby Sync

  1. On BATCH02, reset the SIMATIC BATCH services startup type back to Automatic.
  2. Start the SIMATIC BATCH services on BATCH02.
  3. Allow the primary Master server (BATCH01) to synchronize its active 14 GB database to the newly initialized Standby server (BATCH02).
    * Note: Depending on database size and network bandwidth, synchronizing a 14 GB database may take several hours. Monitor disk I/O and folder size in SB9 on BATCH02 until it matches BATCH01.

Step 5: Perform Controlled Server Switchover and Final Alignment

  1. Once file comparison confirms folder parity, stop BATCH services on the primary server (BATCH01).
  2. Verify that the Standby server (BATCH02) smoothly assumes the Master role without dropping active batch control.
  3. Repeat the cleanup and resynchronization steps on BATCH01 (stop services, rename SB9, download from ES, restart services).
  4. Allow BATCH01 to synchronize from BATCH02.
  5. Once synchronization finishes and BCC shows redundant status 'Synchronized' without active sync flags, stop services on BATCH02 to return BATCH01 to its primary Master role.

Step 6: Complete Stalled Batches and Generate XML Archives

  1. In BCC, observe the Batch Result list: confirm that batches previously stuck in 'closing' now transition automatically to 'Closed'.
  2. Highlight a closed batch order, right-click, and select Archive.
  3. Confirm that the XML archive generation executes smoothly and deposits the .xml archive into the configured archive directory.

Verification

  1. In SIMATIC BATCH Control Center, open the server redundancy status dialog: confirm both servers show green status indicators and report 'Redundant' and 'Synchronized' with zero active sync tasks.
  2. Check the Batch Result list: verify that completed batches transition from 'closing' to 'Closed' within 30 seconds of batch termination.
  3. In BCC, execute manual or automatic batch archiving: confirm that the XML archive file is created successfully without error dialogs.
  4. Open the configured archive storage path: verify that the generated XML file contains complete recipe headers, phase transition logs, and operator input records.
  5. In Windows Event Viewer on both BATCH servers, verify that the SIMATIC BATCH event log contains zero synchronization timeout or CDV checksum error entries.

Limitations and Operational Precautions

  1. Never delete the SB9 folder on the active Master server while batches are running; clearing the master database will destroy active batch execution contexts.
  2. Ensure adequate disk storage space is maintained on both servers; large batch databases (> 10 GB) require substantial free disk space during synchronization transactions.
  3. Performing process cell updates while batches are executing in production carries significant risk of synchronization divergence; schedule process cell downloads during recipe transition intervals.
  4. Ensure network firewalls permit SIMATIC BATCH communication ports across the terminal bus without packet throttling.

Engineer FAQ

Why does a running database synchronization block XML batch archiving?

To guarantee legal data integrity (CFR 21 Part 11 compliance), SIMATIC BATCH blocks archiving while servers are synchronizing to prevent creating incomplete or desynchronized electronic batch records.

What does the state 'closing' mean in the Batch Result list?

It means the physical batch process has ended, but the system is waiting for final event logs, recipe data, and operator entries to be fully synchronized and committed across both redundant server databases.

How can I tell if redundant BATCH servers are still synchronizing?

In BCC, check the status line at the bottom of the window, or compare the size and modified timestamps of files within the SB9 directory on both servers.

How large can a SIMATIC BATCH database become before performance degrades?

While modern SQL-based BATCH databases support large volumes, databases exceeding 10–15 GB experience prolonged synchronization times. Regular archiving and database detaching are strongly recommended.

Do I need an additional license for redundant SIMATIC BATCH servers?

Yes. Operating redundant BATCH servers requires the SIMATIC BATCH Server license on each machine and the SIMATIC BATCH Redundancy option package. Consult an authorized Siemens distributor or the Siemens Industry Mall for exact licensing packages.

Technical References

Related Articles

Related Tags

  • SIMATIC BATCH
  • Batch Archiving
  • XML Archive
  • Batch Redundancy
  • SB9 Database
20 respuestas