Managing Database Growth and Sizing for the SIMATIC BATCH sbdata Directory

Managing Database Growth and Sizing for the SIMATIC BATCH sbdata Directory

Following an upgrade from PCS 7 V7.0 to V9.0 SP1, the threefold expansion of the SIMATIC BATCH online database directory sbdata (e.g., from 4 GB to 12 GB under identical batch retention settings) is caused by the architectural transition to 64-bit Microsoft SQL Server 2014 SP2, enhanced Unicode metadata storage, and granular electronic audit trail logging (FDA 21 CFR Part 11) introduced in modern BATCH releases. To control and reduce sbdata disk consumption without prematurely deleting completed batches, configure automated batch archiving to Process Historian or external storage, execute scheduled SQL Server transaction log truncation on sbdata_log.ldf, and deselect continuous trend logging on non-critical recipe steps.

Table of Contents

SIMATIC BATCH Database Architecture: V7.0 vs V9.0 SP1

In SIMATIC PCS 7, SIMATIC BATCH coordinates multi-unit batch production processes. The real-time operational database resides in the sbdata directory (typically <Drive>:\Program Files (x86)\Siemens\BATCH\sbdata\), hosting Microsoft SQL Server database files: sbdata.mdf (Primary Data), sbdata_log.ldf (Transaction Log), and shared recipe execution caches.

When upgrading from PCS 7 V7.0 (which utilized 32-bit SQL Server 2005) to PCS 7 V9.0 SP1 (which runs 64-bit SQL Server 2014 SP2), plant engineers frequently observe that the physical disk consumption of sbdata expands by 200% to 300% under identical batch production rates and batch retention intervals (e.g., holding 15 days of closed batches online).

Root Causes of sbdata Online Directory Expansion

Detailed technical analysis reveals four primary factors driving this database expansion in V9.0 SP1:

  1. Enhanced Audit Trail and Electronic Signatures (21 CFR Part 11): Modern SIMATIC BATCH incorporates rigorous regulatory compliance logging. Every step state transition, operator input, setpoint verification, and electronic signature generates cryptographic checksums and extended metadata records that did not exist in V7.0.

  2. 64-Bit SQL Server Storage and Unicode Structures: SQL Server 2014 SP2 utilizes larger fixed page allocations (8 KB data pages with 64 KB extents) and stores technological strings in dual-byte Unicode (NVARCHAR), doubling string storage requirements compared to legacy ASCII formats.

  3. High-Frequency Continuous Process Tag Logging: In modern APL recipe integration, continuous trend variables associated with recipe phases are logged at higher precision and frequency into sbdata before archiving.

  4. Un-truncated SQL Transaction Log (sbdata_log.ldf): Under standard SQL Full Recovery models, the transaction log file expands continuously with every batch transaction. Without regular log truncations and backups, sbdata_log.ldf often expands to occupy 50% to 70% of the total directory volume.

SIMATIC BATCH Database Components and Storage Allocation Matrix

The following table details the key database files in sbdata and their typical storage footprint:

Database File / ComponentPrimary FunctionTypical Size in V7.0Typical Size in V9.0 SP1Optimization Strategysbdata.mdfActive Recipes, Units, Batch Logs2.5 GB6.0 to 8.0 GBArchive closed batches to Process Historiansbdata_log.ldfSQL Transaction Journal1.0 GB4.0 to 6.0 GBSwitch to Simple Recovery or execute log backupssbarchive\Local Archived Batch XML/PDFsVariableVariableMove detached archive folders to external NASsbshared\Shared Network Replication Cache< 500 MB~ 1.0 GBAuto-cleared by BATCH Control Center

Database Maintenance and Size Optimization Procedures

To optimize and stabilize the disk footprint of sbdata without prematurely deleting batches:

  1. Implement Automated Process Historian Archiving:
    - In BATCH Control Center (BCC), open System Settings -> Archiving.
    - Enable automated archiving to SIMATIC Process Historian (PH).
    - Configure BCC to automatically archive batches immediately upon reaching status 'Closed'.
    - Configure the retention rule to detach and delete archived batches from sbdata after 3 to 5 days, while Process Historian retains them online for years.

  2. Truncate and Shrink the SQL Transaction Log:
    - Open SQL Server Management Studio (SSMS) connecting to the WINCC or BATCH instance.
    - Right-click the sbdata database -> Properties -> Options.
    - Set the Recovery Model to Simple (unless continuous point-in-time database replication is required).
    - Right-click sbdata -> Tasks -> Shrink -> Files.
    - Select File type: Log, and click OK to reclaim unused transaction log space.

  3. Refine Recipe Continuous Tag Logging:
    - In the BATCH Recipe Editor, open master recipes.
    - Review phase properties: uncheck 'Continuous process tag recording' on non-critical technological phases.
    - Restrict continuous trend logging strictly to critical process parameters (temperatures, pressures, weights).

Verification

Verify database optimization:
1. Check Windows Explorer properties of the sbdata directory; confirm total file size has reduced significantly.
2. In BATCH Control Center, open a closed batch that was transferred to Process Historian; verify that all recipe events, parameter curves, and message logs open seamlessly from the archive.
3. Execute a new batch run; confirm that batch initialization and step transitions proceed without SQL timeout errors.
4. Verify in Windows Event Viewer that SQL Server reports successful checkpoint and log truncation operations.

Limitations and Operational Precautions

  • Never Manually Delete MDF/LDF Files: Manually deleting or moving .mdf or .ldf files corrupts the SQL Server instance, destroying active batch data and requiring a complete BATCH database re-initialization.
  • Database Shrink Frequency: Do not run automated SQL database shrinking in a high-frequency loop; shrinking fragments database indexes. Execute shrinking as a monthly maintenance procedure.
  • Active Batch Protection: Never execute maintenance routines while complex, high-risk production batches are actively running; perform maintenance during changeovers.

Engineer FAQ

Can I move the sbdata directory to another hard drive with more space?

Yes. In the BATCH Launch Coordinator and BATCH Advanced Settings, the path to the BATCH database can be relocated to a high-capacity drive (e.g., dedicated SSD array).

Why did sbdata grow even though PDF report generation was disabled?

PDF reports are stored separately in the file system. The growth in sbdata is inside the SQL tables, driven by 64-bit Unicode data structures and detailed 21 CFR Part 11 audit records.

What happens if sbdata runs out of hard drive space?

SIMATIC BATCH will halt all executing batches, block new batch launches, and trigger critical server alarms to prevent data corruption.

Does Process Historian automatically back up SIMATIC BATCH data?

Yes. If the Process Historian archive option is enabled in BATCH Control Center, closed batches are automatically transferred and stored long-term in the PH SQL database.

Technical References

Related Articles

Related Tags

  • SIMATIC BATCH
  • sbdata
  • SQL Server
  • Database Sizing
  • Process Historian
6 respuestas