Oracle GI 日志收集工具 - TFA 简介

简介:

转载自:https://blogs.oracle.com/Database4CN/entry/tfa_collector_%E4%BB%8B%E7%BB%8D

 

1.TFA的目的:

 

TFA是个11.2版本上推出的用来收集Grid Infrastructure/RAC环境下的诊断日志的工具,它可以用非常简单的命令协助用户收集RAC里的日志,以便进一步进行诊断;TFA是类似diagcollection的一个oracle 集群日志收集器,而且TFA比diagcollection集中和自动化的诊断信息收集能力更强大。TFA有以下几个特点:

1.    TFA可以在一台机器上执行一条简单的命令把所有节点的日志进行打包,封装;
2.    TFA可以在收集的过程中对日志进行”trim”操作,减少数据的收集量;
3.    TFA可以收集用来诊断用的“一段时间内”的数据;
4.    TFA可以把所有节点的日志收集并封装好放在某一个节点上以便传输阅读;
5.    TFA可以指定Cluster中的某一部分组件进行日志收集,如:ASM ,RDBMS,Clusterware
6.    TFA可以根据条件配置对告警日志进行实时扫描(DB Alert Logs, ASM Alert Logs, Clusterware Alert Logs, etc);
7.    TFA可以根据实时扫描的结果自动的收集诊断日志;
8.    TFA可以根据指定的错误进行对告警日志的扫描;
9.    TFA可以根据指定的错误扫描后的结果收集诊断日志;

 

 

 

2.    TFA的安装要求:

平台:


目前TFA支持以下几种平台:    
Intel Linux(Enterprise Linux, RedHat Linux, SUSE Linux)
Linux Itanium
Oracle Solaris SPARC
Oracle Solaris x86-64
AIX (requires bash shell version 3.2 or higher installed)
HPUX Itanium
HPUX PA-RISC

3.支持的数据库版本:


TFA目前的设计是脱离RDBMS和CRS进行设计的,所以设计的初衷是针对所有的版本而设计的,不受RDBMS或者CRS的版本限制;

下载 TFA Collector:

该版本的TFA和相关TFA用户指南可以通过点击下面的相关下载链接。

 



TFA 收集器:

https://mosemp.us.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1513912.2:TFA_NOJRE&clickstream=no

 

TFA 用户手册:

 

https://mosemp.us.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1513912.2:TFA_USER_GUIDE&clickstream=no

4.    TFA快速安装指南:

安装:

注意:在安装之前请确保您的环境上已经安装了JRE1.6或者是更高版本的JRE,如果没有,请先安装JRE1.6
1.    请使用root用户登录系统
2.    在所有的节点上为TFA准备一个安装的位置,注意这个位置不要放在Cluster file system中;
3.    在节点1上执行installTFALite.sh来启动安装过程:
---------------------------------
[root@rac1 tmp]# ./installTFALite.sh
Starting TFA installation
---------------------------------

 

备注: 最新版本的TFA已经把installTFALite.sh修改成了installTFALite,安装的时候可以直接执行installTFALite,并且可以指定TFA BASE和JAVA_HOME

 

4.    当系统提示安装位置,输入在第2步中选择的位置的TFA安装,:
---------------------------------
Enter a location for installing TFA [/opt/oracle/tfa]:/opt/oracle/tfa
Checking for available space in /opt/oracle/tfa/
---------------------------------
5.    请输入之前安装了JRE1.6的JAVA_HOME,注意这个位置需要在所有的节点上都相同:
---------------------------------
Enter a Java Home that contains Java 1.6 or later : /usr/java/jre1.7.0_11
Running Auto Setup for TFA as user root...
---------------------------------
6.    按照以下说明完成安装:
------------------------------------------------------------------
Would you like to do a [L]ocal only or [C]lusterwide installation ? [L|l|C|c] [C] :
The following installation requires temporary use of SSH.
If SSH is not configured already then we will remove SSH
when complete.
  Do you wish to Continue ? [Y|y|N|n] [N] Y
Installing TFA at /opt/oracle/tfa in all hosts
Discovering Nodes and Oracle resources
Checking whether CRS is up and running

Getting list of nodes in cluster

Checking ssh user equivalency settings on all nodes in cluster

Node rac2 is configured for ssh user equivalency for root user


Searching for running databases . . . . .

.
List of running databases registered in OCR
1. ORCL
. .

Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

TFA Will be Installed on the Following Nodes
++++++++++++++++++++++++++++++++++++++++++++

