Fresh install: Autonomous Health Framework for single instance Oracle 19c

I have been deploying Tracefile Anlyzer (TFA) to every system I’m looking after, whenever possible. Going back in the history of this weblog I created quite a few posts about how you can do so, too. When writing these posts back in 2018, TFA was available on its own.

In the meantime TFA has been merged into another, even more powerful tool: Autonomous Health Framewowrk (AHF). Its documentation appears a little bit scattered over Oracle’s website, and since this post is about Oracle 19c I decided to use the documentation as embedded in the 19c database documentation bookshelf. If I missed a more current version, please let me know via my twitter handle @MartinDBA.

This post covers a fresh installation of AHF 20.1.2 – the current version at the time of writing – on Oracle Linux 7.8/UEK 5 with my LANGuage set to en_US.UTF-8. I have a single instance 19c database, patched to 19.7.0 running on the same host. This is purely an RDBMS deployment, the host does not contain any trace of Grid Infrastructure. I’ll write two more posts covering the installation on Oracle Restart and Real Application Clusters. I’m only covering Oracle release 19c as it’s the long-term-support release for the 12c Release 2 family.


AHF, or rather its subcomponents, can easily consume plenty of space. I create my systems with a separate logical volume for /opt, where I’m installing AHF. This way I can’t run out of space on my root file system, a situation to be avoided at all cost. That’s as bad as running out of space on the logical volumes containing the Oracle binaries and ADR… So please make sure you have enough space for AHF and its components, and separate them from other critical system components!


Before you can install AHF, you need to first download it from My Oracle Support (MOS). AHF requires perl-Data-Dumper and perl-Digest-MD5 to be present on your system.

Downloading AHF

This is pretty straight forward: simply navigate to MOS note 2550798.1 and download the version for your platform. At the time of writing, 20.1.2 was the current release for Linux.

Avoiding problems during the installation

Before you can start the installation, you need to absolutely make sure to have perl’s Data::Dumper and Digest::MD5 installed or you’ll run into nasty trouble during the installation.

[root@server5 ~]# yum install -y perl-Digest-MD5 perl-Data-Dumper
Loaded plugins: ulninfo
Resolving Dependencies
--> Running transaction check
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
---> Package perl-Digest-MD5.x86_64 0:2.52-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package                        Arch                 Version                      Repository                Size
 perl-Data-Dumper               x86_64               2.145-3.el7                  ol7_latest                47 k
 perl-Digest-MD5                x86_64               2.52-3.el7                   ol7_latest                29 k

Transaction Summary
Install  2 Packages

Total download size: 76 k
Installed size: 151 k
Downloading packages:
(1/2): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                            |  47 kB  00:00:00     
(2/2): perl-Digest-MD5-2.52-3.el7.x86_64.rpm                                              |  29 kB  00:00:00     
Total                                                                            426 kB/s |  76 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : perl-Digest-MD5-2.52-3.el7.x86_64                                                             1/2 
  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                           2/2 
  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                           1/2 
  Verifying  : perl-Digest-MD5-2.52-3.el7.x86_64                                                             2/2 

  perl-Data-Dumper.x86_64 0:2.145-3.el7                    perl-Digest-MD5.x86_64 0:2.52-3.el7                   

[root@server5 ~]# 

Install AHF

Once you finished downloading AHF, copy the zipfile to the machine where you want it to be installed. After unzipping it, you will file the installer (ahf_setup) and a README file. Please make sure you check the README before invoking the installer.

The installation can be automated using Ansible for example, this is the list of options offered:

[root@server5 ahf]# ./ahf_setup -h

AHF Installer for Platform Linux Architecture x86_64

   Usage for ./ahf_setup

   ./ahf_setup [[-ahf_loc ][-data_dir ][-nodes ][-extract[orachk|exachk|-notfasetup] [-force]][-local][-silent][-tmp_loc ][-debug [-level <1-6>]]]

        -ahf_loc          -    Install into the directory supplied. (Default /opt/oracle.ahf)
        -data_dir         -    AHF Data Directory where all the collections, metadata, etc. will be stored 
        -nodes            -    Comma separated Remote Node List 
        -extract          -    Extract only files from Installer. (Default for non-root users)
        -notfasetup       -    Do not Configure TFA when used with -extract
        -force            -    Force the mentioned compliance type with -extract
        -local            -    Only install on the local node
        -silent           -    Do not ask any install questions 
        -tmp_loc          -    Temporary location directory for AHF to extract the install archive to (must exist) (Default /tmp)
        -perlhome         -    Custom location of perl binaries
        -debug            -    Debug AHF Install Script 
        -level            -    AHF Instal Debug Level 1-6 (Default 4 with option -debug) 
                               [FATAL - 1, ERROR - 2, WARNING - 3, INFO - 4, DEBUG - 5, TRACE - 6] 

   Note : 
   1. Without parameters AHF will take you through an interview process for installation 
   2. If -silent option is used, then ensure that you use the -data_dir option, otherwise, the installer script will fail 
   3. The -force option is applicable only when -extract orachk|exachk option is passed else it is ignored. 

Alternatively you can install AHF interactively, I’ll leave that as an exercise to the reader.

I tend to install AHF in /opt; please see above for a quick warning about space usage! All my systems use LVM for /opt, a configuration setting I’m enforcing via the kickstart file.

Oracle recommends installing AHF as root, and I’ll comply with the suggestion:

[root@server4 ahf]# ./ahf_setup -ahf_loc /opt/oracle.ahf -data_dir /opt -silent

