1. Problem Overview
The SIMATIC BATCH server reports the message "Batch could not be archived" in the Batch Control Center for individual batch records even though the archive files (XML master data + PDF report) appear on disk and the affected batches display the padlock / locked icon in the batch list. The condition is intermittent: only a subset of completed batches fails to clear the pending archive status, while the remainder archive normally on the configured schedule.
This behavior is reproduced in PCS 7 / SIMATIC BATCH installations using the auto-archive function (default 24 h after batch close in many plants). The failure does not indicate that the XML/PDF archive pair is missing — the pair is created successfully on the first archive attempt. The red status in the Batch Control Center and the locked icon persist because the BATCH server attempts a second archive transaction, finds the archive target already populated, and aborts with the generic error.
2. Symptoms Checklist
Engineers should confirm the following field indicators before applying the resolution steps in Section 5:
| Indicator | Expected (Healthy) | Observed (Fault) |
|---|---|---|
| XML master data file in archive directory | Present after first archive pass | Present |
| PDF batch report in archive directory | Present after first archive pass | Present |
| Batch list icon in Control Center | Open (unlocked) | Closed padlock / locked |
| Status text for batch row | "Archived" or empty status field | "Batch could not be archived" |
| Number of affected batches | 0 | Subset (often correlated to batches in flight when BATCH server was restarted) |
| Batch server event log | Archive success entries | Red error entries ~30 min after first archive |
| SQL BATCH database growth | Stable after archive | Rows retained for failed batches |
The two-stage failure pattern (first archive succeeds, a follow-up attempt ~30 minutes later fails) is the most reliable fingerprint of this defect and is the trigger for the Siemens-recommended fix.
3. Root Cause Analysis
Siemens documents the underlying defect in the support article SIMATIC BATCH: Message indicating archiving problems when updating a batch process cell. The proximate cause is duplicate identifiers in the BATCH database for the data types used by the affected batches.
The BATCH database (Microsoft SQL Server, typically named BATCH or project-specific) stores the master data catalog that maps each formula / recipe / data type to a numeric identifier. Over the life of an installation — particularly across software updates, process cell re-engineering, and bulk imports of master data from older releases — multiple rows can accumulate with the same data type ID. When the archive routine processes a batch whose data type participates in this duplicate set, the SQL join produces a non-unique result, the archive transaction is rolled back, and the server flags the batch as archived with error.
The defect manifests in the user interface as a residual "could not be archived" status because:
- The first archive pass reads the BATCH database without the duplicate-ID filter, writes the XML and PDF correctly, and the on-disk artifacts are present.
- The follow-up pass (default interval ~30 min, controlled by the BATCH server's archive retry loop) attempts to re-archive; the duplicate-ID join produces a multi-row result and the second write fails, leaving the batch marked as error in the database even though the archive itself succeeded on disk.
- Restarting the BATCH service does not clear the status flag for batches whose database row already records the failed state, so the error persists across reboots until the underlying data is corrected.
3.1 Trigger Conditions
Three operator actions are known to expose latent duplicate IDs:
- Bulk import of process cell data from a backup or a sibling project without purging the staging schema.
- Applying a SIMATIC BATCH update (for example, upgrading from V8.2 to V9.0) without running the supplied database migration script.
- Manual edits to BATCH master data in the engineering tool (BATCH Configuration) that re-use an existing data type ID after a process cell is re-versioned.
4. Affected Versions and Update Matrix
The following table summarizes the released patch level and the database optimization requirement. The patch addresses the symptom; the database optimization eliminates the root cause.
| SIMATIC BATCH Version | Patch / Update | Database Optimization Required? | Status |
|---|---|---|---|
| V8.2 SP1 | SP1 Upd4 or later | Yes (one-time) | Defect present, patched |
| V9.0 | SP1 | Yes (one-time) | Defect present |
| V9.0 SP1 | Upd1 | Yes (one-time) | Defect present |
| V9.0 SP1 | Upd2 | Yes (one-time) | Defect present |
| V9.0 SP1 | Upd3 | Recommended (one-time) | Latest correction level; optimization still recommended to clear historical duplicates |
| V9.1 and later | Latest HF | Optional if never imported from V8.x | Database schema tightened; defect closed |
9.0.1.3 for SP1 Upd3). Plants below V9.0 SP1 Upd3 should schedule the update before continuing.
5. Resolution Procedure
Resolve the fault in the order shown. Skipping the database optimization and applying only the patch leaves the historical duplicate rows in place, and the error will resurface after the next process cell update.
5.1 Prerequisites
- Windows administrator account on the BATCH server with local admin rights.
- SQL Server
sysadminrole membership for the BATCH database. - Confirmed full backup of the BATCH database and the archive directory.
- Scheduled maintenance window — the BATCH server will be stopped for the duration.
- SIMATIC BATCH installation media for the current version (for the update install).
5.2 Step 1 — Snapshot the BATCH Database and Archive Directory
- Stop the SIMATIC BATCH service:
net stop "SIMATIC BATCH Server"from an elevated command prompt. - Stop any active Batch Control Center clients to release database locks.
- In SQL Server Management Studio, take a full database backup of the
BATCHdatabase to a network share. Verify the backup set withRESTORE VERIFYONLY. - Copy the entire archive directory (default:
C:\Siemens\Automation\Batch\Archiveor the project-specific path) to a separate location. Confirm the XML/PDF pairs for the affected batches are included.
5.3 Step 2 — Apply SIMATIC BATCH Update
- Mount the SIMATIC BATCH installation media for the current major version.
- Run
Setup.exeand select Update Installation. - Confirm the installed build number matches the target patch (for example,
9.0.1.3). - Allow the installer to migrate the BATCH database if prompted. Do not interrupt the migration — interruption leaves the database in a partial state.
- Reboot the BATCH server.
5.4 Step 3 — Run the BATCH Database Optimization
Siemens ships a SQL script with the support article 109962043. The script identifies and de-duplicates the offending data type rows. Execute the following procedure:
- Stop the SIMATIC BATCH service.
- Open SQL Server Management Studio and connect to the BATCH database engine.
- Open the optimization script supplied with the support article. The script is a single batch with three sections: identification, preservation of the canonical row, and removal of duplicates.
- Execute the identification section first. Review the result set. The query targets the data type table (commonly
BB_DataTypeor project-specific equivalent) grouped by ID. Duplicate IDs appear as groups with a row count greater than 1. - Execute the de-duplication section inside a
BEGIN TRANblock. The canonical row is selected as the row with the lowestIDvalue (or the most recentLastChangetimestamp, depending on the project-specific script). The script reassigns foreign-key references inBB_BatchandBB_Formulato the canonical row, then deletes the duplicates. - Run the verification query (also part of the script) to confirm no duplicate IDs remain. Expected result: zero rows.
- Commit the transaction:
COMMIT TRAN.
The canonical SQL pattern (illustrative — use the script shipped with the support article, not this excerpt):
-- Identification: locate duplicate data type IDs
SELECT ID, COUNT(*) AS DupCount
FROM dbo.BB_DataType
GROUP BY ID
HAVING COUNT(*) > 1;
-- De-duplication (execute inside a transaction)
BEGIN TRAN;
-- Preserve the canonical row, reassign references, remove duplicates
UPDATE b
SET b.DataTypeID = canon.ID
FROM dbo.BB_Batch AS b
JOIN dbo.BB_DataType AS dup ON dup.ID = b.DataTypeID
JOIN dbo.BB_DataType AS canon ON canon.DataTypeName = dup.DataTypeName
AND canon.ID = (SELECT MIN(ID)
FROM dbo.BB_DataType
WHERE DataTypeName = dup.DataTypeName);
DELETE dup
FROM dbo.BB_DataType AS dup
JOIN dbo.BB_DataType AS canon ON canon.DataTypeName = dup.DataTypeName
AND canon.ID < dup.ID;
-- Verification: should return zero rows
SELECT ID, COUNT(*) AS DupCount
FROM dbo.BB_DataType
GROUP BY ID
HAVING COUNT(*) > 1;
COMMIT TRAN;
5.5 Step 4 — Clear the Stuck Archive Status Flag
After the database optimization, batches that were marked "could not be archived" still carry the error flag in the database. The status is cleared by the BATCH server on the next archive cycle once the underlying data is clean. To force the clearance for the previously affected batches:
- Start the SIMATIC BATCH service.
- Open the Batch Control Center and locate the affected batch rows.
- Right-click each affected batch and select Archive from the context menu. The server re-evaluates the batch with the cleaned master data and transitions the status from error to archived.
- Confirm the padlock icon is removed and the row status reads "Archived".
For sites with many affected batches, the equivalent action can be triggered by running the auto-archive job (default 24 h schedule) without manual interaction. Verify the new archive files overwrite or supersede the prior XML/PDF pair consistently with the project's archive retention policy.
6. Verification
Execute the following checks after the resolution. A clean result on each confirms the fault is closed.
| Check | Procedure | Pass Criteria |
|---|---|---|
| Database integrity | Run the duplicate-ID query from the Siemens script | Zero rows returned |
| Service startup | Restart BATCH server, watch Windows event log | No archive-related errors within 60 min |
| Auto-archive cycle | Close a test batch, wait one full cycle | Batch transitions to "Archived" with no "could not be archived" event |
| Historical batches | Re-archive the three originally affected batches from Control Center | Status clears, padlock removed, single XML/PDF pair in archive |
| Process cell update | Perform a controlled master data update on a test process cell | No duplicate-ID warnings in the update log |
| Long-term monitoring | Run the plant for 7 days under normal production | Zero "Batch could not be archived" events in the BATCH log |
7. Preventive Measures
- Patch cadence: Track Siemens SIMATIC BATCH updates quarterly. The V9.0 SP1 Upd3 release is the current correction level at the time of writing; later hotfixes and V9.1 service packs incorporate the fix.
- Process cell update discipline: Use the engineering tool's built-in "Update Process Cell" workflow exclusively. Avoid direct SQL edits to the BATCH database outside of scripts issued by Siemens support.
- Pre-update database check: Add the duplicate-ID identification query to the change management procedure. Run it before every BATCH update and reject the change if duplicates are detected.
- Restart hygiene: The defect surfaces more readily when the BATCH server is restarted while batches are mid-archive. Schedule server restarts during production gaps, not while the archive job is running.
- Archive directory review: Periodically confirm the archive directory contains the expected XML/PDF pair count. A discrepancy between database row count and archive file count is an early warning of an archive fault.
8. Troubleshooting Matrix
| Symptom | Likely Cause | Action |
|---|---|---|
| Single batch fails, archive files present, padlock shown | Duplicate data type ID for that batch's data type | Run database optimization script from support entry 109962043 |
| Multiple batches fail after a process cell update | Bulk import of master data introduced duplicates | Roll back the process cell import, clean staging schema, re-import via the engineering tool |
| All batches fail to archive | SQL Server connectivity loss, archive share unavailable, or disk full | Verify network path, disk space, and SQL Server service; consult BATCH log for the underlying error code |
| Archive files present, no padlock, no error message | Healthy — no action | None |
| Padlock present, archive files missing | Archive directory failure (permissions, full disk, share offline) | Restore the archive directory from the snapshot taken in Section 5.2; resolve the underlying directory fault before retrying |
| Error persists after optimization and patch | Residual duplicate rows in a different master data table | Open a Siemens support request referencing entry 109962043 and attach the BATCH log |
9. Edge Cases and Field Notes
Multi-server BATCH topologies: In redundant or load-balanced BATCH server configurations, the archive retry loop is coordinated by the active server. After applying the optimization, confirm the standby server is also restarted so it picks up the cleaned database state — otherwise the next failover can reintroduce the error.
Audit trail integrity: The optimization script preserves the canonical row and only removes the duplicates. The audit trail (BB_Log) and the batch results (BB_BatchResult) are not modified. Plants under FDA 21 CFR Part 11 or GAMP 5 validation should record the script execution in the change control register and retain the pre- and post-execution SQL backups for the validation retention period.
Custom master data: Sites that have extended the BATCH data model with project-specific columns must verify the optimization script handles the custom schema. The script targets the standard tables; custom tables that reference the duplicated IDs are not auto-cascaded. A pre-execution review with the project's automation engineer is recommended.
Archive retention policy: The auto-archive function moves batch data from the operational tables to the archive tables in the BATCH database. The XML/PDF files on disk are the long-term artifacts. Sites that have configured archive compression or offload-to-archive should verify the offload path is reachable from the BATCH server before the maintenance window opens.
10. Related Siemens Support Resources
- SIMATIC BATCH: Message indicating archiving problems when updating a batch process cell — primary support entry with the optimization script.
- SIMATIC BATCH V9.0 SP1 update release notes — patch level Upd3 documentation.
- SIMATIC PCS 7 / SIMATIC BATCH Configuration manual — process cell update workflow.
- Siemens Industry Online Support portal — searchable index of BATCH-related entries by error message string.
What does the locked padlock icon in the SIMATIC BATCH Control Center mean?
The padlock icon indicates the batch row is in a non-editable state, typically because the batch is open, in process, or has an outstanding archive error. Combined with the "Batch could not be archived" message and present XML/PDF files, it points to the duplicate data type ID defect documented in Siemens support entry 109962043.
Do I need to install the SIMATIC BATCH V9.0 SP1 Upd3 patch to clear the error?
The patch is strongly recommended and addresses the symptom, but the historical duplicate rows in the BATCH database must also be cleaned with the supplied optimization script. Applying the patch without the optimization leaves the root cause in place and the error will resurface after the next process cell update.
Will the optimization script delete the XML and PDF archive files on disk?
No. The script operates exclusively on the SQL Server BATCH database. The on-disk XML master data and PDF batch report files are untouched. The archive directory should be backed up separately as part of the procedure to allow rollback if a foreign-key cascade behaves unexpectedly.
How long does the full resolution procedure take?
For a typical single-server installation: 30 min for snapshot and service stop, 60–90 min for the patch install and reboot, 15–30 min for the database optimization (depends on BATCH database size), and 24 h to confirm the next auto-archive cycle completes without error. Plan a 4-hour maintenance window plus the 24-hour monitoring period.
Can the optimization script be run while the BATCH server is online?
No. Stop the SIMATIC BATCH service and any active Batch Control Center clients before executing the script. Running the script against an active database will produce lock conflicts and leave the transaction in an indeterminate state. The script is designed for an offline maintenance window.