Install Nodes
=============
rac1
rac2
Do you wish to make changes to the Node List ? [Y/y/N/n] [N]

TFA will scan the following Directories
++++++++++++++++++++++++++++++++++++++++++++

.----------------------------------------------------------------.
|                             rac2                               |
+-----------------------------------------------------+----------+
| Trace Directory                                     | Resource |
+-----------------------------------------------------+----------+
| /u01/app/11.2.0/grid/cfgtoollogs                    | INSTALL  |
| /u01/app/11.2.0/grid/crs/log                        | CRS      |
| /u01/app/11.2.0/grid/css/log                        | CRS      |
| /u01/app/11.2.0/grid/cv/log                         | CRS      |
| /u01/app/11.2.0/grid/evm/admin/log                  | CRS      |
| /u01/app/11.2.0/grid/evm/admin/logger               | CRS      |
| /u01/app/11.2.0/grid/evm/log                        | CRS      |
| /u01/app/11.2.0/grid/install                        | INSTALL  |
| /u01/app/11.2.0/grid/log/                           | CRS      |
| /u01/app/11.2.0/grid/network/log                    | CRS      |
| /u01/app/11.2.0/grid/oc4j/j2ee/home/log             | CRSOC4J  |
| /u01/app/11.2.0/grid/opmn/logs                      | CRS      |
| /u01/app/11.2.0/grid/racg/log                       | CRS      |
| /u01/app/11.2.0/grid/rdbms/log                      | ASM      |
| /u01/app/11.2.0/grid/scheduler/log                  | CRS      |
| /u01/app/11.2.0/grid/srvm/log                       | CRS      |
| /u01/app/oraInventory/ContentsXML                   | INSTALL  |
| /u01/app/oraInventory/logs                          | INSTALL  |
| /u01/app/oracle/cfgtoollogs                         | CFGTOOLS |
| /u01/app/oracle/diag/asm/+asm/+ASM2/trace           | ASM      |
| /u01/app/oracle/diag/rdbms/orcl/ORCL2/trace         | RDBMS    |
| /u01/app/oracle/diag/tnslsnr                        | TNS      |
| /u01/app/oracle/diag/tnslsnr/rac2/listener/trace    | TNS      |
| /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs | INSTALL  |
| /u01/app/oracle/product/11.2.0/dbhome_1/install     | INSTALL  |
'-----------------------------------------------------+----------'

.----------------------------------------------------------------.
|                             rac1                               |
+-----------------------------------------------------+----------+
| Trace Directory                                     | Resource |
+-----------------------------------------------------+----------+
| /u01/app/11.2.0/grid/cfgtoollogs                    | INSTALL  |
| /u01/app/11.2.0/grid/crs/log                        | CRS      |
| /u01/app/11.2.0/grid/css/log                        | CRS      |
| /u01/app/11.2.0/grid/cv/log                         | CRS      |
| /u01/app/11.2.0/grid/evm/admin/log                  | CRS      |
| /u01/app/11.2.0/grid/evm/admin/logger               | CRS      |
| /u01/app/11.2.0/grid/evm/log                        | CRS      |
| /u01/app/11.2.0/grid/install                        | INSTALL  |
| /u01/app/11.2.0/grid/log/                           | CRS      |
| /u01/app/11.2.0/grid/network/log                    | CRS      |
| /u01/app/11.2.0/grid/oc4j/j2ee/home/log             | CRSOC4J  |
| /u01/app/11.2.0/grid/opmn/logs                      | CRS      |
| /u01/app/11.2.0/grid/racg/log                       | CRS      |
| /u01/app/11.2.0/grid/rdbms/log                      | ASM      |
| /u01/app/11.2.0/grid/scheduler/log                  | CRS      |
| /u01/app/11.2.0/grid/srvm/log                       | CRS      |
| /u01/app/oraInventory/ContentsXML                   | INSTALL  |
| /u01/app/oraInventory/logs                          | INSTALL  |
| /u01/app/oracle/cfgtoollogs                         | CFGTOOLS |
| /u01/app/oracle/diag/asm/+asm/+ASM1/trace           | ASM      |
| /u01/app/oracle/diag/rdbms/orcl/ORCL1/trace         | RDBMS    |
| /u01/app/oracle/diag/tnslsnr                        | TNS      |
| /u01/app/oracle/diag/tnslsnr/rac1/listener/trace    | TNS      |
| /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs | INSTALL  |
| /u01/app/oracle/product/11.2.0/dbhome_1/install     | INSTALL  |
'-----------------------------------------------------+----------'

