安装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/ ...
随机推荐
- 深度学习基础课:使用交叉熵损失函数和Softmax激活函数(下)
大家好~本课程为"深度学习基础班"的线上课程,带领同学从0开始学习全连接和卷积神经网络,进行数学推导,并且实现可以运行的Demo程序 线上课程资料: 本节课录像回放 加QQ群,获得 ...
- docker目录迁移流程
概述 在安装测试最新版本的HOMER7的过程中,docker作为基础工具碰到一些问题,针对问题进行总结. docker的默认工作目录在/var目录,而在我们的环境中,/var目录空间预留不足,随着do ...
- 【ArgParse】一个开源的入参解析库
项目地址:argtable3 本地验证: 编译构建 新增验证 // examples/skull.c #include "argtable3.h" int main(int arg ...
- 【TouchGFX】使用CubeMX创建touchgfx项目 -- 初始篇
1.系统构成,黑色块表示组件非必须 2.环境准备 CubeMX:6.0.1 touchgfx:4.15.0 rt-thread:2020-8-14 commit Keil:5.30 board:stm ...
- Laravel - 使用查询构造器查询
public function constructorQuery() { # 1,新增 DB::table('student')->insert([ ...
- [转帖]clickHouse单机模式安装部署(RPM安装)
关于版本和系统的选择 操作系统:Centos-7 ClickHouse: rpm 在安装,20.x 安装前的准备 CentOS7 打开文件数限 在 /etc/security/limits.conf ...
- 【转帖】Linux性能优化(十四)——CPU Cache
一.CPU Cache 1.CPU Cache简介 CPU Cache是位于CPU与内存之间的临时存储器,容量比内存小但交换速度却比内存要快得多.Cache的出现主要是为了解决CPU运算速度与内存读写 ...
- [转帖]Linux系统:page fault
Linux进程如何访问内存 Linux下,进程并不是直接访问物理内存,而是通过内存管理单元(MMU)来访问内存资源,原因后面会讲到. 为什么需要虚拟内存地址空间 假设某个进程需要4MB的空间,内存假设 ...
- [转帖]关于iostat的问题,svctm数据不可信
使用FIO对磁盘进行压力测试,使用1个线程对磁盘进行随机读,设置单次read的数据块分别为128KB和1M,数据如下: (1)单次IO数据块为128KB (2)单次IO数据块为1M 从上面的数据可以看 ...
- [转帖]【JVM】堆内存与栈内存详解
堆和栈的定义 java把内存分成栈内存和堆内存. (1)栈内存 在函数中定义的一些基本类型的变量和对象的引用变量都是在函数的栈内存中分配. 当在一段代码块中定义一个变量时,java就在栈中为这个变量分 ...