TFA一般主要用于Oracle RAC环境一键收集需要的日志进行分析问题,解决传统人工收集集群、数据库等各类日志效率低下的问题。具体关于TFA的介绍,网上资料已经非常多,在此不再赘述。

TFA的安装也非常简单,从MOS(Autonomous Health Framework (AHF) - Including TFA and ORAchk/EXAChk (Doc ID 2550798.1) )下载最新的稳定版

TFA & ORAchk/EXAchk 20.1 for Linux,对应介质为:AHF-LINUX_v20.1.3.zip,解压后运行ahf_setup即可完成安装。

1.官方说明文档

安装包中README.txt内容如下:

Oracle Autonomous Health Framework (AHF) - with ORAchk, EXAchk & Trace File Analyzer
------------------------------------------------------------------------------------ Installation Instructions
-------------------------
This must be completed for each node of a cluster. 1) Copy the zip file to a target machine and unzip
2) Run the command: ahf_setup For advanced installation options see the User Guide User Guide:
---------------
The AHF User Guide can now be found online at https://docs.oracle.com/en/engineered-systems/health-diagnostics/autonomous-health-framework/ahfug/index.html Enhancements and Bug Fixes
--------------------------
A full list of enhancements and bugs fixed in each release is available at:
https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=2550798.1:AHF_VERSION_HISTORY

2.测试安装遇到问题

我在自己一套RHEL7.3 + Oracle 11.2.0.4 RAC的环境进行安装,结果过程中遇到错误:

Extracting AHF to /opt/oracle.ahf
Can't locate Data/Dumper.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /opt/oracle.ahf/tfa/bin /opt/oracle.ahf/tfa/bin/common /opt/oracle.ahf/tfa/bin/modules /opt/oracle.ahf/tfa/bin/common/exceptions) at /opt/oracle.ahf/tfa/bin/common/tfactlshare.pm line 1350, <F1> line 1.
BEGIN failed--compilation aborted at /opt/oracle.ahf/tfa/bin/common/tfactlshare.pm line 1350, <F1> line 1.
Compilation failed in require at /opt/oracle.ahf/tfa/bin/tfasetup.pl line 107, <F1> line 1.
BEGIN failed--compilation aborted at /opt/oracle.ahf/tfa/bin/tfasetup.pl line 107, <F1> line 1. Failed to start TFA Services

这导致最终TFA没有真正安装成功,去查看TFA状态或尝试启动TFA都会报相同错误:

[root@db01 bin]# tfactl start
TFA scheduler is not running
[root@db01 bin]# which tfactl
/usr/bin/tfactl
[root@db01 bin]# tfactl stop
TFA scheduler is not running

实际查询,是因为系统缺少包导致,需要yum install 'perl(Data::Dumper)'各节点安装,以节点1为例:

[root@db01 bin]# yum install 'perl(Data::Dumper)'
..省略部分输出..
Installed:
perl-Data-Dumper.x86_64 0:2.145-3.el7 Complete!

3.重新尝试安装TFA

再次尝试安装TFA,需要在各节点手工删除之前的安装路径,以节点1为例:

[root@db01 tmp]# rm -rf /opt/oracle.ahf/
[root@db01 tmp]# rm -rf /opt/app/grid/oracle.ahf/

注意:注意选择你自己安装TFA的路径。

安装TFA:

[root@db01 tmp]# ./ahf_setup 

AHF Installer for Platform Linux Architecture x86_64

AHF Installation Log : /tmp/ahf_install_9681_2020_06_25-17_50_19.log

Starting Autonomous Health Framework (AHF) Installation

AHF Version: 20.1.3 Build Date: 202004290950

Default AHF Location : /opt/oracle.ahf

Do you want to install AHF at [/opt/oracle.ahf] ? [Y]|N : Y