Do you wish to change the Trace Directory List ? [Y/y/N/n] [N]
Installing TFA on rac1
Installing TFA on rac2
TFA is running
Successfully added host: rac2
.--------------------------------.
| Host   | Status of TFA | PID   |
+--------+---------------+-------+
| rac1 | RUNNING         | 11685 |
| rac2 | RUNNING         |  5081 |
'--------+---------------+-------'
Setting TFA cookie in all nodes
Successfully set cookie=77411b8fff446d2954d5c080225052ac
TFA Cookie: 77411b8fff446d2954d5c080225052ac
Summary of TFA Installation
.-----------------------------------------------------------.
|                           rac1                            |
+---------------------+-------------------------------------+
| Parameter           | Value                               |
+---------------------+-------------------------------------+
| Install location    | /opt/oracle/tfa/tfa_home            |
| Repository location | /opt/oracle/tfa/tfa_home/repository |
| Repository usage    | 0 MB out of 10240 MB                |
'---------------------+-------------------------------------'

.-----------------------------------------------------------.
|                           rac2                            |
+---------------------+-------------------------------------+
| Parameter           | Value                               |
+---------------------+-------------------------------------+
| Install location    | /opt/oracle/tfa/tfa_home            |
| Repository location | /opt/oracle/tfa/tfa_home/repository |
| Repository usage    | 0 MB out of 10240 MB                |
'---------------------+-------------------------------------'

TFA is successfully installed..
------------------------------------------------------------------

4.TFA启动和停止:

TFA运行在Linux和Unix平台上的init,所以,这将是在服务器启动时自动启动。
默认的情况我们把这个脚本命名为init.tfa;
所在位置取决于不同平台,如:
Linux and Solaris: /etc/init.d/init.tfa
Aix: /etc/init.tfa
HP-UX: /sbin/init.d/init.tfa
以下命令式在Linux平台下作为例子:
启动:
# /etc/init.d/init.tfa start
停止:
# /etc/init.d/init.tfa stop
重启:
# /etc/init.d/init.tfa restart

5.手动收集诊断信息:

我们通过调用tfactl的命令和诊断动词diagnostic来控制TFA收集我们期望的诊断信息。Tfactl 提供给用户多种可选择的模式进行收集,如 ,收集一个时间段内的日志信息来减少我们收集日志的量;
具体操作的命令您可以通过以下方式看到:
--------------------------------------------------------------
#$TFA_HOME/bin/tfactl diagcollect -h
Usage: /u01/app/tfa/tfa_home/bin/tfactl diagcollect [-all | -database | -asm | -crs | -os | -install | -node | -tag ]
        [-since <n><h|d>| -from <time> -to <time> | -for <time>]
        [-copy | -nocopy] [-symlink][-notrim]

Options:
  -all       Collect logs of all types
  -crs        Collect only CRS logs
  -asm        Collect only ASM logs
  -database  Collect only database logs from databases specified
  -os         Collect only OS files
  -install    Collect only INSTALL files
  -node       Specify comma separated list of host names for collection.
  -copy       Copy back the zip files to master node from all nodes
  -nocopy    Does not copy back the zip files to master node from all nodes
  -notrim     Does not trim the files collected
  -symlink    This option should be used with -for.
              Creates symlinks for files which are updated during the input time.
  -since <n><h|d>   Files from past 'n' [d]ays or 'n' [h]ours
  -from <time>        From time
  -to <time>         To time
  -for <time>        Specify a incident time.
  -z <file>           Output file name
  -tag <description>  Enter a tag for the zip(s) created

--------------------------------------------------------------

 

在下面的例子中,我们使用了 -all,并���诉TFA收集诊断所有类型的日志,从午夜1月21日至1月21日13:00 进行收集。该命令将启动指定的诊断在后台收集所有群集节点上,压缩成zip文件放置在每个节点的TFA_HOME中:

 

--------------------------------------------------------------

 

# $TFA_HOME/bin/tfactl diagcollect -all -from "Jan/21/2013" -to "Jan/21/2013 13:00:00"

 

time: Jan/21/2013
Valid pattern
Month : 1
time: Jan/21/2013 13:00:00
Valid pattern
Month : 1
rac1:startdiagcollection: -database -asm -crs -os -install -from Jan/21/2013 -to Jan/21/2013 13:00:00 -z Mon_Jan_21_11_52_20_EST_2013 -node all -copy
Logs are collected to:
/opt/oracle/tfa/tfa_home/repository/rac1.Mon_Jan_21_11_52_20_EST_2013.zip
/opt/oracle/tfa/tfa_home/repository/rac2.Mon_Jan_21_11_52_20_EST_2013.zip
--------------------------------------------------------------

 


