Running AHFCTL Upgrade Commands to Upgrade Oracle Autonomous Health Framework

You need root access to run getupgrade, setupgrade, unsetupgrade, and upgrade commands.

ahfctl getupgrade

Use the ahfctl getupgrade command to fetch upgrade config from the ahf.properties file.

Syntax

ahfctl getupgrade -all
ahfctl getupgrade -all -json

Parameters

ahfctl getupgrade Command Parameters

ParameterDescription
-allFetches upgrade configuration details from the ahf.properties file.
-jsonOptionally, specify this option to get the output in JSON format.

Example Print upgrade parameters

ahfctl getupgrade -all

autoupgrade : off
autoupgrade.swstage : /scratch/ahf_stage
autoupgrade.frequency : 30
autoupgrade.servicename : [not set]
autoupgrade.fstype : [not set]
autoupgrade.tmp_loc : [not set]
autoupgrade.remove_installer : [not set]
autoupgrade.upgradetime : [not set]
ahfctl getupgrade -all -json
{
    "autoupgrade": "off",
    "autoupgrade.swstage": "/opt/oracle.ahf",
    "autoupgrade.frequency": "30",
    "autoupgrade.servicename": "[not set]",
    "autoupgrade.fstype": "[not set]",
    "autoupgrade.tmp_loc": "[not set]",
    "autoupgrade.remove_installer": "[not set]",
    "autoupgrade.upgradetime": "[not set]"
}

ahfctl setupgrade

Use the ahfctl setupgrade command to set upgrade parameters.

Syntax

ahfctl setupgrade
[-h]
[-all]
[-swstage SWSTAGE]
[-autoupgrade AUTOUPGRADE]
[-upgradetime UPGRADETIME]
[-fstype FSTYPE]
[-tmp_loc TMP_LOC]
[-remove_installer REMOVE_INSTALLER]
[-servicename SERVICENAME]
[-frequency FREQUENCY]
[-debug]
[-autoupdate AUTOUPDATE]

Note:

If you are not using the default port (443), then you must configure a custom port using the ahfctl setupload command to upgrade AHF successfully.

Parameters

ahfctl setupgrade Command Parameters

ParameterDescription
-allSets all the parameters.
-swstage SWSTAGESpecify the software stage location. For example: /opt/oracle.ahf
-autoupgrade AUTOUPGRADESpecify to turn autoupgrade on or off. For example: ahfctl setupgrade -autoupgrade <on/off>
-upgradetime UPGRADETIMESpecify the upgradetime in the format [H], [HH], or [HH:MM].
-fstype FSTYPESpecify the stage location filesystem type. For example: nfs/acfs/local.
-tmp_loc TMP_LOCSpecify the temporary location directory for AHF to extract the install archive. The specified directory must exist. Default: /tmp
-remove_installer REMOVE_INSTALLERSpecify this flag to remove the AHF installer ZIP at the stage location after auto upgrade. By default, AHF does not remove the AHF installer ZIP. Valid values: yes|no
-servicenameSpecify the name of the REST download service. Default: ahf_upgrade_loc
-frequencySpecify the autoupgrade frequency in the range (1,30) days. For example: 15
-debugSpecify the -debug option to enable debugging.
-autoupdate AUTOUPDATESpecify to turn autoupdate configurations on or off. Valid values: ON|OFF. For example: ahfctl setupgrade -autoupgrade on -swstage /opt/oracle.ahf -frequency 1 -autoupdate on or ahfctl setupgrade -autoupgrade on -swstage /opt/oracle.ahf -frequency 1 -autoupdate off

Example Set upgrade configuration

ahfctl setupgrade -swstage /scratch/ahf_stage -autoupgrade on -frequency 21
AHF autoupgrade parameters successfully updated
Successfully synced AHF configuration

Example Set all upgrade configuration

ahfctl setupgrade -all
Enter autoupgrade flag  : on
Enter software stage location : /scratch/ahf_stage
Enter auto upgrade frequency : 30
AHF autoupgrade parameters successfully updated
Successfully synced AHF configuration

Example Turn off autoupgrade

ahfctl setupgrade -autoupgrade off
AHF autoupgrade parameters successfully updated
Successfully synced AHF configuration

ahfctl unsetupgrade

Use the ahfctl unsetupgrade command to unset upgrade parameters.

Syntax

