Friday 24 July 2020

Oracle Trace File Analyzer (TFA) concept,Installation and Troubleshooting



Oracle Trace File Analyzer (TFA)




Trace File Analyzer (TFA) is Primary diagnostic collection tool, with Database Support Tools Bundle
It has been shipped with the Oracle database since 11.2.0.4, if it is already installed and running but still Oracle recommend downloading the latest version on a regular basis to get the best results. The following location gives an overview of the TFA product, as well as download links and basic instructions.



Download TFA

download and install the latest TFA Support Tools Bundle from Note:1594347.1

If TFA Software is older than 180 days. We need to download from oracle site and install again .Oracle support always want log from the latest version only.

Trace File Analyzer (TFA) & ORAchk/EXAchk

Single combined installer





To install TFA

To install as root:
  1. Download the appropriate installer from above, copy to a target machine and unzip
  2. Run the TFA & ORAchk/EXAchk install command ./ahf_setup [-ahf_loc install_dir] [-data_dir data_dir]


a) To install TFA in default location from root user

./ahf_setup

b) To install instal TFA in specific location from root user

./ahf_setup -ahf_loc /u02/oracle/12.1.0.2/grid/tfa

#
+ASM1:/u02/oracle/12.1.0.2/grid:N # line added by Agent
-MGMTDB:/u02/oracle/12.1.0.2/grid:N # line added by Agent
RACDB_TEST:/u01/oracle/RACDB_TEST/product/12.1.0.2:N
RACDB_DEV:/u01/oracle/RACDB_DEV/product/12.1.0.2:N
[root@Node1tfa]# ls -ltr /u02/oracle/12.1.0.2/grid/tfa
total 8
drwxr-xr-x 2 root root 4096 Oct 13 2017 bin
drwxr-x--x 3 root root 4096 Jul 1 01:07 Node1

eg

[root@Node1tfa]# ./ahf_setup -ahf_loc /u02/oracle/12.1.0.2/grid/tfa

AHF Installer for Platform Linux Architecture x86_64

AHF Installation Log : /tmp/ahf_install_202000_21323_2020_07_14-15_20_38.log

Starting Autonomous Health Framework (AHF) Installation

AHF Version: 20.2.0 Build Date: 202006260723

TFA is already installed at : /u02/oracle/12.1.0.2/grid/tfa/Node1/tfa_home

Installed TFA Version : 192000 Build ID : 20190426044818

AHF Location : /u02/oracle/12.1.0.2/grid/tfa

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. /u02/oracle/prod [Free Space : 29071 MB]
2. /u02/oracle/12.1.0.2/grid/tfa [Free Space : 29071 MB]
3. Enter a different Location

Choose Option [1 - 3] : 2

AHF Data Directory : /u02/oracle/12.1.0.2/grid/tfa/oracle.ahf/data

Shutting down TFA : /u02/oracle/12.1.0.2/grid/tfa/Node1/tfa_home

Copying TFA Data Files from /u02/oracle/12.1.0.2/grid/tfa/Node1/tfa_home

Uninstalling TFA : /u02/oracle/12.1.0.2/grid/tfa/Node1/tfa_home

Do you want to add AHF Notification Email IDs ? [Y]|N : N

AHF will also be installed/upgraded on these Cluster Nodes :

1. Node2

The AHF Location and AHF Data Directory must exist on the above nodes
AHF Location : /u02/oracle/12.1.0.2/grid/tfa
AHF Data Directory : /u02/oracle/12.1.0.2/grid/tfa/oracle.ahf/data

Do you want to install/upgrade AHF on Cluster Nodes ? [Y]|N : Y

Extracting AHF to /u02/oracle/12.1.0.2/grid/tfa

Configuring TFA Services

Copying TFA Data Files to AHF

Discovering Nodes and Oracle Resources

Starting TFA Services

.--------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID |
+-------------+---------------+-------+------+------------+----------------------+
| Node1| RUNNING | 24041 | 5000 | 20.2.0.0.0 | 20200020200626072308 |
'-------------+---------------+-------+------+------------+----------------------'

Running TFA Inventory...

Adding default users to TFA Access list...

