TFA is now optional with Oracle 12.2 RDBMS Installation

Trace File Analyzer is new utility which can be installed on the database nodes either stand alone or cluster nodes. In order to collect the diagnostics of 8 node for example, then we have to review alert log, listener logs whatever on all the nodes that become very lengthy procedure and also not easy to merge the information based on the all nodes. Hence Oracle introduced TFA – Trace file analyzer and this made easy job for DBA’s, TFA utility or bundle can be downloaded from MOS.

You can read more about it from the TFA white paper and it have all the information starting from architecture, installation and including the examples.

Now coming to the point, starting from 12.2 this bundle is included with RDBMS software and again this is optional when we run the root.sh script, still we can skip this if it’s not required. In this blog post especially we will see how to initiate the TFA when we run the root.sh of RDBMS.

[root@ora-ccrep app]# /home/app/oracle/product/12.2.0/db_1/root.sh
Performing root user operation.

The following environment variables are set as:
 ORACLE_OWNER= oracle
 ORACLE_HOME= /home/app/oracle/product/12.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
 Copying oraenv to /usr/local/bin ...
The contents of "coraenv" have not changed. No need to overwrite.
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.
Do you want to setup Trace File Analyzer(TFA) now ? yes|[no] :
yes
Installing Trace File Analyzer (TFA).
Log File: /home/app/oracle/product/12.2.0/db_1/install/root_ora-ccrep.localdomain_2017-03-25_20-55-26.log

Finished installing Trace File Analyzer (TFA)
[root@ora-ccrep app]#

If we crack the log file then we can see very much detailed information such as scanned trace directories, number of hosts and with the help preview.

[root@ora-ccrep app]# cat /home/app/oracle/product/12.2.0/db_1/install/root_ora-ccrep.localdomain_2017-03-25_20-55-26.log
Performing root user operation.

The following environment variables are set as:
 ORACLE_OWNER= oracle
 ORACLE_HOME= /home/app/oracle/product/12.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: Copying oraenv to /usr/local/bin ...
The contents of "coraenv" have not changed. No need to overwrite.

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.
Do you want to setup Trace File Analyzer(TFA) now ? yes|[no] :
Installing Trace File Analyzer (TFA).
Log File: /home/app/oracle/product/12.2.0/db_1/install/root_ora-ccrep.localdomain_2017-03-25_20-55-26.log
Finished installing Trace File Analyzer (TFA)
/home/app/oracle/product/12.2.0/db_1/jdk/jre
Running Auto Setup for TFA as user root...
Installing TFA now...
TFA Will be Installed on ora-ccrep...
TFA will scan the following Directories
++++++++++++++++++++++++++++++++++++++++++++
.-------------------------------------------------------------.
| ora-ccrep |
+--------------------------------------------------+----------+
| Trace Directory | Resource |
+--------------------------------------------------+----------+
| /home/app/oracle/product/12.2.0/db_1/cfgtoollogs | INSTALL |
| /home/app/oracle/product/12.2.0/db_1/install | INSTALL |
| /u01/app/oraInventory/ContentsXML | INSTALL |
| /u01/app/oraInventory/logs | INSTALL |
| /u01/app/oracle/cfgtoollogs | INSTALL |
| /u01/app/oracle/diag | RDBMS |
'--------------------------------------------------+----------'
Installing TFA on ora-ccrep:
HOST: ora-ccrep TFA_HOME: /u01/app/oracle/tfa/ora-ccrep/tfa_home
.------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID |
+-----------+---------------+-------+------+------------+----------------------+
| ora-ccrep | RUNNING | 95510 | 5000 | 12.2.0.1.0 | 12201020150924050034 |
'-----------+---------------+-------+------+------------+----------------------'
Running Inventory in All Nodes...
Enabling Access for Non-root Users on ora-ccrep...
Summary of TFA Installation:
.--------------------------------------------------------------.
| ora-ccrep |
+---------------------+----------------------------------------+
| Parameter | Value |
+---------------------+----------------------------------------+
| Install location | /u01/app/oracle/tfa/ora-ccrep/tfa_home |
| Repository location | /u01/app/oracle/tfa/repository |
| Repository usage | 0 MB out of 5681 MB |
'---------------------+----------------------------------------'
TFA is successfully installed...
Usage : /u01/app/oracle/tfa/bin/tfactl <command> [options]
<command> =
 start Starts TFA
 stop Stops TFA
 enable Enable TFA Auto restart
 disable Disable TFA Auto restart
 print Print requested details
 access Add or Remove or List TFA Users and Groups
 purge Delete collections from TFA repository
 directory Add or Remove or Modify directory in TFA
 host Add or Remove host in TFA
 receiver Add or Remove receiver in TFA
 diagcollect Collect logs from across nodes in cluster
 collection Manage TFA Collections
 analyze List events summary and search strings in alert logs.
 set Turn ON/OFF or Modify various TFA features
 ips Execute IPS (Incident Package Service) commands
 toolstatus Prints the status of TFA Support Tools
 run <tool> Run the desired support tool
 start <tool> Starts the desired support tool
 stop <tool> Stops the desired support tool
 uninstall Uninstall TFA from this node
 diagnosetfa Collect TFA Diagnostics
