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. CPLEX通过Python API获取Gap值的方法

    写在前面 最近在使用Cplex求解模型,尽管Cplex的Python API会自动输出引擎日志,但在多次求解中一次次看引擎日志找Gap值并做实验记录很麻烦,所以需要找到获取Gap值的方法.然而我在Cp ...

  2. vue中引入其他网站页面

    https://blog.csdn.net/qq_36706878/article/details/102593309

  3. C语言基础之第一个C程序

    前言 在开始学习 C 语言的基础知识之前,我们需要学习如何编写.编译和运行第一个 C 程序. 要编写第一个 C 程序,打开 C 控制台并编写以下代码,我这里直接使用vs2022进行代码的编写: #in ...

  4. 简化 libevent 编译

    在 CMakePresets.json 的 cacheVariables 字段加入 { "EVENT__DISABLE_OPENSSL": "ON", &quo ...

  5. 每天学五分钟 Liunx | 有趣的 log

    说明:看 systemd log 的时候发现了一段有意思的打印,不太明白为什么会这样,贴出来与朋友们分享,欢迎知道的朋友们说明下,非常感谢.   问题描述:服务启动时,会执行 python 脚本,该脚 ...

  6. Laravel - blade 模板继承的使用

    1. 模板文件 <!DOCTYPE html> <html lang="en"> <head>     <meta charset=&qu ...

  7. [转帖]SQL Server数据库重建索引、更新统计信息

    https://vip.kingdee.com/article/183932?productLineId=8 SQL Server数据库有时由于长期未做索引重建,导致SQL执行效率下降,当表的索引碎片 ...

  8. 【转帖】linux环境下使用route指令设置多个网络连接的优先级(通过修改路由表的默认网关条目)

    1. 背景 在生活中的会经常遇见一台PC同时连接多个网络的场景.最典型的,一台笔记本可以同时连接一个无线网(手机热点)和一个有线网(以太网).linux和window操作系统在默认情况都会使用最早连接 ...

  9. [转帖]银河麒麟服务器操作系统V10SP1-x86_64系统环境下部署aarch64虚拟机

    文章目录 主机系统环境 搭建aarch64虚拟机环境 ①安装"虚拟系统管理器" ②编译安装Qemu for Aarch64 ③获取aarch64架构的qcow2镜像 ④使用qcow ...

  10. Python设计模式:你的代码真的够优雅吗?

    当涉及到代码优化时,Python作为一种高级编程语言,具有广泛的应用领域和强大的功能.在软件开发中,设计模式是一种被广泛采用的解决问题的方案,它提供了一种在特定情境中重复使用的可行方案.在Python ...