ahfctl unsetupgrade
[-h]
[-all]
[-swstage SWSTAGE]
[-autoupgrade AUTOUPGRADE]
[-upgradetime UPGRADETIME]
[-fstype FSTYPE]
[-tmp_loc TMP_LOC]
[-remove_installer REMOVE_INSTALLER]
[-servicename SERVICENAME]
[-frequency FREQUENCY]
[-debug]
[-autoupdate AUTOUPDATE]

Parameters

ahfctl unsetupgrade Command Parameters

ParameterDescription
-allUnsets all the parameters.
-swstage SWSTAGESpecify the software stage location to unset.
-autoupgrade AUTOUPGRADESpecify to turn on or off autoupgrade.
-upgradetime UPGRADETIMESpecify unset upgradetime.
-fstype FSTYPESpecify to unset stage location filesystem type.
-tmp_loc TMP_LOCSpecify to unset the temporary location directory for AHF to extract the install archive.
-remove_installer REMOVE_INSTALLERSpecify this flag to unset the stage location configured to remove AHF installer zip after auto upgrade.
-servicenameSpecify the name of REST download service to unset.
-frequencyUnsets autoupgrade frequency.
-debugSpecify to unset debugging.
-autoupdate AUTOUPDATE

Specify to unset autoupdate configurations.

For example: ahfctl unsetupgrade -autoupdate

Example Set a single upgrade parameter

ahfctl unsetupgrade -swstage
Software stage location successfully removed
Successfully synced AHF configuration

Example Unset all upgrade configuration

ahfctl unsetupgrade -all
AHF upgrade parameters successfully removed
Successfully synced AHF configuration

Example Unset autoupgrade frequency

ahfctl unsetupgrade -frequency
Autoupgrade frequency successfully removed
Successfully synced AHF configuration

ahfctl upgrade

Use the ahfctl upgrade command to upgrade AHF to a new version.

Syntax

ahfctl upgrade [-nomos]

Parameters

ahfctl upgrade Command Parameters

ParameterDescription
-nomosSpecify not to configure MOS.

Example New AHF setup is available at software stage location

ahfctl upgrade -nomos

AHF Installer for Platform Linux Architecture x86_64
AHF Installation Log : /tmp/ahf_install_211000_8398_2021_03_02-03_56_28.log
Starting Autonomous Health Framework (AHF) Installation
AHF Version: 21.1.0 Build Date: 202103010521
AHF is already installed at /opt/oracle.ahf
Installed AHF Version: 21.1.0 Build Date: 202102242242
Upgrading /opt/oracle.ahf
Shutting down AHF Services

Starting AHF Services
Oracle Trace File Analyzer (TFA) is already running
No new directories were added to TFA

AHF is successfully upgraded to latest version
.---------------------------------------------------------------------.
| Host          | TFA Version | TFA Build ID         | Upgrade Status |
+---------------+-------------+----------------------+----------------+
| node1		|  21.1.0.0.0 | 21100020210224224247 | UPGRADED       |
'---------------+-------------+----------------------+----------------'

Moving /tmp/ahf_install_211000_8398_2021_03_02-03_56_28.log to
/u01/app/oracle/oracle.ahf/data/node1/diag/ahf/

Example New AHF is available at Rest Endpoint

ahfctl upgrade

Started downloading...
AHF-LINUX_v20.4.4.zip is successfully downloaded to /opt/oracle.ahf/download location!
AHF Installer for Platform Linux Architecture x86_64
AHF Installation Log : /tmp/ahf_install_211000_8398_2021_03_02-03_56_28.log
Starting Autonomous Health Framework (AHF) Installation
AHF Version: 21.1.0 Build Date: 202103010521
AHF is already installed at /opt/oracle.ahf
Installed AHF Version: 21.1.0 Build Date: 202102242242
Upgrading /opt/oracle.ahf
Shutting down AHF Services

Starting AHF Services
Oracle Trace File Analyzer (TFA) is already running
No new directories were added to TFA

AHF is successfully upgraded to latest version
.---------------------------------------------------------------------.
| Host | TFA Version | TFA Build ID | Upgrade Status |
+---------------+-------------+----------------------+----------------+
| node1	| 21.1.0.0.0 | 21100020210224224247 | UPGRADED |
'---------------+-------------+----------------------+----------------'

Moving /tmp/ahf_install_211000_8398_2021_03_02-03_56_28.log to
/u01/app/oracle/oracle.ahf/data/node1/diag/ahf/