6.诊断问题or上传诊断信息给Oracle Support工程师:

无论我们用哪种方法对诊断信息进行收集,日志信息都会被打包好放置在$TFA_HOME/repository的目录下,以便您上传该文件给Oracle的support工程师

7.推荐参考文档:

 

TFA Collector- The Preferred Tool for Automatic or ADHOC Diagnostic Gathering Across All Cluster Nodes [ID 1513912.2]
便捷的日志收集和分析工具TFA

 


本文转自 张冲andy 博客园博客,原文链接: http://www.cnblogs.com/andy6/p/5759317.html  ,如需转载请自行联系原作者


相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
相关文章
|
4天前
|
Linux 应用服务中间件 PHP
性能工具之linux常见日志统计分析命令
通过本文的介绍,我相信同学们一定会发现 linux三剑客强大之处。在命令行中,它还能够接受,和执行外部的 AWK 程序文件,可以对文本信息进行非常复杂的处理,可以说“只有想不到的,没有它做不到的。
60 1
|
4天前
|
SQL Oracle 关系型数据库
oracle11g SAP测试机归档日志暴增排查(二)
oracle11g SAP测试机归档日志暴增排查(二)
19 1
|
4天前
|
Oracle 关系型数据库 Shell
oracle11g SAP测试机归档日志暴增排查(一)
oracle11g SAP测试机归档日志暴增排查(一)
14 1
|
2天前
|
SQL Oracle 关系型数据库
实时计算 Flink版产品使用合集之在读取Oracle归档日志时出现日志数量大幅增加的情况如何解决
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
11 1
|
4天前
|
数据可视化
R语言两阶段最小⼆乘法2SLS回归、工具变量法分析股息收益、股权溢价和surfaces曲面图可视化
R语言两阶段最小⼆乘法2SLS回归、工具变量法分析股息收益、股权溢价和surfaces曲面图可视化
|
4天前
|
监控 Linux 开发者
【专栏】`head`命令是Linux系统中用于快速查看文件开头内容的工具,常用于处理日志文件
【4月更文挑战第28天】`head`命令是Linux系统中用于快速查看文件开头内容的工具,常用于处理日志文件。基本用法包括指定查看行数(如`head -n 10 file.txt`)和与其他命令(如`grep`)结合使用。高级用法涉及动态查看日志、过滤内容、管道操作及在脚本中的应用。实际应用案例包括监控系统日志、排查错误和分析应用日志。使用时注意文件存在性、行数选择及权限问题。熟练掌握head命令能提升工作效率,结合其他工具可实现更多功能,助力Linux用户提升技能。
|
4天前
|
运维 Oracle 关系型数据库
Oracle日志文件:数据王国的“记事本”
【4月更文挑战第19天】Oracle日志文件是数据库稳定运行的关键,记录数据变更历史,用于恢复和故障处理。它们协调并发操作,确保数据一致性和完整性。日志文件实时写入操作信息并定期刷新到磁盘,便于数据恢复。然而,日志文件需备份和归档以保证安全性,防止数据丢失。日志文件,数据王国的“记事本”,默默守护数据安全。
|
4天前
|
存储 Oracle 关系型数据库
Oracle的段:深入数据段与日志段的奥秘
【4月更文挑战第19天】Oracle数据库中的数据段和日志段是存储管理的核心。数据段存储表和索引的实际数据,随数据增长动态调整;日志段记录变更历史,保障数据完整性和恢复。两者协同工作,确保数据库稳定性和并发控制。了解和优化它们的配置能提升数据库性能和可靠性,为业务发展提供支持。
|
4天前
工具变量法(两阶段最小二乘法2SLS)线性模型分析人均食品消费时间序列数据和回归诊断2
工具变量法(两阶段最小二乘法2SLS)线性模型分析人均食品消费时间序列数据和回归诊断
|
4天前
|
机器学习/深度学习 前端开发 数据挖掘
R语言计量经济学:工具变量法(两阶段最小二乘法2SLS)线性模型分析人均食品消费时间序列数据和回归诊断
R语言计量经济学:工具变量法(两阶段最小二乘法2SLS)线性模型分析人均食品消费时间序列数据和回归诊断