AHF Location : /opt/oracle.ahf

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. /opt/app/grid [Free Space : 27037 MB]
2. Enter a different Location Choose Option [1 - 2] : 1 AHF Data Directory : /opt/app/grid/oracle.ahf/data Do you want to add AHF Notification Email IDs ? [Y]|N : Enter Email IDs separated by space : xxdba@xx.com AHF will also be installed/upgraded on these Cluster Nodes : 1. db02 The AHF Location and AHF Data Directory must exist on the above nodes
AHF Location : /opt/oracle.ahf
AHF Data Directory : /opt/app/grid/oracle.ahf/data Do you want to install/upgrade AHF on Cluster Nodes ? [Y]|N : Y Extracting AHF to /opt/oracle.ahf Configuring TFA Services Discovering Nodes and Oracle Resources Not generating certificates as GI discovered Starting TFA Services
Created symlink from /etc/systemd/system/multi-user.target.wants/oracle-tfa.service to /etc/systemd/system/oracle-tfa.service.
Created symlink from /etc/systemd/system/graphical.target.wants/oracle-tfa.service to /etc/systemd/system/oracle-tfa.service. .-------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID |
+------+---------------+-------+------+------------+----------------------+
| db01 | RUNNING | 10850 | 5000 | 20.1.3.0.0 | 20130020200429095054 |
'------+---------------+-------+------+------------+----------------------' Running TFA Inventory... Adding default users to TFA Access list... .------------------------------------------------------------.
| Summary of AHF Configuration |
+-----------------+------------------------------------------+
| Parameter | Value |
+-----------------+------------------------------------------+
| AHF Location | /opt/oracle.ahf |
| TFA Location | /opt/oracle.ahf/tfa |
| Orachk Location | /opt/oracle.ahf/orachk |
| Data Directory | /opt/app/grid/oracle.ahf/data |
| Repository | /opt/app/grid/oracle.ahf/data/repository |
| Diag Directory | /opt/app/grid/oracle.ahf/data/db01/diag |
'-----------------+------------------------------------------' Starting orachk daemon from AHF ... AHF install completed on db01 Installing AHF on Remote Nodes : AHF will be installed on db02, Please wait. Installing AHF on db02 : [db02] Copying AHF Installer [db02] Running AHF Installer AHF binaries are available in /opt/oracle.ahf/bin AHF is successfully installed Moving /tmp/ahf_install_9681_2020_06_25-17_50_19.log to /opt/app/grid/oracle.ahf/data/db01/diag/ahf/

安装完成后可以查看到tfa的进程,另外值得一提的是,TFA中也集成了OSW,无需DBA再单独部署OSW:

[oracle@db01 ~]$ ps -ef|grep tfa
root 10732 1 0 Jun25 ? 00:00:02 /bin/sh /etc/init.d/init.tfa run >/dev/null 2>&1 </dev/null
oracle 12963 19247 0 01:44 pts/0 00:00:00 grep --color=auto tfa
root 16654 1 0 Jun25 ? 00:02:23 /opt/oracle.ahf/jre/bin/java -server -Xms32m -Xmx64m -Djava.awt.headless=true -Ddisable.checkForUpdate=true -XX:HeapDumpPath=/opt/app/grid/oracle.ahf/data/db01/diag/tfa oracle.rat.tfa.TFAMain /opt/oracle.ahf/tfa
[oracle@db01 ~]$ ps -ef|grep osw
oracle 12965 19247 0 01:44 pts/0 00:00:00 grep --color=auto osw
grid 16991 1 0 Jun25 ? 00:00:09 /bin/sh ./OSWatcher.sh 30 48 NONE /opt/app/grid/oracle.ahf/data/repository/suptools/db01/oswbb/grid/archive
grid 17259 16991 0 Jun25 ? 00:00:03 /bin/sh ./OSWatcherFM.sh 48 /opt/app/grid/oracle.ahf/data/repository/suptools/db01/oswbb/grid/archive
[oracle@db01 ~]$

4.使用TFA一键收集相关日志

最常用的比如说目前要收集最近5h内的所有相关日志,使用命令`tfactl diagcollect -all -since 5h`,这其中也包含了OSW的信息:

[oracle@db01 ~]$ /opt/oracle.ahf/tfa/bin/tfactl diagcollect -all -since 5h
The -all switch is being deprecated as collection of all components is the default behavior. TFA will continue to collect all components.
Collecting data for all nodes Collection Id : 20200626012924db01 Detailed Logging at : /opt/app/grid/oracle.ahf/data/repository/collection_Fri_Jun_26_01_29_25_CST_2020_node_all/diagcollect_20200626012924_db01.log
2020/06/26 01:29:42 CST : NOTE : Any file or directory name containing the string .com will be renamed to replace .com with dotcom
2020/06/26 01:29:42 CST : Collection Name : tfa_Fri_Jun_26_01_29_25_CST_2020.zip
2020/06/26 01:29:46 CST : Collecting diagnostics from hosts : [db01, db02]
2020/06/26 01:29:46 CST : Scanning of files for Collection in progress...
2020/06/26 01:29:46 CST : Collecting additional diagnostic information...
2020/06/26 01:30:06 CST : Getting list of files satisfying time range [06/25/2020 20:29:42 CST, 06/26/2020 01:30:06 CST]
2020/06/26 01:30:41 CST : Collecting ADR incident files...
2020/06/26 01:32:23 CST : Completed collection of additional diagnostic information...
2020/06/26 01:32:27 CST : Completed Local Collection
2020/06/26 01:32:28 CST : Remote Collection in Progress...
.---------------------------------.
| Collection Summary |
+------+-----------+-------+------+
| Host | Status | Size | Time |
+------+-----------+-------+------+
| db02 | Completed | 1.5MB | 126s |
| db01 | Completed | 2MB | 161s |
'------+-----------+-------+------' Logs are being collected to: /opt/app/grid/oracle.ahf/data/repository/collection_Fri_Jun_26_01_29_25_CST_2020_node_all
/opt/app/grid/oracle.ahf/data/repository/collection_Fri_Jun_26_01_29_25_CST_2020_node_all/db01.tfa_Fri_Jun_26_01_29_25_CST_2020.zip
/opt/app/grid/oracle.ahf/data/repository/collection_Fri_Jun_26_01_29_25_CST_2020_node_all/db02.tfa_Fri_Jun_26_01_29_25_CST_2020.zip

然后只需将/opt/app/grid/oracle.ahf/data/repository/collection_Fri_Jun_26_01_29_25_CST_2020_node_all目录下的文件:

[oracle@db01 collection_Fri_Jun_26_01_29_25_CST_2020_node_all]$ ls -lrth
total 3.6M
-rw-r--r-- 1 oracle oinstall 955 Jun 26 01:30 db01.tfa_Fri_Jun_26_01_29_25_CST_2020.zip.txt
-rw-r--r-- 1 oracle oinstall 1.6M Jun 26 01:32 db02.tfa_Fri_Jun_26_01_29_25_CST_2020.zip
-rw-r--r-- 1 oracle oinstall 921 Jun 26 01:32 db02.tfa_Fri_Jun_26_01_29_25_CST_2020.zip.txt
-rw-r--r-- 1 oracle oinstall 1.6K Jun 26 01:32 diagcollect_20200626012924_db02.log
-rw-r--r-- 1 oracle oinstall 2.1M Jun 26 01:32 db01.tfa_Fri_Jun_26_01_29_25_CST_2020.zip
-rw-r--r-- 1 oracle oinstall 993 Jun 26 01:32 diagcollect_console_20200626012924_db01.log
-rw-r--r-- 1 oracle oinstall 2.1K Jun 26 01:32 diagcollect_20200626012924_db01.log

按需下载下来即可。

Reference:

  • Autonomous Health Framework (AHF) - Including TFA and ORAchk/EXAChk (Doc ID 2550798.1)
  • SRDC - How to Collect Standard Information for a SQL Performance Problem Using TFA Collector (Recommended) or Manual Steps (Doc ID 2366043.1)

