安装TFA用于快速收集RAC各类日志
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各类日志的更多相关文章
- .NetCore快速搭建ELK分布式日志中心
懒人必备:.NetCore快速搭建ELK分布式日志中心 该篇内容由个人博客点击跳转同步更新!转载请注明出处! 前言 ELK是什么 它是一个分布式日志解决方案,是Logstash.Elastaics ...
- 带你了解zabbix整合ELK收集系统异常日志触发告警~
今天来了解一下关于ELK的“L”-Logstash,没错,就是这个神奇小组件,我们都知道,它是ELK不可缺少的组件,完成了输入(input),过滤(fileter),output(输出)工作量,也是我 ...
- 懒人必备:.NetCore快速搭建ELK分布式日志中心
该篇内容由个人博客点击跳转同步更新!转载请注明出处! 前言 ELK是什么 它是一个分布式日志解决方案,是Logstash.Elastaicsearch.Kibana的缩写,可用于从不同的服务中收集日志 ...
- elk系列8之logstash+redis+es的架构来收集apache的日志
preface logstash--> redis --> logstash --> es这套架构在讲究松耦合关系里面是最简单的, 架构图如下: 解释下这个架构图的流程 首先前端lo ...
- logstash收集nginx访问日志
logstash收集nginx访问日志 安装nginx #直接yum安装: [root@elk-node1 ~]# yum install nginx -y 官方文档:http://nginx.org ...
- ELK收集Nginx自定义日志格式输出
1.ELK收集日志的有两种常用的方式: 1.1:不修改源日志格式,简单的说就是在logstash中转通过 grok方式进行过滤处理,将原始无规则的日志转换为规则日志(Logstash自定义日志格式) ...
- Oracle 11g快速收集全库统计信息
环境:Oracle 11.2.0.4 采用并行的方式,快速收集全库统计信息,多用于跨版本升级之后,对全库的统计信息重新进行快速收集: --开启计时 set timing on --设置并行收集 exe ...
- MySQL各类日志文件相关变量介绍
文章转自:http://www.ywnds.com/?p=3721 MySQL各类日志文件相关变量介绍 查询所有日志的变量 1 mysql> show global variables li ...
- elk系列8之logstash+redis+es的架构来收集apache的日志【转】
preface logstash--> redis --> logstash --> es这套架构在讲究松耦合关系里面是最简单的,架构图如下: 解释下这个架构图的流程 首先前端log ...
- ELK之Kibana部署、收集系统日志、一个文件收集多个日志
1.安装及配置Kibana cd /usr/local/src yum -y install kibana-5.4.0-x86_64.rpm grep "^[a-Z]" /etc/ ...
随机推荐
- Qt开发-共享内存使用范例,配合开发者密钥使用后台调试程序或者进入调试模式
共享内存 就之前不是开发了一个Leventure_DeveloperKey用以调试程序嘛,在这里简单聊一下调试模式的方案. 这里的调试分为了两种,一种是调试模式,一种是开发者模式.需要这两种模式的原因 ...
- C#设计模式13——建造者模式的写法
1. 什么是建造者模式? 建造者模式是一种创建型设计模式,它通过将一个复杂的对象分解为多个简单的对象并按照一定的顺序进行组装而创建出一个复杂的对象.这样可以使得构造过程更加灵活,同时也可以隐藏创建过程 ...
- C#使用ParseExact方法将字符串转化为日期格式
private void btn_Convert_Click(object sender, EventArgs e) { #region 针对Windows 7系统 string s = string ...
- OpenStack 工作流组件: Mistral
1 Mistral 简介 Mistral 是由 Mirantis 开发,贡献给 OpenStack 社区的工作流组件,它提供 Workflow As a Service 服务. 在计算机中通常处理的任 ...
- 【rt-thread】Kconfig文件添加子Kconfig文件时是以顶级Kconfig所在目录为当前路径的
示例如下 顶级Kconfig文件所在目录 子级Kconfig文件所在目录 子级Kconfig文件添加次子级Kconfig文件,以顶级目录为当前路径依次写出次子级Kconfig文件所在目录
- web-云部署上线
- [转帖]nginx中的if和else语法
https://www.dyxmq.cn/it/nginx/nginx-if.html nginx支持if语法,语法和平常的代码格式差不多: 1 2 3 if ($xxx = xxx) { ...
- [转帖]TIKV扩容之刨坑填坑
01 背景 某tidb集群收到告警,TIKV 节点磁盘使用率85%以上,联系业务无法快速删除数据,于是想到扩容TIKV 节点,原先TIKV 节点机器都是6TB的硬盘,目前只有3TB的机器可扩,也担心r ...
- [转帖]linux 下 {}大括号的用法
我们平时使用Linux的时候经常遇到这样一个问题,举例有这样一种情况:执行命令 $ cp /etc/apt/sources.list /etc/apt/sources.list.bak 这里面有个问题 ...
- Nginx的再学习
第一部分 Nginx的版本 Nginx官网提供了三个类型的版本 Mainline version:Mainline 是 Nginx 目前主力在做的版本,可以说是开发版 Stable version:最 ...