AHF Installer for Platform Linux Architecture x86_64

AHF Installation Log : /tmp/ahf_install_24137_2020_04_24-10_04_50.log

Starting Autonomous Health Framework (AHF) Installation

AHF Version: 20.1.2 Build Date: 202004031134

AHF Location : /opt/oracle.ahf

AHF Data Directory : /opt/oracle.ahf/data

Extracting AHF to /opt/oracle.ahf

Configuring TFA Services

Discovering Nodes and Oracle Resources
Successfully generated certificates. 

Starting TFA Services
Created symlink from /etc/systemd/system/ to /etc/systemd/system/oracle-tfa.service.
Created symlink from /etc/systemd/system/ to /etc/systemd/system/oracle-tfa.service.

| Host    | Status of TFA | PID   | Port  | Version    | Build ID             |
| server4 | RUNNING       | 25035 | 11631 | | 20120020200403113404 |

Running TFA Inventory...

Adding default users to TFA Access list...

|             Summary of AHF Configuration            |
| Parameter       | Value                             |
| AHF Location    | /opt/oracle.ahf                   |
| TFA Location    | /opt/oracle.ahf/tfa               |
| Orachk Location | /opt/oracle.ahf/orachk            |
| Data Directory  | /opt/oracle.ahf/data              |
| Repository      | /opt/oracle.ahf/data/repository   |
| Diag Directory  | /opt/oracle.ahf/data/server4/diag |

Starting orachk daemon from AHF ...

AHF binaries are available in /opt/oracle.ahf/bin

AHF is successfully installed

Moving /tmp/ahf_install_24137_2020_04_24-10_04_50.log to /opt/oracle.ahf/data/server4/diag/ahf/ 

AHF can send notification emails to an address you provide when running the interactive installer. I haven’t seen an option to provide an email address as part of the silent installation, but it’s not a problem as you can always update the configuration later.

If you are running AHF 20.1.2 OSWatcher won’t start automatically and you need to fix your configuration manually as described in a separate post.

Once this has completed, you should check if TFA is running.

[oracle@server4 ~]$ tfactl print status

| Host    | Status of TFA | PID  | Port  | Version    | Build ID             | Inventory Status |
| server4 | RUNNING       | 1986 | 21511 | | 20120020200403113404 | COMPLETE         |
[oracle@server4 ~]$ 

This looks as if it does indeed be ready for business. And I have all the support tools at my disposal:

[oracle@server4 ~]$ tfactl toolstatus

|                   TOOLS STATUS - HOST : server4                  |
| Tool Type            | Tool         | Version      | Status      |
| Development Tools    | orachk       | | DEPLOYED    |
|                      | oratop       |       14.1.2 | DEPLOYED    |
| Support Tools Bundle | darda        | 2.10.0.R6036 | DEPLOYED    |
|                      | oswbb        |        8.3.2 | RUNNING     |
|                      | prw          | | NOT RUNNING |
| TFA Utilities        | alertsummary | | DEPLOYED    |
|                      | calog        | | DEPLOYED    |
|                      | dbcheck      | | DEPLOYED    |
|                      | dbglevel     | | DEPLOYED    |
|                      | grep         | | DEPLOYED    |
|                      | history      | | DEPLOYED    |
|                      | ls           | | DEPLOYED    |
|                      | managelogs   | | DEPLOYED    |
|                      | menu         | | DEPLOYED    |
|                      | param        | | DEPLOYED    |
|                      | ps           | | DEPLOYED    |
|                      | pstack       | | DEPLOYED    |
|                      | summary      | | DEPLOYED    |
|                      | tail         | | DEPLOYED    |
|                      | triage       | | DEPLOYED    |
|                      | vi           | | DEPLOYED    |

Note :-
  DEPLOYED    : Installed and Available - To be configured or run interactively.
  NOT RUNNING : Configured and Available - Currently turned off interactively.
  RUNNING     : Configured and Available. 

I guess that’s it for single instance deployments.

Didn’t you say TFA was present in 12.2 and later?

I did, and it was, at least with single instance. So I was a little bit surprised to see a change in behaviour during the database installation. After invoking runInstaller, you need to run 2 scripts as root, one to set the permissions on the inventory, the second one performs database specific tasks; it’s called TFA can potentially be installed when invoking

[oracle@server5 ~]$ cat /u01/app/oracle/product/19.0.0/dbhome_1/
. /u01/app/oracle/product/19.0.0/dbhome_1/install/utl/ "$@"
. /u01/app/oracle/product/19.0.0/dbhome_1/install/utl/

# Root Actions related to network

# Invoke standalone


I didn’t build this environment, Ansible did. All Ansible calls to Oracle software invoke the tools in silent mode. Invoking in silent mode merely emits a message at the end, asking you to check the logfile for more information. So I did, and this is what it read:

Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/19.0.0/dbhome_1
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Oracle Trace File Analyzer (TFA) is available at : /u01/app/oracle/product/19.0.0/dbhome_1/bin/tfactl  

It looks like TFA is available after the database software is deployed. I wanted to see if it could interfere with AHF (at this point AHF wasn’t deployed):

[oracle@server5 ~]$ /u01/app/oracle/product/19.0.0/dbhome_1/bin/tfactl status
TFA-00519 Oracle Trace File Analyzer (TFA) is not installed. 

It doesn’t seem as if TFA was present in Oracle 19c single instance. It will become usable once AHF has been deployed.