安装TFA用于快速收集RAC各类日志的更多相关文章

  1. .NetCore快速搭建ELK分布式日志中心

    懒人必备:.NetCore快速搭建ELK分布式日志中心   该篇内容由个人博客点击跳转同步更新!转载请注明出处! 前言 ELK是什么 它是一个分布式日志解决方案,是Logstash.Elastaics ...

  2. 带你了解zabbix整合ELK收集系统异常日志触发告警~

    今天来了解一下关于ELK的“L”-Logstash,没错,就是这个神奇小组件,我们都知道,它是ELK不可缺少的组件,完成了输入(input),过滤(fileter),output(输出)工作量,也是我 ...

  3. 懒人必备:.NetCore快速搭建ELK分布式日志中心

    该篇内容由个人博客点击跳转同步更新!转载请注明出处! 前言 ELK是什么 它是一个分布式日志解决方案,是Logstash.Elastaicsearch.Kibana的缩写,可用于从不同的服务中收集日志 ...

  4. elk系列8之logstash+redis+es的架构来收集apache的日志

    preface logstash--> redis --> logstash --> es这套架构在讲究松耦合关系里面是最简单的, 架构图如下: 解释下这个架构图的流程 首先前端lo ...

  5. logstash收集nginx访问日志

    logstash收集nginx访问日志 安装nginx #直接yum安装: [root@elk-node1 ~]# yum install nginx -y 官方文档:http://nginx.org ...

  6. ELK收集Nginx自定义日志格式输出

    1.ELK收集日志的有两种常用的方式: 1.1:不修改源日志格式,简单的说就是在logstash中转通过 grok方式进行过滤处理,将原始无规则的日志转换为规则日志(Logstash自定义日志格式) ...

  7. Oracle 11g快速收集全库统计信息

    环境:Oracle 11.2.0.4 采用并行的方式,快速收集全库统计信息,多用于跨版本升级之后,对全库的统计信息重新进行快速收集: --开启计时 set timing on --设置并行收集 exe ...

  8. MySQL各类日志文件相关变量介绍

    文章转自:http://www.ywnds.com/?p=3721 MySQL各类日志文件相关变量介绍 查询所有日志的变量   1 mysql> show global variables li ...

  9. elk系列8之logstash+redis+es的架构来收集apache的日志【转】

    preface logstash--> redis --> logstash --> es这套架构在讲究松耦合关系里面是最简单的,架构图如下: 解释下这个架构图的流程 首先前端log ...

  10. ELK之Kibana部署、收集系统日志、一个文件收集多个日志

    1.安装及配置Kibana cd /usr/local/src yum -y install kibana-5.4.0-x86_64.rpm grep "^[a-Z]" /etc/ ...

随机推荐

  1. the server responded with a status of 413 (Request Entity Too Large) 解决

    前端上传文件,本地测试好的,放到服务器上出现了这个错误:the server responded with a status of 413 (Request Entity Too Large) 问题原 ...

  2. webpack升级-心得

  3. 机器学习-无监督机器学习-LDA线性判别分析-25

    目录 1. Linear Discriminant Analysis 线性判别分析 1. Linear Discriminant Analysis 线性判别分析 经常被用于分类问题的降维技术,相比于P ...

  4. 一文搞清楚Java中的包、类、接口

    写在开头 包.类.接口.方法.变量.参数.代码块,这些都是构成Java程序的核心部分,即便最简单的一段代码里都至少要包含里面的三四个内容,这两天花点时间梳理了一下,理解又深刻了几分. Java中的包 ...

  5. Mysql 开启慢日志查询及查看慢日志 sql

    本文为博主原创,转载请注明出处: 目录:    1.Mysql 开启慢日志配置的查询    2. 通过sql 设置Mysql 的慢日志开启    3. 通过慢 sql 日志文件查看慢 sql  1.M ...

  6. CSS - 怎么样在不同分辨率的情况下计算根元素需要的font-size的值

    一般我们做页面,肯定都会有设计图,移动端页面,一般情况下,UI出图都会定宽为640px,这也是移动端的标准尺寸:但是,我们也不能排除可能有其他特殊的情况可能需要做其他大小的设计图.所以,我们可以先定一 ...

  7. JVM大页内存的学习与使用

    JVM大页内存的学习与使用 原理和背景 操作系统是计算机的重要组成部分. 现代的操作系统一般都采用 段页式内存管理. 段一般是为了管理和权限 页主要是为了虚拟内存和物理内存的映射. 分页管理可以让物理 ...

  8. [转帖]JDK8使用G1 垃圾回收器能解决大问题吗?

    https://zhuanlan.zhihu.com/p/458098236 G1 垃圾回收器真的不行吗? 本文想突出两个问题: 解决问题的思路:从最原始的角度去思考,问题的本身是因为缓存数据导致的G ...

  9. [转帖]top指令如何查询指定用户的所有进程?

    有两种方法. 1.top指令与字符串查询指令通过通道配合查询. 指令:    "-d 5"指的是每五秒刷新一次进程列表,"grep"是字符串查询指令,它可以将含 ...

  10. [转帖]JMeter 5.5 使用详解(持续更新中......)

    https://blog.csdn.net/qq_45138120/article/details/124056704?ops_request_misc=%257B%2522request%255Fi ...