2.5.3.2 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:

2.5.3.2.1 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 applyupdate command.
  • You must apply metadata and framework updates to all cluster nodes.

Syntax

ahfctl applyupdate [-h] [-debug] [-updatefile UPDATEFILE]

Parameters

Table 2-5 ahfctl applyupdate Command Parameters

Parameter Description

-debug

Specify the -debug option to enable debugging.

-updatefile UPDATEFILE

Specify the name of the zip file. The existing metadata and framework files will be replaced with the files in the zip file.

Download the zip file from My Oracle Support note 2550798.1.

Example 2-23 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

2.5.3.2.2 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

Table 2-6 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 -updateid UPDATEID option to query framework updates.

Note:

To query metadata updates, please use the -all option.

-all

Lists all applied metadata and framework updates.
-json

Specify this option to get the output in JSON format.

Example 2-24 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 updateid 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

2.5.3.2.3 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

Table 2-7 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 2-25 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

2.5.3.2.4 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 deleteupdatebackup command 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_setup script 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

Table 2-8 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.

Example 2-26 ahfctl deletebackup

# ahfctl deleteupdatebackup -updateid 20220130
Deleted metadata backup directory for: /opt/oracle.ahf/data/work/.exachk_patch_directory/.20220130_metadata_bkp