TFA
TFA是Trace File Analyzer(跟踪文件分析器)的缩写。由于之前介绍的diagcollection.pl工具存在一些缺陷,例如:只能在本地节点搜集信息,搜集到的信息经常很多,无法根据需要进行客制化的信息搜集,所以,Oracle推出了新的信息搜集和分析工具TFA。我们可以认为TFA是之前介绍的diagcollection.pl工具的增强版。相对于diagcollection.pls,TFA具有以下的优点:
1)TFA可以在一个节点上运行,搜集所有节点的日志并打包,之后保存在集群的一个节点上,方便分析。
2)TFA在收集日志的过程中可以进行剪裁,减少收集的数据量。
3)TFA可以根据需要搜集某个时间段内的诊断信息。
4)TFA可以根据需要搜集集群某一个或多个组件的诊断信息,例如:ASM、RDBMS、Clusterware等。
5)TFA可以对集群的诊断日志(例如,数据库alert.log、GI alert.log)进行实时扫描,搜集实时诊断信息。
6)TFA可以针对特定的错误搜集诊断信息。
7)TFA支持大部分的操作系统平台(Linux、Solaris、AIX、HP-UX),而且不受数据库版本的限制。
diagcollect
$tfactl diagcollect -help
Collect logs from across nodes in cluster
Usage : /opt/oracle.ahf/tfa/bin/tfactl diagcollect [ [component_name1] [component_name2] ... [component_nameN] | [-srdc <srdc_profile>] | [-defips]] [-sr <SR#>] [-node <all|local|n1,n2,..>] [-tag <tagname>] [-z <filename>] [-acrlevel <system,database,userdata>] [-last <n><m|h|d>| -from <time> -to <time> | -for <time>] [-nocopy] [-notrim] [-silent] [-cores][-collectalldirs][-collectdir <dir1,dir2..>][-collectfiles <file1,..,fileN,dir1,..,dirN> [-onlycollectfiles]][-examples]
components:-ips|-database|-asm|-crsclient|-dbclient|-dbwlm|-tns|-rhp|-procinfo|-cvu|-afd|-crs|-cha|-wls|-emagenti|-emagent|-oms|-omsi|-ocm|-emplugins|-em|-acfs|-install|-cfgtools|-os|-ashhtml|-ashtext|-awrhtml|-awrtext|-sosreport|-qos|-ahf|-dataguard
-srdc Service Request Data Collection (SRDC).
-database Specify comma separated list of db unique names for collection
-defips Include in the default collection the IPS Packages for:
ASM, CRS and Databases
-sr Enter SR number to which the collection will be uploaded
-node Specify comma separated list of host names for collection
-tag <tagname> The files will be collected into tagname directory inside
repository
-z <zipname> The collection zip file will be given this name within the
TFA collection repository
-last <n><m|h|d> Files from last 'n' [m]inutes, 'n' [d]ays or 'n' [h]ours
-since Same as -last. Kept for backward compatibility.
-from "Mon/dd/yyyy hh:mm:ss" From <time>
or "yyyy-mm-dd hh:mm:ss"
or "yyyy-mm-ddThh:mm:ss"
or "yyyy-mm-dd"
-to "Mon/dd/yyyy hh:mm:ss" To <time>
or "yyyy-mm-dd hh:mm:ss"
or "yyyy-mm-ddThh:mm:ss"
or "yyyy-mm-dd"
-for "Mon/dd/yyyy" For <date>.
or "yyyy-mm-dd"
-nocopy Does not copy back the zip files to initiating node from all nodes
-notrim Does not trim the files collected
-silent This option is used to submit the diagcollection as a background
process
-cores Collect Core files when it would normally not have been
collected
-collectalldirs Collect all files from a directory marked "Collect All"
flag to true
-collectdir Specify a comma separated list of directories and the collection will
include all files from these irrespective of type and time constraints
in addition to the components specified
-collectfiles Specify a comma separated list of files/directories and the collection will
include the files and directories in addition to the components specified.
if -onlycollectfiles is also used, then no other components will be collected.
-acrlevel <system,database,userdata> This option is used to specify the ACR level(s) for redaction
-examples Show diagcollect usage examples
For detailed help on each component use:
/opt/oracle.ahf/tfa/bin/tfactl diagcollect [component_name1] [component_name2] ... [component_nameN] -help
收集某个时间段
#tfactl diagcollect -all -from "Jun/5/2022 12:00:00" -to "Jun/6/2022 12:30:00"
Collecting data for all components using above parameters...
Collecting data for all nodes
Scanning files from Jun/5/2022 12:00:00 to Jun/6/2022 12:30:00
Collection Id : 20220606162826qone2
Repository Location in qone2 : /opt/ogrid/tfa/repository
Collection monitor will wait up to 60 seconds for collections to start
2022/06/06 16:28:29 CST : NOTE : Any file or directory name containing the string .com will be renamed to replace .com with dotcom
2022/06/06 16:28:29 CST : Collection Name : tfa_Mon_Jun_6_16_28_26_CST_2022.zip
2022/06/06 16:28:29 CST : Scanning of files for Collection in progress...
2022/06/06 16:28:29 CST : Collecting extra files...
2022/06/06 16:29:04 CST : Getting list of files satisfying time range [06/05/2022 12:00:00 CST, 06/06/2022 12:30:00 CST]
2022/06/06 16:29:04 CST : Starting Thread to identify stored files to collect
2022/06/06 16:29:04 CST : Getting List of Files to Collect
2022/06/06 16:29:06 CST : Finished Getting List of Files to Collect
2022/06/06 16:29:11 CST : qone2: Zipped 100 Files so Far
2022/06/06 16:29:13 CST : qone2: Zipped 200 Files so Far
2022/06/06 16:29:13 CST : qone2: Zipped 300 Files so Far
2022/06/06 16:29:20 CST : qone2: Zipped 400 Files so Far
2022/06/06 16:29:28 CST : Collecting ADR incident files...
2022/06/06 16:29:28 CST : Waiting for collection of extra files
2022/06/06 16:30:37 CST : Completed collection of extra files...
2022/06/06 16:30:38 CST : Completed Zipping of all files
2022/06/06 16:30:38 CST : Cleaning up temporary files
2022/06/06 16:30:38 CST : Finished Cleaning up temporary files
2022/06/06 16:30:38 CST : Finalizing the Collection Zip File
2022/06/06 16:30:38 CST : Finished Finalizing the Collection Zip File
2022/06/06 16:30:38 CST : Total Number of Files checked : 11382
2022/06/06 16:30:38 CST : Total Size of all Files Checked : 13GB
2022/06/06 16:30:38 CST : Number of files containing required range : 481
2022/06/06 16:30:38 CST : Total Size of Files containing required range : 1GB
2022/06/06 16:30:38 CST : Number of files trimmed : 0
2022/06/06 16:30:38 CST : Total Size of data prior to zip : 1GB
2022/06/06 16:30:38 CST : Saved 0kB by trimming files
2022/06/06 16:30:38 CST : Zip file size : 75MB
2022/06/06 16:30:38 CST : Total time taken : 129s
2022/06/06 16:30:38 CST : Completed collection of zip files.
Logs are being collected to: /opt/ogrid/tfa/repository/collection_Mon_Jun_6_16_28_26_CST_2022_node_all
/opt/ogrid/tfa/repository/collection_Mon_Jun_6_16_28_26_CST_2022_node_all/qone2.tfa_Mon_Jun_6_16_28_26_CST_2022.zip
#cat qone2.tfa_Mon_Jun_6_16_28_26_CST_2022.zip.txt
TFA Version : 12.1.2.8.4
Build ID : 12128420170203230512
Collection ID : 20220606162826qone2
Zip file name : tfa_Mon_Jun_6_16_28_26_CST_2022.zip
Zip file location : /opt/ogrid/tfa/repository/collection_Mon_Jun_6_16_28_26_CST_2022_node_all/qone2.tfa_Mon_Jun_6_16_28_26_CST_2022.zip
Zip file creation date : Mon Jun 06 2022 16:28:29 CST
Host name : qone2
Duration of Diagnostics :
Start date : Sun Jun 05 2022 12:00:00 CST
End date : Mon Jun 06 2022 12:30:00 CST
Component(s) in zip file : CFGTOOLS TNS CRS OCM INSTALL EMPLUGINS OMS RDBMS WLS ASM EM EMAGENT ACFS DBWLM OS ASMPROXY SUNDIAG CHMOS
User initiated
Directory Structure in zip file :
qone2/
qone2/rdbms/shoedb/shoedb2/trace
qone2/rdbms/onedb/onedb_1/trace
qone2/rdbms/yangwb/yangwb2/trace
qone2/opt/grid/products/11.2.0/log/qone2/cssd
qone2/rdbms/caiheng/caiheng2/trace
qone2/opt/ogrid/tfa/repository/suptools/qone2/oswbb/grid/archive
qone2/opt/grid/products/11.2.0/opmn/logs
qone2/opt/grid/products/11.2.0/cfgtoollogs
qone2/opt/grid/products/11.2.0/cv/log
qone2/rdbms/chenmm/chenmm2/trace
qone2/var/log
qone2/rdbms/prod/prod2/trace
qone2/opt/grid/products/11.2.0/rdbms/log
qone2/opt/grid/products/11.2.0/log/qone2/acfs
qone2/opt/oracle/products/11.2.0/cfgtoollogs
qone2/rdbms/onedb/onedb_2/trace
qone2/opt/grid/products/11.2.0/log/qone2
qone2/tnslsnr/qone2/listener/trace
qone2/oswbb/oswbb/archive
qone2/rdbms/baipx/baipx2/trace
qone2/rdbms/yxdb/yxdb2/trace
qone2/opt/grid/products/11.2.0/oc4j/j2ee/home/log
qone2/asm/+asm/+ASM2
qone2/opt/grid/products/11.2.0/log/qone2/client
qone2/opt/grid/products/11.2.0/evm/log
qone2/asm/+asm/+ASM2/trace
qone2/rdbms/wfy/wfy2/trace
qone2/asmcmd/user_root/qone2
qone2/opt/grid/products/11.2.0/log/qone2/agent
To check full contents of the zip file, Please run "unzip -l <zipfile>"