Oracle Trace File Analyzer
Oracle Trace File Analyzer
Overview
OR AC LE WHI TE P AP E R | M AY 2017
Table of Contents
Introduction 1
Supported Environments 2
Important Directories 3
Command Interfaces 5
Conclusion 16
It's not always easy. You've got to run the right tools, at the right time. If you're using Oracle Clusterware, then you have
to also collect from all the database nodes. You might need to use lots of different tools that you only ever use now and
again, and they each have their own syntax.
Once you've managed to get all the data, it can be huge. Only a fraction of what you've collected is useful, but who
knows which bit is relevant? That's if you were able to get everything. If you were quick enough before it was
overwritten.
In the meantime, you’ve still got a problem. This is costing your company money and you still need to get it fixed.
Oracle Trace File Analyzer helps you analyze and collect diagnostic data. This is a crucial step to resolving problems
that may occur with your Oracle Database.
It watches your logs for significant problems that may impact your service. If desired it can also automatically collect the
relevant diagnostics, when it sees these problems.
Oracle Trace File Analyzer knows what is relevant in log files. This allows it to trim them to the smallest size, yet still
gather everything necessary. It also collects data across cluster nodes and consolidates everything in one place.
Using important database diagnostic tools is easy with Oracle Trace File Analyzer. It hides the complexity by providing
a single interface and syntax to them all.
This all combines to ensure you can get exactly what you need, when you need it and save your business money.
Supported Environments
You can use Oracle Trace File Analyzer with all supported versions of:
» Oracle Database
» Oracle Clusterware
You may already have Oracle Trace File Analyzer installed. The Oracle Clusterware install shipped with Oracle Trace File Analyzer
since versions 11.2.0.4 and 12.1.0.2. However, this install does not include many of the database tools. Oracle releases new versions
of Oracle Trace File Analyzer several times a year. These new releases include new features and bug fixes. Ensure you get the latest
Oracle Trace File Analyzer with database support tools bundle, from Document 1513912.1
To install as root:
1. Download the appropriate Oracle Trace File Analyzer zip, copy to required machine and unzip.
2. Run the installTFA command:
$ ./installTFA<platform>
Cluster install requires passwordless ssh user equivalency for root to all cluster nodes. If not already configured the installation can set
this up and then remove again at the end. If you do not wish to use ssh, you can install on each host using a local install. Then use
tfactl syncnodes to generate and deploy the relevant SSL certificates.
The Cluster Ready Services (CRS) do not manage Oracle Trace File Analyzer. This is because it needs to be available should CR S go
down. The installation configures Oracle Trace File Analyzer for auto start. The implementation of auto start is platform dependent.
Linux uses init or an init replacement such as upstart or systemd. Microsoft Windows uses a Windows Service.
» Automatic collections
» Collections from remote hosts
» Collecting of files which are not readable by the ORACLE_HOME owner, e.g. /var/log/messages or certain clusterware daemon logs
To install as an ORACLE_HOME owner use the –extractto option. This tells Oracle Trace File Analyzer where to install to. Also use the
–javahome option to instruct which JRE to use. Use the JRE already available in the RDBMS home unless you have a later version
available.
The installation will prompt if you want to do a local or cluster install. If you select cluster install, it will be installed remotely on nodes of
the cluster. Alternatively you can perform a local install on each host. Then use tfactl syncnodes to generate and deploy the relevant
SSL certificates.
Important Directories
The location of the tfa_home and bin directory differs based on installation type. When installed with Oracle Clusterware the tfa_home
will be within the GRID_HOME directory.
Directory Description
tfa/bin Contains the command line interface tfactl ( tfactl is also in GRID_HOME/bin
directory if Oracle Clusterware is installed)
tfa/<node>/tfa_home/database Contains Berkeley database that stores data about the system
tfa/<node>/tfa_home/diagnostics_to_collect Place files in here to include them in the next collection, then have them
deleted afterwards
tfa/<node>/tfa_home/resources Contains resource files, for example the log masking control file
Oracle Trace File Analyzer runs a daemon on each cluster node, or single instance if you're not using Oracle Clusterware.
The tfactl command communicates with the local daemon. The local daemon then coordinates with all nodes.
The daemon on each node handles:
» Script execution
» Collection of diagnostics
» Trimming of log contents
The local daemon consolidates cluster wide collection output on the originating node
Automatic collection will perform a local only collection.
Oracle Trace File Analyzer discovers databases and cluster nodes on its own. Yet you can still manually add or remove them from the
configuration, if needed. See the user guide on Document 1513912.1 for a full list of command options.
The resource footprint is small. You will not usually be aware it is running. The only times Oracle Trace File Analyzer will consume
noticeable CPU are:
» When performing an inventory of diagnostic files
» During diagnostic collection
Command Interfaces
The tfactl tool functions as:
» Command line interface
» Shell interface
» Menu interface
Command line $ tfactl <command> Specify all command options at the command line
Shell interface $ tfactl Set and change context. Then run commands from within the shell
Menu Interface $ tfactl menu Select menu navigation options then choose the command you want to run
<mask_strings>
<mask_string>
<original>WidgetNode1</original>
<replacement>MyReplacementName</replacement>
</mask_string>
<mask_string>
<original>192.168.5.1</original>
<replacement>Node1-IP</replacement>
</mask_string>
</mask_strings>
or
All commands will apply cluster wide unless you specify -local to restrict to only the local node.
Command Description
Oracle Trace File Analyzer uses a flood control mechanism. Repeated errors do not flood the system with automatic collections.
When an event is first identified, this triggers the start point for a collection. 5 minutes later diagnostic gathering starts. This is to capture
any other relevant events together. If after 5 minutes events are still occurring, diagnostic collection continues to wait. It will wait for a
period of 30 seconds with no events occurring, up to a further 5 minutes.
If events are still occurring after 10 minutes, a diagnostic collection happens. A new collection point starts.
Once collection is complete TFA will send email notification to relevant people, including details of where the collection results are.
Automatic collections are ON by default. You can turn them OFF or back ON again with:
Use the Oracle Trace File Analyzer tools to perform analysis and resolve problems. If you need more help, use the tfactl command to
collect diagnostics for Oracle Support.
» Oracle Trace File Analyzer will collect all relevant log data from a time of your choosing
» It will trim logs files around the time, collecting only what is necessary for diagnosis
» Oracle Trace File Analyzer will package all diagnostics on the node where tfactl was run from
» Clusterware
» ASM
» Patch
» Listener
» OS
» Network
Summary is currently only supported on Linux
Usage:
The summary command provides an interface of its own allowing you to navigate the summary output.
Run with no options for default summary.
SUMMARY OPTIONS
Option Description
-json Outputs summary in json format as well as via the summary interface
-html Outputs summary in html format as well as via the summary interface
-node < local | node_name > Local or comma separated node name(s)
For example:
or
This will report all errors it finds over the specified duration.
You can also use Oracle Trace File Analyzer to find all occurrences of a specific error on any node. For example, this command will
search for ORA-00600 errors:
Tool Description
oswatcher Collects and archives OS metrics. These are useful for instance or node evictions & performance Issues. See document 301137.1 for more
details
procwatcher Automates & captures database performance diagnostics and session level hang information. See document 459694.1 for more details
oratop Provides near real-time database monitoring. See document 1500864.1 for more details.
sqlt Captures SQL trace data useful for tuning. See document 215187.1 for more details.
alertsummary Provides summary of events for one or more database or ASM alert files from all nodes
ls Lists all files Oracle Trace File Analyzer knows about for a given file name pattern, across all nodes
pstack Generates the process stack for the specified processes, across all nodes
grep Searches for a given string in the alert or trace files with a specified database
vi Opens alert or trace files for viewing a given database and file name pattern in the vi editor
tail Runs a tail on an alert or trace files for a given database and file name pattern
param Shows all database and OS parameters that match a specified pattern
dbglevel Sets and unsets multiple CRS trace levels with one command
changes Reports changes in the system setup over a given time period. This includes database parameters, OS parameters and patches applied
managelogs Shows disk space usage and purges ADR log and trace files
ps Finds processes
Tool Description
calog Reports major events from the Cluster Event log
changes Reports changes in the system setup over a given time period. This includes database parameters, OS parameters and patches applied
dir Lists all files Oracle Trace File Analyzer knows about for a given file name pattern, across all nodes
findstr Searches for a given string in the alert or trace files with a specified database
managelogs Shows disk space usage and purges ADR log and trace files
notepad Opens alert or trace files for viewing a given database and file name pattern in the notepad editor
param Shows all database and OS parameters that match a specified pattern
$ tfactl toolstatus
Each tool can be run using tfactl either in command line or shell mode.
The following example shows how to use tfactl in shell mode. It will start tfactl, connect to the database MyDB and run oratop:
$ tfactl
This will trim & collect all important log files updated in the past 12 hours across the whole cluster. Oracle Trace File Analyzer will store
collections in the repository directory. You can change the diagcollect timeframe with the option –last <n>h|d.
Oracle Support will often ask you to run a Service Request Data Collection (SRDC). The SRDC is dependent on the type of probl em
you experienced. It is a series of many data gathering instructions aimed at diagnosing your problem. Collecting the SRDC manually
can be difficult, with many different steps required.
Oracle Trace File Analyzer can run SRDC collections for you with a single command:
» ORACLE_HOME owner
» GRID_HOME owner
Enterprise Manager tablespace usage metric problems » emtbsmetrics Local only (on EM Agent target)
Enterprise Manager general metrics page or threshold problems » emmetricalert Local only (on EM Agent target & Repository DB)
Enterprise Manager debug log collection » emdebugon Local only (on EM Agent target & OMS)
Run emdebugon, reproduce the problem then run emdebugoff, » emdebugoff
which disables debug again and collects debug logs
What the SRDCs collect varies for each type, here are two examples:
ONE COMMAND SRDC AND COLLECTIONS
Oracle Trace File Analyzer will prompt you to enter the information it needs based on the SRDC type.
For example, this is what happens when you run the ora4031 SRDC:
$ tfactl diagcollect –srdc <srdc_type> -database <db> -from "<date> <time>" -to "<date> <time>"
Change Clusterware Trace Levels
Oracle Support may ask you to enable certain trace levels when reproducing a problem. This is to allow you to collect enough
diagnostics to diagnose the cause of the problem.
Oracle Trace File Analyzer makes it easy to enable and then disable the correct trace levels. Use dbglevel.
You can find the required trace level settings grouped by problem trace profiles. To set a trace profile use:
Applying standard PSUs will automatically update Oracle Trace File Analyzer. However the PSU version does not contain the rest of
the Database Support Tools Bundle updates. So if you want the latest and greatest version of Oracle Trace File Analyzer with the
database support tools bundle download it from Document 1513912.1
Upgrading is similar to first time install. As root use the installTFA<platform> script. If Oracle Trace File Analyzer is already installed, it
will update the existing installation. When already installed, a cluster upgrade does not need ssh. The cluster upgrade uses the existing
daemon secure socket communication between hosts.
$ ./installTFA<platform>
If you're not able to install as root then install as the ORACLE_HOME owner. Use the -extractto and –javahome options:
If something does go wrong, Oracle Trace File Analyzer helps you analyze and collect what you need, to fix it.
For more information and to download Oracle Trace File Analyzer see Document 1513912.1.
C ON N E C T W I TH U S
blogs.oracle.com/oracle
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the
contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other
facebook.com/oracle warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or
fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are
formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any
twitter.com/oracle means, electronic or mechanical, for any purpose, without our prior written permission.
oracle.com Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and
are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are
trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0517