During startup of the database, either after a crash or a controlled shutdown, the database uses the before-image (BI) files to reconcile any in process transactions in the BI file to the database files. Even though the space in BI files is reused, the BI file can potentially grow to take up a lot of disk space or a lot of expensive cloud storage.

OpenEdge allows you to truncate BI files offline, on a source database, and on a replication target database. Truncating the BI file on the replication target allows the DBA to:

  • Reduce storage space usage by truncating the BI space on a replication target as it has grown to a huge size.

  • Adjust the BI cluster or block size on a replication target to improve database performance.

  • Reduce potential errors in replication by making the BI cluster size the same on both target and source databases.

Truncate the BI file

Follow these steps to truncate the before-image file.
  1. To ensure that there are no live transactions and that source and target databases are synchronized, enter a proshut -replSync command.
    For example, this command synchronizes source and target and shuts down the source database sourcedb:
    proshut sourcedb -replSync

    For more information, see PROSHUT command

  2. Run the utility proutil db -C describe to see if the BI truncation is allowed on the target. For syntax, see PROUTIL DESCRIBE qualifier. If truncation is allowed, the output appears as follows:

    proutil Target/target -C describe

    OpenEdge Release 12.5 as of Tue Sep 14 07:48:40 EDT 2021
    
    
    OpenEdge Database Description
    
    Database Name               : /largedisk/REPLSETUP_1TARG/Target/target
    Version                     : 184.0
    Block Size                  : 4096
    Largest Cluster             : 64
    Create Date                 : Tue Sep 14 17:41:26 2021
    Last Open Date              : Tue Sep 14 17:43:58 2021
    Prior Open Date             : Tue Sep 14 17:43:58 2021
    Schema Change Date          : Tue Sep 14 17:41:26 2021
    
    Before Imaging Information
      Block Size                : 16384
      Cluster Size (16K Units)  : 32
      Last Open Date            : Tue Sep 14 17:41:39 2021
      BI Truncation on Target   : Allowed
    
    After Imaging Information
      Block Size                : 16384
      Begin Date                : Tue Sep 14 17:41:39 2021
      Last AIMAGE NEW           : Tue Sep 14 17:42:33 2021
      Currently Busy Area       : 13
      Current File Number       : 2
    
    Backup Information
      Last Full Backup Date     : Tue Sep 14 17:41:30 2021
      Last Incremental Backup   : Tue Sep 14 17:41:31 2021
    
    Database Features
    
       ID   Feature                            Active  Details
      ----  ---------------------------------  ------  -------
         1  OpenEdge Replication               Yes     Target database
         5  Large Files                        Yes
         8  After Image Management/Archiver    Yes
         9  64 Bit DBKEYS                      Yes
        10  Large Keys                         Yes
        11  64 Bit Sequences                   Yes
    

    If truncation is not allowed, the field BI Truncation on Target contains Not Allowed.

  3. To truncate the BI file, enter the command proutil targetdb -C truncate bi. For details, see PROUTIL TRUNCATE BI qualifier.
    For example:
    proutil Target/target -C truncate bi

    If truncation fails, PROUTIL returns an error.

  4. You can verify truncation by examining the database .lg file. Look for the following message:
    DBUTIL   : (123)   .bi file truncated.