Changing the AI block size:
- As with before-imaging, the database engine reads and writes transaction notes to the AI file in blocks.
- Increasing the size of AI blocks lets the engine read and write more AI data with each I/O operation, which can reduce I/O rates on disks where the AI files are located, when the BI blocksize is at least equal to the AI blocksize.
- When changing the AI block size, ensure the BI blocksize is the same size.
- In general, the default AI block size (8K) is sufficient for systems with low transaction rates.
- When performance monitoring indicates that AI writes are a performance bottleneck and the platform’s I/O subsystem can take advantage of larger writes, increasing the AI block size may improve performance.
- A larger AI block size can also improve performance for roll-forward recovery processing.
- Changing the AI blocksize requires After-Imaging to be disabled.
Considerations when Disabling AI online or offline:
1. Disabling after-imaging disables AI Management and Replication if either is active as these features are dependent on the database being ai enabled.
2. Disabling AI
online with AIMAGE OFF cannot be performed if the database is an OpenEdge Replication source database and the replication server is running. Once AI is re-enabled, the replication target database will need to be re-baselined. See:
"Changing the after-image block size online" section below.
3. Disabling after-imaging disables
AI encryption, unless the database is a Replication target database.
Changing the after-image block size offline:
Prior to
OpenEdge 10.1B, while after-Imaging can be disabled online or offline, it can only be enabled
offline:
Once After-imaging is disabled offline, the AI blocksize can be changed, then re-enable After-Imaging (and site-specific dependencies).
1. Use PROMON > 8. Shutdown a Database Option to shut down the database or use the PROSHUT command:
$ proshut -by dbname
2. If after-imaging is enabled, first disable dependencies then disable after-imaging:
$ echo y | proutil dbname -C disablesitereplication source
$ rm dbname.repl.recovery
$ rfutil dbname -C aiarchiver disable
$ rfutil dbname -C aimage end
3. Truncate the BI file to bring the database and BI files up to date and eliminate any need for database bi recovery.
At the same time
change the BI block size (-biblocksize) to match that of the new AI block size and optionally change the biclustersize (-bi).
$ proutil dbname -C truncate bi -biblocksize 16 -bi 16834
( -biblocksize and -bi are in Kilo Bytes )
4. Increase the AI blocksize (
-aiblocksize) to the samesize as the biblocksize:
$ rfutil dbname -C aimage truncate -aiblocksize 16
( Optionally more AI files can be added offline to the database structure with PROSTRCT ADD )
When the aiblocksize is not the same size as the before-image blocksize:
- This can yield unexpected consequences should after-imaging need to be disabled then re-enabled online at sometime in the future.
- This means that if the aiblocksize = 16 and the biblocksize = 8, the aiblocksize will be re-set to 8KB when enabling AI online (probkup online enableai) automatically sets ai block size to be the same as bi block size for performance reasons. See: "Changing the after-image block size online" section below.
5. Enable after-imaging:
$ rfutil dbname -C mark backedup
$ rfutil dbname -C aimage begin
( Enabling After-Imaging (AI) offline does not set the aiblocksize equal to the current biblocksize )
Enable dependencies as required:
$ rfutil dbname -C aiarchiver enable
$ proutil dbname -C enablesitereplication source
A new full PROBKUP needs to be taken either offline or at the earliest convenience after the database is started multi-user:
- AI files created before the change to the AI block size are no longer valid with the new AI block size for roll forward operations.
- AI files generated from this point on can only be rolled forward against a copy of the database with the same aiblocksize stored in the masterblock
- The consequences are outlined in Article:
6. Restart the database.
7. Using the new backup, re-baseline the hotspare roll forward database or replication target databases.
Changing the after-image block size online:
Since
OpenEdge 10.1B, After-Imaging can be enabled online.
While the
AI Blocksize cannot specifically be changed online, the AI block size will automatically be set to the same size as the current bi blocksize when after-imaging is enabled online:
$ probkup online dbname dbname.bak enableai
1. Before enabling AI online, ensure the
biblocksize is the size required for the
aiblocksize.
Otherwise, c
hanging the bi blocksize is an offline operation and changing the AI blocksize requires After-Imaging to be disabled. Once the database is re-started, after-imaging can then be enabled online or since the database has to be taken offline anyway, follow the
offline procedure outlined above.
2. Prior to OpenEdge 11.7.5, 12.0, if AIMGT is enabled, please review the additional considerations before disabling AI with AIOFF, all "FULL" ai files must be archived beforehand:
Scripting AI Blocksize changes online
The following pseudo script outlines changing the AI Blocksize online where AIMGT and OER are also enabled.
While disabling AI should disable all related features (OER, AIMGT) - the instructions provided in the following pseudo script assure the operation will succeed by specifically disabling these before disabling after-imaging.
:: If (OER) Replication is enabled:
$ dsrutil <dbname> -C terminate server
$ dsrutil <dbname> -C RELWAITS
$ dsrutil <dbname> -C disablesitereplication source
$ rm dbname.repl.recovery
:: If (AIMGT) AI Management is enabled:
$ rfutil <dbname> -C aiarchiver end
$ rfutil <dbname> -C aimage list | egrep -i "Status|Path"
$ rfutil dbname -C aiarchive nextextent
$ rfutil <dbname> -C aiarchiver disable
:: Disable After-Imaging online
$ rfutil <dbname> -C aimage aioff
:: Re-enable After-Imaging and AIMGT
:: Optionally use the NUL or /dev/null bit bucket, a 'real' backup must be created afterwards
$ probkup online <dbname> NUL enableai enableaiarchiver -aiarcdir [fullpathtoAIMGTarchives]
:: Re-enable Replication (OER)
$ proutil <dbname> -C enableSiteReplication source
:: Take a new full backup baseline for OER target creation or hotspare databases
$ probkup online <dbname> <device-name> -REPLTargetCreation -Bp 16 -verbose