8i | 9i | 10g | 11g | 12c | 13c | 18c | 19c | 21c | 23c | Misc | PL/SQL | SQL | RAC | WebLogic | Linux
Autonomous Health Framework (AHF)
Autonomous Health Framework (AHF) provides a number of diagnostic tools in a single bundle, making it easy to gather diagnostic information about the Oracle database and clusterware, which in turn helps with problem resolution when dealing with Oracle Support.
- What is Autonomous Health Framework (AHF)
- Before We Start
- Download Oracle Autonomous Health Framework (AHF)
- Install Oracle Autonomous Health Framework (AHF) (as root user)
- Install Oracle Autonomous Health Framework (AHF) (as non-root user)
- Run ORAchk
- Run a TFA Collection
- Upload Files to My Oracle Support (MOS)
Related articles.
What is Autonomous Health Framework (AHF)
Autonomous Health Framework (AHF) combines the existing Trace File Analyzer (TFA) and ORAchk/EXAchk, along with a bunch of other stuff, into a single download and setup. For any scenario where you would have installed one of these individual tools, you should now install AHF.
It's a good idea to upload the AHF output as part of any support request, as they will just ask you to do it anyway.
Is that it? Well, if you install AHF using the root user and start everything as daemon processes, it will give you proactive health monitoring, which could help you fix issues before they become a problem.
Before We Start
Just some things to consider before we start.
Make sure you have installed the "perl-Digest-MD5" package before you start. Without it you will receive a "Can't locate Digest/MD5.pm in @INC" error when you install, and subsequently run some commands. AHF thinks it's installed properly, but it hasn't. The command to do this install is listed below.
yum install -y perl-Digest-MD5 perl-Data-Dumper
- You will get a lot more out of these tools if you install AHF as root. Without that you are going to have to manually run checks, or manually schedule them.
The current version (19.3) won't accept my email address as a valid email. It will accept a "-" before the "@" in an email address, but not after. I've raised a SR for this with Oracle Support (Bug : 30484078) and it will be fixed in a future release. For now the workaround is the use the following command once the installation is complete.
tfactl set ahfnotificationaddress="me@my-company.com"
Download Autonomous Health Framework (AHF)
Autonomous Health Framework (AHF) will be shipped with new releases of the database, but you should always download the latest version. The following location gives an overview of the AHF product, as well as download links and basic instructions.
This article assumes you've downloaded the latest version of AHF and it is placed in the "/u01/software" directory.
Install Oracle Autonomous Health Framework (AHF) (as root user)
Autonomous Health Framework (AHF) can be installed as the "root" user on the server, which provides the most functionality and allows it to run in a proactive manner as a daemon. In this example we will perform an installation as the root user.
Unzip the software and run the ahf_setup
command. Answer the questions when prompted. The following is an example of the root installation.
# cd /u01/software # unzip -oq AHF-LINUX_v19.3.0.zip # # ./ahf_setup AHF Installation Log : /tmp/ahf_install_3474_2019_10_29-09_50_13.log Starting Autonomous Health Framework (AHF) Installation AHF Version: 193000 Build Date: 201910181720 Default AHF Location : /opt/oracle.ahf Do you want to change AHF Location (/opt/oracle.ahf) ? Y|[N] : AHF Location : /opt/oracle.ahf AHF Data Directory stores diagnostic collections and metadata. AHF Data Directory requires at least 5GB (Recommended 10GB) of free space. Choose Data Directory from below options : 1. /opt/oracle.ahf [Free Space : 39858 MB] 2. Enter a different Location Choose Option [1 - 2] : 1 AHF Data Directory : /opt/oracle.ahf/data Do you want to add AHF Notification Email IDs ? [Y]|N : Enter Email IDs separated by space : tim@example.com Extracting AHF to /opt/oracle.ahf Configuring TFA Services Discovering Nodes and Oracle Resources Starting TFA Services Created symlink from /etc/systemd/system/multi-user.target.wants/oracle-tfa.service to /etc/systemd/system/oracle-tfa.service. Created symlink from /etc/systemd/system/graphical.target.wants/oracle-tfa.service to /etc/systemd/system/oracle-tfa.service. .------------------------------------------------------------------------------. | Host | Status of TFA | PID | Port | Version | Build ID | +-----------+---------------+------+-------+------------+----------------------+ | localhost | RUNNING | 4376 | 24035 | 19.3.0.0.0 | 19300020191018172057 | '-----------+---------------+------+-------+------------+----------------------' 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/localhost/diag | '-----------------+-------------------------------------' AHF binaries are available in /opt/oracle.ahf/bin AHF is successfully installed Moving /tmp/ahf_install_3474_2019_10_29-09_50_13.log to /opt/oracle.ahf/data/localhost/diag/ahf/ #
As shown above, the tfactl
and orachk
commands are available from the following directory.
/opt/oracle.ahf/bin
As part of the installation the oracle-tfa.service
service will be enabled and started.
# systemctl status oracle-tfa.service ● oracle-tfa.service - Oracle Trace File Analyzer Loaded: loaded (/etc/systemd/system/oracle-tfa.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2019-10-29 09:52:05 UTC; 1h 6min ago Main PID: 4270 (init.tfa) CGroup: /system.slice/oracle-tfa.service ├─ 4270 /bin/sh /etc/init.d/init.tfa run >/dev/null 2>&1 </dev/null ├─ 4376 /opt/oracle.ahf/jre/bin/java -server -Xms32m -Xmx64m -Djava.awt.headless=true -Ddisable.checkForUpdate=true oracle.rat.tfa.TFAMain /opt/oracle.ahf/tfa ├─ 9572 /opt/oracle.ahf/jre/bin/java -server -Xms32m -Xmx64m -Djava.awt.headless=true -Ddisable.checkForUpdate=true oracle.rat.tfa.TFAMain /opt/oracle.ahf/tfa └─26504 /bin/sleep 30 Oct 29 10:06:05 localhost.localdomain su[11480]: (to oracle) root on none #
Install Oracle Autonomous Health Framework (AHF) (as non-root user)
Autonomous Health Framework (AHF) can be installed as the "root" user on the server, which provides the most functionality and allows it to run in a proactive manner as a daemon, or locally as the Oracle software owner. In this example we will perform a local installation, making it a reactive tool.
Unzip the software, create a destination location and install the software using the "-ahf_loc" flag. Answer the questions when prompted. The following is an example of the non-root installation.
$ cd /u01/software $ unzip -oq AHF-LINUX_v19.3.0.zip $ $ mkdir -p $ORACLE_HOME/ahf $ ./ahf_setup -ahf_loc $ORACLE_HOME/ahf AHF Installation Log : /tmp/ahf_install_28615_2019_10_29-08_53_47.log Starting Autonomous Health Framework (AHF) Installation AHF Version: 193000 Build Date: 201910181720 AHF Location : /u01/app/oracle/product/19.0.0/dbhome_1/ahf/oracle.ahf AHF Data Directory stores diagnostic collections and metadata. AHF Data Directory requires at least 5GB (Recommended 10GB) of free space. Choose Data Directory from below options : 1. /u01/app/oracle/product/19.0.0/dbhome_1/ahf/oracle.ahf [Free Space : 89823 MB] 2. Enter a different Location Choose Option [1 - 2] : 1 AHF Data Directory : /u01/app/oracle/product/19.0.0/dbhome_1/ahf/oracle.ahf/data Do you want to add AHF Notification Email IDs ? [Y]|N : Enter Email IDs separated by space : tim@example.com Extracting AHF to /u01/app/oracle/product/19.0.0/dbhome_1/ahf/oracle.ahf Configuring TFA in Standalone Mode... Build Version : 193000 Build Date : 201910181720 Discovering Nodes and Oracle Resources AHF is deployed at /u01/app/oracle/product/19.0.0/dbhome_1/ahf/oracle.ahf AHF binaries are available in /u01/app/oracle/product/19.0.0/dbhome_1/ahf/oracle.ahf/bin AHF is successfully installed Moving /tmp/ahf_install_28615_2019_10_29-08_53_47.log to /u01/app/oracle/product/19.0.0/dbhome_1/ahf/oracle.ahf/data/localhost/diag/ahf/ $
As shown above, the tfactl
and orachk
commands are available from the following directory.
$ORACLE_HOME/ahf/oracle.ahf/bin
Run ORAchk
With the installation complete we can use the orachk
command to check the services running on the server. This can be done on-demand, or run as a background task, which will send an email to the notification email addresses.
# root cd /opt/oracle.ahf/bin # non-root cd $ORACLE_HOME/ahf/oracle.ahf/bin # on-demand ./orachk # background ./orachk -autostart
When orachk -autostart
is used MOS ID 2550798.1 states the following comliance check will happen.
- Severe problems checked once a day at 2am.
- All problems checked on Sunday at 3am.
- Failures or differences since the last run are sent to the notification email address(es).
The following is an example of the output from orachk -autostart
run from the root user.
# orachk -autostart Started orachk discovery caching.... List of running databases 1. cdb1 2. None of above Select databases from list for checking best practices. For multiple databases, select 1 for All or comma separated number like 1,2 etc [1-2][1]. . . . . Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS . . . . . . . . . . . . . . . . . . . . . . ------------------------------------------------------------------------------------------------------- Oracle Stack Status ------------------------------------------------------------------------------------------------------- Host Name CRS Installed ASM HOME RDBMS Installed CRS UP ASM UP RDBMS UP DB Instance Name ------------------------------------------------------------------------------------------------------- localhost No No Yes No No Yes cdb1 ------------------------------------------------------------------------------------------------------- Copying plug-ins . . . . . . . . . . Collections and audit checks log file is /opt/oracle.ahf/data/localhost/orachk/orachk_102919_103312_discovery/log/orachk.log Successfully completed orachk discovery caching. Setting up orachk auto restart functionality oracle-orachkscheduler start/running, process 22031 Starting orachk daemon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . orachk daemon started successfully Daemon log file location is : /opt/oracle.ahf/data/localhost/orachk/orachk_daemon.log #
Once this is complete the oracle-orachkscheduler.service
service will be enabled and running.
# systemctl status oracle-orachkscheduler.service ● oracle-orachkscheduler.service - Oracle orachk scheduler initsetup Loaded: loaded (/etc/systemd/system/oracle-orachkscheduler.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2019-10-29 10:37:10 UTC; 18min ago Main PID: 22031 (init.orachksche) CGroup: /system.slice/oracle-orachkscheduler.service ├─22031 /bin/sh /etc/init.d/init.orachkscheduler run >/dev/null 2>&1 </dev/null └─25920 /bin/sleep 30 Oct 29 10:37:10 localhost.localdomain systemd[1]: Started Oracle orachk scheduler initsetup. Oct 29 10:37:11 localhost.localdomain su[22069]: (to root) root on none #
Run a TFA Collection
With the installation complete we can use the tfactl
command to perform a number of collections, including TFA Service Request Data Collections (SRDC). There are a large number of SRDC collection types, with each gathering different information, as described here.
Here are a few examples.
# root cd /opt/oracle.ahf/bin # non-root cd $ORACLE_HOME/ahf/oracle.ahf/bin # Gather information about errors. You are prompted to select a specific incident. ./tfactl diagcollect -srdc ORA-00600 ./tfactl diagcollect -srdc ORA-07445 # Collect data for all components for a specific time period. ./tfactl diagcollect -from "2018-06-16 13:00:00" -to "2018-06-16 13:00:00" # Collect data for all components for the last 12 hours. ./tfactl diagcollect
Each TFA collection produces a single zip file that can be uploaded to My Oracle Support (MOS), as described below.
Upload Files to My Oracle Support (MOS)
You can manually upload a zip file produced by TFA or ORAchk by attaching it to your SR through the MOS website in the normal way. An alternative is to get TFA to upload it and attach it to your Service Request (SR). To do this you must provide your MOS credentials. This can be done as part of the command line, or they can be stored in a secure wallet by running the following command as the "root" user.
# root cd /opt/oracle.ahf/bin # non-root cd $ORACLE_HOME/ahf/oracle.ahf/bin # ./tfactl setupmos Enter User Id: tim@example.com Enter Password: SUCCESS - CERTIMPORT - Successfully imported certificate #
The result of a TFA collection can be uploaded directly to MOS by including the "-sr" option in the command to specify the target SR number.
# MOS credentials supplied by wallet. ./tfactl diagcollect -srdc ORA-00600 -sr 1-12345678901 # MOS credentials supplied on command line. You are prompted for the password. ./tfactl diagcollect -srdc ORA-00600 -sr 1-12345678901 -user me@example.com
You can upload one or more files (both TFA generated and other files) as a separate action using the following commands.
# MOS credentials supplied by wallet. ./tfactl upload -sr 1-12345678901 -wallet file1.zip file2.zip file3.zip # MOS credentials supplied on command line. You are prompted for the password. ./tfactl upload -sr 1-12345678901 -user me@example.com file1.zip file2.zip file3.zip
For more information see:
- Autonomous Health Framework (AHF) - Including TFA and ORAchk/EXAChk (Doc ID 2550798.1)
- Collecting Diagnostic Data and Using One Command Service Request Data Collections
- Oracle Trace File Analyzer (TFA)
- Diagnose RAC Problems : ORAchk
Hope this helps. Regards Tim...