Patching Oracle Autonomous Health Framework
Learn to patch Oracle Autonomous Health Framework automatically or on demand.
Running AHFCTL Update Commands to Automatically Patch Oracle Autonomous Health Framework
Use AHFCTL update commands to configure and manage automatic patching of Oracle Autonomous Health Framework (AHF).
You must have AHF installation user privileges to run the following commands:
ahfctl updateahfctl setupdateahfctl getupdateahfctl unsetupdate
These commands allow the AHF installation user to initiate an update and configure, view, or remove the automatic update settings.
ahfctl update
Use the ahfctl update command to automatically apply Oracle Autonomous Health Framework (AHF) metadata updates.
Note:
You must have AHF installation user privileges to run the ahfctl update command.
Caution:
Test the downloaded metadata on a pre-production system before copying the metadata update file to a production-mounted file system.
Oracle recommends the following workflow:
- Configure automatic metadata download on a staging server.
- Test the downloaded metadata on a pre-production system.
- Configure automatic updates on all production systems.
- Copy the tested metadata ZIP file to the production-mounted file systems to automatically apply the update.
Syntax
ahfctl update [-h] [-nomos] [-debug]
Parameters
| Parameter | Description |
|---|---|
-h | Displays help for the command. |
-nomos | Prevents the command from configuring or using My Oracle Support (MOS). |
-debug | Enables debugging. |
Applying an Update from the Software Stage
When a newer AHF metadata update is available at the configured software stage location, run:
ahfctl update
Example output:
Updated file /opt/oracle.ahf/exachk/.cgrep/versions.dat
Updated file /opt/oracle.ahf/exachk/rules.dat
Updated file /opt/oracle.ahf/exachk/.cgrep/collections.dat
Updated file /opt/oracle.ahf/exachk/messages/check_messages.json
Data files updated to 20220607 from 20220516
Please copy ahf_data_20220607.zip and run the command
'ahfctl applyupdate -updatefile ahf_data_20220607.zip'
on the below mentioned nodes
scao05adm08
The output identifies the metadata files that were updated and displays the previous and current metadata versions.
If the update must also be applied to another node, copy the metadata ZIP file to that node and run:
ahfctl applyupdate -updatefile <update_file>
For example:
ahfctl applyupdate -updatefile ahf_data_20220607.zip
Applying an Update from a REST Endpoint
If a metadata update is not available at the configured software stage location and a REST endpoint is configured, AHF can retrieve the update from that endpoint.
Run:
ahfctl update
Example output:
Applying AHF metadata update...
AHF update zip is not available at stage location /opt/rajeev
Upload configuration check for: ahf_update_loc.
Parameters are configured correctly to upload.
ahf_data_20220607.zip successfully downloaded at /opt/rajeev
Updated file /opt/oracle.ahf/exachk/.cgrep/versions.dat
Updated file /opt/oracle.ahf/exachk/rules.dat
Updated file /opt/oracle.ahf/exachk/.cgrep/collections.dat
Updated file /opt/oracle.ahf/exachk/messages/check_messages.json
Data files updated to 20220607 from 20220601
Please copy ahf_data_20220607.zip and run the command
'ahfctl applyupdate -updatefile ahf_data_20220607.zip'
on the below mentioned nodes
scao05adm08
AHF downloads the metadata update ZIP from the configured REST endpoint, applies the updated metadata files locally, and identifies any additional nodes on which the update must be applied.
ahfctl setupdate
Use the ahfctl setupdate command to configure Oracle Autonomous Health Framework (AHF) automatic update parameters.
Note:
You must have AHF installation user privileges to run the ahfctl setupdate command.
Syntax
ahfctl setupdate
[-h]
[-all]
[-swstage <SWSTAGE>]
[-autoupdate <AUTOUPDATE>]
[-servicename <SERVICENAME>]
[-fstype <FSTYPE>]
[-frequency <FREQUENCY>]
[-debug]
Parameters
| Parameter | Description |
|---|---|
-h | Displays help for the command. |
-all | Configures all update parameters interactively. |
-swstage <SWSTAGE> | Specifies the software stage location. For example, /opt/oracle.ahf. |
-autoupdate <AUTOUPDATE> | Enables or disables automatic updates. Valid values are on and off. The default is on. |
-servicename <SERVICENAME> | Specifies the name of the REST download service. The default is ahf_update_loc. |
-fstype <FSTYPE> | Specifies the file system type of the software stage location. For example, nfs, acfs, or local. |
-frequency <FREQUENCY> | Specifies the automatic update frequency in days. Valid values are from 1 through 30. For example, specify 15 to configure a 15-day frequency. |
-debug | Enables debugging. |
Setting Update Parameters
To configure the software stage location and enable automatic updates:
ahfctl setupdate -swstage /opt/oracle.ahf -autoupdate on
Setting All Update Parameters
Use the -all option to configure all applicable update parameters interactively:
ahfctl setupdate -all
Example:
Enter autoupdate flag <on/off> : on
Enter software stage location : /scratch/ahf_stage
Enter auto update frequency : 30
AHF autoupdate parameters successfully updated
Successfully synced AHF configuration
Disabling Automatic Updates
To disable AHF automatic updates:
ahfctl setupdate -autoupdate off
Example output:
AHF autoupdate parameters successfully updated
Successfully synced AHF configuration
ahfctl getupdate
Use the ahfctl getupdate command to view Oracle Autonomous Health Framework (AHF) automatic update configuration parameters.
Note:
You must have AHF installation user privileges to run the ahfctl getupdate command.
Syntax
ahfctl getupdate [-h] [-all] [-debug]
Parameters
| Parameter | Description |
|---|---|
-h | Displays help for the command. |
-all | Displays all configured update parameters. |
-debug | Enables debugging. |
Viewing All Update Parameters
Use the -all option to display all AHF automatic update configuration parameters:
ahfctl getupdate -all
Example output:
autoupdate : on
autoupdate.swstage : /opt/oracle.ahf
autoupdate.frequency : 30
autoupdate.servicename : [not set]
autoupdate.fstype : [not set]
The output shows whether automatic updates are enabled and displays the configured software stage location, update frequency, REST service name, and file system type.
ahfctl unsetupdate
Use the ahfctl unsetupdate command to remove Oracle Autonomous Health Framework (AHF) automatic update configuration parameters.
Note:
You must have AHF installation user privileges to run the ahfctl unsetupdate command.
Syntax
ahfctl unsetupdate
[-h]
[-all]
[-swstage]
[-autoupdate]
[-servicename]
[-fstype]
[-frequency]
[-debug]
Parameters
| Parameter | Description |
|---|---|
-h | Displays help for the command. |
-all | Removes all configured automatic update parameters. |
-swstage | Removes the configured software stage location. |
-autoupdate | Removes the automatic update setting. |
-servicename | Removes the configured REST download service name. |
-fstype | Removes the configured file system type for the software stage location. |
-frequency | Removes the configured automatic update frequency. |
-debug | Enables debugging. |
Unsetting a Single Update Parameter
To remove a specific update parameter, specify the corresponding option.
For example, to remove the configured software stage location:
ahfctl unsetupdate -swstage
Example output:
Software stage location successfully removed
Successfully synced AHF configuration
Unsetting All Update Parameters
To remove all AHF automatic update configuration parameters:
ahfctl unsetupdate -all
Example output:
AHF update parameters successfully removed
Successfully synced AHF configuration
How to Apply an Update
Configure Oracle Autonomous Health Framework (AHF) to automatically obtain new compliance checks and Service Request Data Collections (SRDCs) from My Oracle Support (MOS) or a configured REST endpoint.
To configure and apply AHF updates:
Configure the MOS or REST endpoint credentials using
ahfctl setupload.For example, to configure a MOS endpoint:
ahfctl setupload -name mosconf1 -type httpsEnter the requested configuration details:
Enter mosconf1.https.user : john.doe@acme.com Enter mosconf1.https.password : Enter mosconf1.https.url : https://transport.oracle.com/upload/issueEnable automatic updates and configure the software staging location and update frequency.
For example:
ahfctl setupdate -autoupdate on -swstage /my/staging/path -frequency 1In this example:
-autoupdate onenables automatic updates.-swstage /my/staging/pathspecifies the location where update files are staged.-frequency 1configures AHF to check for updates every day.
When you are ready to apply the available update, run:
ahfctl update
AHF retrieves the available compliance check and SRDC metadata from the configured source and applies the update.
Running AHFCTL Update Commands to Apply AHF Metadata and Framework Updates
Use AHFCTL update commands to apply Oracle Autonomous Health Framework (AHF) metadata and framework updates.
You must have AHF installation user privileges to run these commands.
Note:
To configure AHF automatic updates, see the following topics:
ahfctl updateahfctl setupdateahfctl getupdateahfctl unsetupdate
ahfctl applyupdate
Use the ahfctl applyupdate command to update Oracle Autonomous Health Framework (AHF) metadata and framework files on the local node using a specified ZIP file.
Note:
- You must have AHF installation user privileges to run the
ahfctl applyupdatecommand. - In a cluster environment, apply the metadata and framework updates to every cluster node.
Syntax
ahfctl applyupdate [-h] [-debug] [-updatefile <UPDATEFILE>]
Parameters
| Parameter | Description |
|---|---|
-h | Displays help for the command. |
-debug | Enables debugging. |
-updatefile <UPDATEFILE> | Specifies the path and name of the update ZIP file. AHF replaces the existing metadata and framework files with the corresponding files contained in the ZIP file. |
Download the AHF metadata and framework update ZIP file from My Oracle Support Doc ID 2550798.1.
Applying an Update
Specify the downloaded update ZIP file using the -updatefile option.
For example:
ahfctl applyupdate -updatefile /tmp/ahf_data_20220203.zip
Example output:
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
The command replaces the applicable metadata and framework files on the local node and reports the previous and updated data versions.
For a cluster environment, run ahfctl applyupdate with the same update ZIP file on each cluster node.
For more information, see My Oracle Support Doc ID 2550798.1.
ahfctl queryupdate
Use the ahfctl queryupdate command to verify whether Oracle Autonomous Health Framework (AHF) metadata and framework updates have been applied.
You can:
- Use the
-alloption to list all applied metadata and framework updates. - Use the
-updateidoption to query a specific framework update. - Use the
-jsonoption to return the results in JSON format.
Note:
To verify that metadata and framework updates have been applied to all nodes in a cluster, run ahfctl queryupdate as the AHF installation user on each cluster node.
Syntax
ahfctl queryupdate [-h] [-debug] [-updateid <UPDATEID>] [-all] [-json]
Parameters
| Parameter | Description |
|---|---|
-h | Displays help for the command. |
-debug | Enables debugging. |
-updateid <UPDATEID> | Queries a specific framework update by its update ID. |
-all | Lists all applied metadata and framework updates. |
-json | Returns the output in JSON format. |
Note:
Use -updateid to query framework updates. To query metadata updates, use the -all option.
Listing All Applied Updates
Use the -all option to display all applied metadata and framework updates:
ahfctl queryupdate -all
For a metadata update, the output is similar to:
AHF Metadata Update: 20220203
Status: Applied
Applied on: Fri Feb 4 00:47:00 2022
For a framework update, the output is similar to:
AHF Framework update: PATCH_22.2.4.1
Status: Applied
Fixes: 34716496
Applied on: Wed Nov 30 15:14:56 2022
In this example, 34716496 is the update ID for the applied AHF framework update.
Querying a Specific Framework Update
Use the -updateid option to query a specific framework update.
For example:
ahfctl queryupdate -updateid 34716496
Example output:
AHF Framework update: PATCH_22.2.4.1
Status: Applied
Fixes: 34716496
Applied on: Wed Nov 30 15:14:56 2022
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
The output identifies the framework update, its status, update ID, application date, and the framework files modified by the update.
Displaying Update Information in JSON Format
Use the -json option when you want the query results in JSON format.
For example:
ahfctl queryupdate -all -json
You can also request JSON output when querying a specific framework update:
ahfctl queryupdate -updateid 34716496 -json
ahfctl rollbackupdate
Use the ahfctl rollbackupdate command to roll back Oracle Autonomous Health Framework (AHF) metadata or framework updates applied to the local node.
You can specify an update ID to roll back a particular update. If you do not specify an update ID, AHF rolls back to the previous state by default.
Note:
To roll back metadata and framework updates on all nodes in a cluster, run the ahfctl rollbackupdate command as the AHF installation user on each cluster node.
Syntax
ahfctl rollbackupdate [-h] [-debug] [-updateid <UPDATEID>]
Parameters
| Parameter | Description |
|---|---|
-h | Displays help for the command. |
-debug | Enables debugging. |
-updateid <UPDATEID> | Specifies the update ID, such as a bug ID or build ID, of the update that you want to roll back. |
Rolling Back a Specific Update
Use the -updateid option to roll back a specific metadata or framework update.
For example:
ahfctl rollbackupdate -updateid 20220203
Example output:
Data files with timestamp 20220203 identified.
Rolling back the files to Production version 20211220
Rolled back the data files 20220203 to Production version 20211220
In this example, AHF identifies the metadata files associated with update 20220203 and restores the previous production version, 20211220.
Rolling Back to the Previous State
To roll back the most recently applied update to the previous state, run the command without specifying an update ID:
ahfctl rollbackupdate
For a cluster environment, perform the rollback on each cluster node to keep the AHF metadata and framework versions consistent across the cluster.
ahfctl deleteupdatebackup
Use the ahfctl deleteupdatebackup command to delete backup directories created when Oracle Autonomous Health Framework (AHF) metadata or framework updates are applied.
Note:
- To delete update backup directories from all nodes in a cluster, run
ahfctl deleteupdatebackupas the AHF installation user on each cluster node. - Do not delete update backup directories arbitrarily. Oracle recommends deleting them in the same order in which the updates were applied.
- If you delete the backup directory associated with a specific update, you can no longer roll back to the state that existed before that update was applied.
- Upgrading AHF using the
ahf_setupscript automatically removes backup directories associated with previous AHF versions. - Delete AHF update backup directories only when you need to free disk space.
- You cannot delete the backup directory associated with the currently running update because that backup is required to roll back the current update.
For example, suppose the following updates were applied in this order:
20230901 -> 20231001 -> 20231101
If 20231101 is the current update, you can delete the backup directories for:
20230901
20231001
Do not delete the backup directory for:
20231101
Deleting a backup directory permanently removes the ability to use that backup to roll back the associated update.
Syntax
ahfctl deleteupdatebackup [-h] [-debug] [-updateid <UPDATEID>] [-silent]
Parameters
| Parameter | Description |
|---|---|
-h | Displays help for the command. |
-debug | Enables debugging. |
-updateid <UPDATEID> | Deletes the backup directory associated with the specified update ID or timestamp. |
-silent | Deletes the backup directory without prompting for user confirmation. |
Deleting an Update Backup
Use the -updateid option to delete the backup directory associated with a specific update.
For example:
ahfctl deleteupdatebackup -updateid 20220130
Example output:
Deleted metadata backup directory for:
/opt/oracle.ahf/data/work/.exachk_patch_directory/.20220130_metadata_bkp
Before deleting an update backup, verify that you no longer need to roll back to the state associated with that backup.