For help with a command: /u01/app/oracle/tfa/bin/tfactl <command> -help
[root@ora-ccrep app]#

How to check whether TFA is running or not?

This is simple by grepping the word “tfa” from host level as

[root@ora-ccrep app]# ps -ef|grep tfa
root 51613 4207 0 23:39 pts/0 00:00:00 grep --color=auto tfa
root 95261 1 0 20:56 ? 00:00:00 /bin/sh /etc/init.d/init.tfa run >/dev/null 2>&1 </dev/null
root 95510 1 0 20:56 ? 00:01:36 /home/app/oracle/product/12.2.0/db_1/jdk/jre/bin/java -Xms128m -Xmx512m -classpath /u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/RATFA.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/je-5.0.84.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/ojdbc5.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/commons-io-2.1.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/sigar/lib/sigar.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/kafka_2.9.2-0.8.1.1.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/scala-library-2.9.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/log4j-1.2.15.jar:/u01/app/oracle tfa/ora-ccrep/tfa_home/jlib/metrics-core-2.2.0.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/slf4j-api-1.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/tfar.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/zkclient-0.3.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/zookeeper-3.3.4.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-core-4.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-analyzers-common-4.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-queryparser-4.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-facet-4.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-queries-4.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-codecs-4.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-expressions-4.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/javax.json-1.0.4.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/javax.mail.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/activation.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-grouping-4.7.2.jar:/u01/app/oracle/tfa/ora-ccrep/tfa_home/jlib/lucene-highlighter-4.7.2.jar oracle.rat.tfa.TFAMain /u01/app/oracle tfa/ora-ccrep/tfa_home
[root@ora-ccrep app]#

Example of Collecting Diagnostic Data

We can access the list of commands using the “tfactl <command> -help“, in this example we will collect sample diagnostic data using TFA.

[root@ora-ccrep app]# /u01/app/oracle/tfa/bin/tfactl diagcollect
Collecting data for the last 24 hours for all components...
Multiple ADR basepaths were found, please select one or more...
. . .
. .
.
2017/03/25 23:14:08 IST : Waiting for collection of extra files
2017/03/25 23:14:17 IST : Completed collection of extra files...
2017/03/25 23:14:18 IST : Completed Zipping of all files
2017/03/25 23:14:18 IST : Cleaning up temporary files
2017/03/25 23:14:18 IST : Finished Cleaning up temporary files
2017/03/25 23:14:18 IST : Finalizing the Collection Zip File
2017/03/25 23:14:18 IST : Finished Finalizing the Collection Zip File
2017/03/25 23:14:18 IST : Total Number of Files checked : 288
2017/03/25 23:14:18 IST : Total Size of all Files Checked : 51MB
2017/03/25 23:14:18 IST : Number of files containing required range : 287
2017/03/25 23:14:18 IST : Total Size of Files containing required range : 51MB
2017/03/25 23:14:18 IST : Number of files trimmed : 1
2017/03/25 23:14:18 IST : Total Size of data prior to zip : 48MB
2017/03/25 23:14:18 IST : Saved 3.1MB by trimming files
2017/03/25 23:14:18 IST : Zip file size : 2.7MB
2017/03/25 23:14:18 IST : Total time taken : 21s
2017/03/25 23:14:18 IST : Completed collection of zip files.
Logs are being collected to: /u01/app/oracle/tfa/repository/collection_Sat_Mar_25_23_13_48_IST_2017_node_all
/u01/app/oracle/tfa/repository/collection_Sat_Mar_25_23_13_48_IST_2017_node_all/ora-ccrep.tfa_Sat_Mar_25_23_13_48_IST_2017.zip[root@ora-ccrep app]# ls -ltr /u01/app/oracle/tfa/repository/collection_Sat_Mar_25_23_13_48_IST_2017_node_all/ora-ccrep.tfa_Sat_Mar_25_23_13_48_IST_2017.zip
-rwx------ 1 root root 2774092 Mar 25 23:14 /u01/app/oracle/tfa/repository/collection_Sat_Mar_25_23_13_48_IST_2017_node_all/ora-ccrep.tfa_Sat_Mar_25_23_13_48_IST_2017.zip
[root@ora-ccrep app]#

This example is for the single node and the behavior same for even cluster nodes, Basically the daemons will be running on all the nodes and these daemons will collect the diagnostic information from all the files as consolidated compressed file for easy analysis and also helps to Oracle engineers for quick resolution(I Guess). 🙂