Running AHFCTL Update Commands to Apply AHF Metadata and Framework Updates
You need AHF install user privileges to run these commands.
Note:
To configure AHF auto-update refer to:
ahfctl updateahfctl setupdateahfctl getupdateahfctl unsetupdate
ahfctl applyupdate
Use the ahfctl applyupdate command to update metadata and framework files on the local node from the zip file provided.
Note:
- You need AHF install user privileges to run the
ahfctl applyupdatecommand. - You must apply metadata and framework updates to all cluster nodes.
Syntax
ahfctl applyupdate [-h] [-debug] [-updatefile UPDATEFILE]
Parameters
ahfctl applyupdate Command Parameters
| Parameter | Description |
|---|---|
-debug | Specify the -debug option to enable debugging. |
-updatefile UPDATEFILE | Specify the name of the Download the |
Example ahfctl applyupdate
# ahfctl applyupdate -updatefile /tmp/ahf_data_20220203.zip
Updated file /opt/oracle.ahf/exachk/.cgrep/collections.dat
Updated file /opt/oracle.ahf/exachk/rules.dat
Updated file /opt/oracle.ahf/exachk/.cgrep/versions.dat
Updated file /opt/oracle.ahf/exachk/messages/check_messages.json
Data files updated to 20220203 from 20211220
For more information, see https://support.oracle.com/epmos/faces/DocContentDisplay?id=2550798.1.
ahfctl queryupdate
Use the ahfctl queryupdate command to check if an update was applied. To get a list of all the metadata and framework updates applied, use the -all option. To query a metadata or framework update with a specific update ID, use the -updateid option.
Note:
To verify if the metadata and framework updates were applied to all nodes in a cluster, run the ahfctl queryupdate command as the AHF install user on each cluster node.
Syntax
ahfctl queryupdate [-h] [-debug] [-updateid UPDATEID] [-all] [-json]
Parameters
ahfctl queryupdate Command Parameters
| Parameter | Description |
|---|---|
-debug | Specify the -debug option to enable debugging. |
-updateid UPDATEID | To query framework update with a specific update ID. Specify
|
-all | Lists all applied metadata and framework updates. |
-json | Specify this option to get the output in JSON format. |
Example ahfctl queryupdate
# ahfctl queryupdate -all
AHF Metadata Update: 20220203
Status: Applied
Applied on: Fri Feb 4 00:47:00 2022
# ahfctl queryupdate -all
AHF Framework update: PATCH_22.2.4.1
Status: Applied
Fixes: 34716496
Applied on: Wed Nov 30 15:14:56 2022
34716496 is the update ID for AHF framework update applied.
ahfctl queryupdate -updateid 34716496
AHF Framework update: PATCH_22.2.4.1
Status: Applied
Fixes: 34716496
Applied on: Wed Nov 30 15:14:56 2022
1:53
AHF framework updated files:
/opt/oracle.ahf/ahf/lib/ahfcomponents.py
/opt/oracle.ahf/ahf/lib/ahfctl.py
/opt/oracle.ahf/exachk/messages/framework_messages.json
/opt/oracle.ahf/exachk/lib/ahf_metadata.py
ahfctl rollbackupdate
Use the ahfctl rollbackupdate command to rollback the updates with a specific update ID applied to the local node. If you do not specify the update ID, then AHF rolls back to the previous state by default.
Note:
To rollback the metadata and framework updates applied to all nodes in a cluster, you must run the ahfctl rollbackupdate command as the AHF install user on each cluster node.
Syntax
ahfctl rollbackupdate [-h] [-debug] [-updateid UPDATEID]
Parameters
ahfctl rollbackupdate Command Parameters
| Parameter | Description |
|---|---|
-debug | Specify the -debug option to enable debugging. |
-updateid UPDATEID | Specify update ID, for example, Bug ID, Build ID, that you want to rollback. |
Example ahfctl rollbackupdate
# ahfctl rollbackupdate -updateid 20220203
Data files with timestamp 20220203 identified. Rolling back the files to Production version 20211220
Rolled back the data files 20220203 to Production version 20211220
ahfctl deleteupdatebackup
Use the ahfctl deleteupdatebackup command to delete the backup directories used for AHF update.
Note:
- To delete the backup directories on all nodes in a cluster, you must run the
ahfctl deleteupdatebackupcommand as the AHF install user on each cluster node. - You must not delete the backup directories randomly. Oracle recommends deleting the backup directories in the same order the updates were applied. If you delete the backup directories associated with a specific timestamp, then you will not be able to roll back to the state before the updates with that specific timestamp were applied.
- Upgrading AHF using the
ahf_setupscript automatically deletes the backup directories of the previous AHF versions. - Oracle recommended to delete the AHF update backup directories only when there's a need to free up space on the system. You cannot delete the AHF update backup directory of the current running timestamp/update because once the backup directory is deleted for the specific timestamp, rolling back the update to specific timestamp/update is not possible.
For example: AHF Updates applied in order is: 20230901 -> 20231001 -> 20231101 (Current latest update). You can delete update backups for 20230901 and 20231001 but not the 20231101.
Syntax
ahfctl deleteupdatebackup [-h] [-debug] [-updateid UPDATEID] [-silent]
Parameters
ahfctl deleteupdatebackup Command Parameters
| Parameter | Description |
|---|---|
-debug | Specify the -debug option to enable debugging. |
-updateid UPDATEID | Deletes the backup directories with the specified timestamp. |
-silent | Skips user confirmation for delete backup directories. |
ahfctl deletebackup
# ahfctl deleteupdatebackup -updateid 20220130
Deleted metadata backup directory for: /opt/oracle.ahf/data/work/.exachk_patch_directory/.20220130_metadata_bkp
Update Java Without Updating AHF
With this enhancement, you can update JRE without updating AHF.
Check the Autonomous Health Framework, Oracle Trace File Analyzer, Oracle Orachk, and Java versions.
For example:
# ahfctl version -all AHF version: 24.7.0 TFA version: 24.7.0 ORACHK VERSION: 24.7.0_20240714 JAVA VERSION: 11.0.22Apply Java update.
ahfctl applyupdate -updatefileWhere
updatefilespecifies the Java update file generated.For example:
# ahfctl applyupdate -updatefile ahf_36840033_java_JDK11_MAIN_LINUX.X64_240318.11.0.23.B7.zip This is a Java patch. Requires Java version comparison before proceeding. Java patch validation passed. Stopping TFA before applying JAVA Patch. Updated file /opt/oracle.ahf/jre Java patch applied successfully. Starting TFA post JAVA patch completion.Post update, check the Java version.
For example:
$ /opt/oracle.ahf/jre/bin/java --version java 11.0.23 2024-04-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.23+7-LTS-222)Post update, check the AHF, TFA, Oracle Orachk, and Java versions.
For example:
# ahfctl version -all AHF version: 24.7.0 TFA version: 24.7.0 ORACHK VERSION: 24.7.0_20240714 JAVA VERSION: 11.0.23
To rollback to previous Java version, run the
ahfctl rollbackupdate -updateidcommand.For example:
$ /opt/oracle.ahf/jre/bin/java --version java 11.0.23 2024-04-16 LTS# ahfctl rollbackupdate -updateid JDK11_MAIN_LINUX.X64_240318.11.0.23.B7 Java rollback started. Rollback files includes JRE directory. TFA needs to stop first. ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== ===== Stopping TFA before rolling back to original. Rolled-back file /opt/oracle.ahf Starting TFA post rollback completion. Java rollback completed.$ /opt/oracle.ahf/jre/bin/java -version java version "11.0.21" 2023-10-17 LTSTo query when Java was patched, run the
ahfctl queryupdate -allcommand.For example:
# ahfctl queryupdate -all Java Update Label: JDK11_MAIN_LINUX.X64_240318.11.0.23.B7 Status: Applied Applied on: Wed Jul 24 19:36:24 2024To query when the Java update was rolled back, run the
ahfctl queryupdate -allcommand.For example:
# ahfctl queryupdate -all No AHF framework updates applied TFA version: 24.7.0 ORACHK VERSION: 24.7.0_20240714 AHF version: 24.7.0 JAVA VERSION: 11.0.22
Update AHF Configuration Files
With AHF 26.1, the Autonomous Health Framework (AHF) update feature is enhanced to support managing AHF configuration files across multiple base versions.
# ahfctl applyupdate -updatefile ahfConfig_26.1.0.1_251116.zip
WARNING: DeprecatedCommand: `applyupdate` command is deprecated and will be removed in a future release, no sooner than 2028-11-01. Refer to `ahf software apply-update -h` for the new command to perform this operation.
Updated file /opt/oracle.ahf/tfa/resources/searchStrings.xml
Updated file /opt/oracle.ahf/tfa/resources/file_monitor_config.json
AHF metadata updating of file ahfConfig_26.1.0.1_251116.zip completed
Updated to 26.1.0.1 from 26.1.0
AHF framework update fixes 38457409
.--------------------------------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID | Inventory Status |
+-----------------+---------------+-------+------+------------+-----------------------+------------------+
| stbm000004-vm19 | RUNNING | 21662 | 5000 | 26.1.0.0.0 | 251001020251119112103 | COMPLETE |
'-----------------+---------------+-------+------+------------+-----------------------+------------------'
# ahfctl queryupdate -updateid 26.1.0.1.0_251116
WARNING: DeprecatedCommand: `queryupdate` command is deprecated and will be removed in a future release, no sooner than 2028-11-01. Refer to `ahf software get-update-history -h` for the new command to perform this operation.
{
"isPatchCompatible": true,
"patchApplied": true,
"additionalDetails": {
"installedTFA": "26.1.0",
"ahfConfigversion": "26.1.0.1",
"status": "Success",
"timestamp": "Wed Nov 19 11:40:51 2025",
"errorDetails": ""
}
}
# ahfctl rollbackupdate -updateid 26.1.0.1.0_251116
WARNING: DeprecatedCommand: `rollbackupdate` command is deprecated and will be removed in a future release, no sooner than 2028-11-01. Refer to `ahf software rollback-update -h` for the new command to perform this operation.
Rolled-back file /opt/oracle.ahf/tfa/resources/searchStrings.xml
Rolled-back file /opt/oracle.ahf/tfa/resources/file_monitor_config.json
Rolled-back to 26.1.0 from 26.1.0.1
Rolled-back fixes for 38457409
.--------------------------------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID | Inventory Status |
+-----------------+---------------+-------+------+------------+-----------------------+------------------+
| stbm000004-vm19 | RUNNING | 21662 | 5000 | 26.1.0.0.0 | 251000020251119094021 | COMPLETE |
'-----------------+---------------+-------+------+------------+-----------------------+------------------'