.----------------------------------------------------------------------------------.
| Summary of AHF Configuration |
+-----------------+----------------------------------------------------------------+
| Parameter | Value |
+-----------------+----------------------------------------------------------------+
| AHF Location | /u02/oracle/12.1.0.2/grid/tfa |
| TFA Location | /u02/oracle/12.1.0.2/grid/tfa/tfa |
| Orachk Location | /u02/oracle/12.1.0.2/grid/tfa/orachk |
| Data Directory | /u02/oracle/12.1.0.2/grid/tfa/oracle.ahf/data |
| Repository | /u02/oracle/12.1.0.2/grid/tfa/oracle.ahf/data/repository |
| Diag Directory | /u02/oracle/12.1.0.2/grid/tfa/oracle.ahf/data/Node1/diag |
'-----------------+----------------------------------------------------------------'


Starting orachk scheduler from AHF ...

AHF install completed on Node1

Installing AHF on Remote Nodes :

AHF will be installed on Node2, Please wait.

AHF will prompt twice to install/upgrade per Remote Node. So total 2 prompts

Do you want to continue Y|[N] : N

Please install AHF using -local option on all remote nodes manually

AHF binaries are available in /u02/oracle/12.1.0.2/grid/tfa/bin

AHF is successfully installed

Moving /tmp/ahf_install_202000_21323_2020_07_14-15_20_38.log to /u02/oracle/12.1.0.2/grid/tfa/oracle.ahf/data/Node1/diag/ahf/

[root@Node1tfa]#

To check version and status of TFA

tfactl print status
tfactl print version
tfactl print summary


[node1:root:/u02/oracle/12.1.0/grid/tfa/node1/tfa_home/bin:] ./tfactl print status
WARNING - TFA Software is older than 180 days. Please consider upgrading TFA to the latest version.

.--------------------------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID | Inventory Status |
+---------+---------------+----------+------+------------+----------------------+------------------+
| node1 | RUNNING | 11468966 | 5000 | 18.1.2.0.0 | 18120020180510233906 | COMPLETE |
'---------+---------------+----------+------+------------+----------------------+------------------'
[node1:root:/u02/oracle/12.1.0/grid/tfa/node1/tfa_home/bin:]




To start and stop TFA




$ /u01/app/12.2.0/grid/tfa/bin/tfactl start
Starting TFA..
start: Job is already running: oracle-tfa
Waiting up to 100 seconds for TFA to be started..
. . . . .
Successfully started TFA Process..
. . . . .
TFA Started and listening for commands

Stop Oracle Trace File Analyzer as follows:

Grid_home/tfa/bin/tfactl stop

For example:

$ /u01/app/12.2.0/grid/tfa/bin/tfactl stop
Stopping TFA from the Command Line
Stopped OSWatcher
TFA is running - Will wait 5 seconds (up to 3 times)
TFA-00518 Oracle Trace File Analyzer (TFA) is not running (stopped)
TFA Stopped Successfully
. . .
Successfully stopped TFA..


To collect TFA


. collect the TFA logs from problematic node

$GI_HOME/tfa/bin/tfactl diagcollect -from "MMM/dd/yyyy hh:mm:ss" -to "MMM/dd/yyyy hh:mm:ss"

Specify the "from time" to be 4 hours before and the "to time" to be 4 hours after the time of error (means after performed above steps==>(action plan)).

eg

./tfactl diagcollect -from "JUL/01/2020 00:01:01" -to "JUL/01/2020 12:01:01"


To uninstall TFA and troubleshoot

Can you attempt to reinstall AHF once again ( as root ) using the steps listed below :

1. Uninstall TFA on all nodes:
$TFA_HOME/bin/uninstalltfa
rm -rf $AHF_HOME
rm -rf $AHF_DATA_DIR
rm -rf /etc/oracle.ahf.loc

2. Download the latest AHF installer from MOS Note: 2550798.1 , stage and extract on node 1.

3. Install AHF from node 1:
./ahf_setup -debug -level 6

4. Wait for 5-10 minutes and the certificates should automatically generate and propagate. If this does not happen or you don't want to wait you can execute the following to regenerate the certs:
# tfactl syncnodes –regenerate

If AHF gets installed successfully , you can then attempt to gather a TFA DiagCollection using :
tfactl diagcollect -from "Apr/18/2020 20:00:00" -to "Apr/19/2020 10:00:00"

No comments:

Post a Comment