ahf:就是工具合集,大名是自治健康框架autonomous health framework
需要从官方下载一个包,安装后,它自己后台运行,搜集日志方便很多了。
下载到本地后(360多兆),解压
[root@dbserver01 a]# unzip -q ahf-linux_v19.3.2.zip
[root@dbserver01 a]# ll
total 722704
-rw-r--r-- 1 oracle oinstall 366721686 feb 12 15:22 ahf-linux_v19.3.2.zip
-rwxr-xr-x 1 root root 373317903 dec 20 01:42 ahf_setup
-rw-r--r-- 1 root root 832 dec 20 02:00 readme.txt
用root执行安装,对,直接装
[root@dbserver01 a]#
./ahf_setup
ahf installer for platform linux architecture x86_64
ahf installation log : /tmp/ahf_install_38663_2020_02_12-15_23_12.log
starting autonomous health framework (ahf) installation
ahf version: 193200 build date: 201911251327
tfa is already installed at : /u01/app/11.2.0.4/grid/tfa/dbserver01/tfa_home
installed tfa version : 121284 build id : 20170203230512
default ahf location : /opt/oracle.ahf
do you want to change ahf location (/opt/oracle.ahf) ? y|[n] :
直接回车
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/oracle.ahf [free space : 4751 mb]
2. /u01/app/grid [free space : 59331 mb]
3. enter a different location
choose option [1 - 3] :
2 我选2将数据放到grid目录下,因为/opt通常比较小
ahf data directory : /u01/app/grid/oracle.ahf/data
shutting down tfa : /u01/app/11.2.0.4/grid/tfa/dbserver01/tfa_home
copying tfa data files from /u01/app/11.2.0.4/grid/tfa/dbserver01/tfa_home
uninstalling tfa : /u01/app/11.2.0.4/grid/tfa/dbserver01/tfa_home
do you want to add ahf notification email ids ? [y]|n :
n 不收通知邮件
ahf will also be installed/upgraded on these cluster nodes :
1. dbserver02
the ahf location and ahf data directory must exist on the above nodes
ahf location : /opt/oracle.ahf
ahf data directory : /u01/app/grid/oracle.ahf/data
do you want to install/upgrade ahf on cluster nodes ? [y]|n :
n
not performing install/upgrade on cluster nodes
extracting ahf to /opt/oracle.ahf
configuring tfa services
copying tfa data files to ahf
file /u01/app/grid/oracle.ahf/data/dbserver01/tfa/internal/smtp.properties.patch not found
file /u01/app/grid/oracle.ahf/data/dbserver01/tfa/internal/timezones_mapping.patch not found
discovering nodes and oracle resources
starting tfa services
.-------------------------------------------------------------------------------.
| host | status of tfa | pid | port | version | build id |
------------ --------------- ------- ------ ------------ ----------------------
| dbserver01 | running | 42213 | 5000 | 19.3.2.0.0 | 19320020191125132721 |
| dbserver02 | running | 13462 | 5000 | 19.3.2.0.0 | 19320020191125132721 |
'------------ --------------- ------- ------ ------------ ----------------------'
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 | /u01/app/grid/oracle.ahf/data |
| repository | /u01/app/grid/oracle.ahf/data/repository |
| diag directory | /u01/app/grid/oracle.ahf/data/dbserver01/diag |
'----------------- -----------------------------------------------'
starting orachk daemon from ahf ...
ahf binaries are available in /opt/oracle.ahf/bin
ahf is successfully installed
moving /tmp/ahf_install_38663_2020_02_12-15_23_12.log to /u01/app/grid/oracle.ahf/data/dbserver01/diag/ahf/
[root@dbserver01 a]#
安装完毕了。
它会自动检测到rac集群的不同节点,
建议只选择本地安装。
抓一次信息试试:
[root@dbserver02 ~]# cd /opt/oracle.ahf/
[root@dbserver02 oracle.ahf]# cd tfa
[root@dbserver02 tfa]# ls
bin disclaimer.txt ext input install internal public.jks readme.txt resources tfa.install.properties tfa.jks transfers
[root@dbserver02 tfa]# cd bin
[root@dbserver02 bin]#
./tfactl diagcollect -from "feb/12/2020 14:50:00" -to "feb/12/2020 17:05:00"
collecting data for all nodes
scanning files from feb/12/2020 14:50:00 to feb/12/2020 17:05:00
warning: end time entered is after the current system time.
collection id : 20200212152634dbserver02
detailed logging at : /u01/app/grid/oracle.ahf/data/repository/collection_wed_feb_12_15_26_35_cst_2020_node_all/diagcollect_20200212152634_dbserver02.log
2020/02/12 15:26:39 cst : note : any file or directory name containing the string .com will be renamed to replace .com with dotcom
2020/02/12 15:26:39 cst : collection name : tfa_wed_feb_12_15_26_35_cst_2020.zip
2020/02/12 15:26:39 cst : collecting diagnostics from hosts : [dbserver01, dbserver02]
2020/02/12 15:26:39 cst : scanning of files for collection in progress...
2020/02/12 15:26:39 cst : collecting additional diagnostic information...
2020/02/12 15:26:44 cst : getting list of files satisfying time range [02/12/2020 14:50:00 cst, 02/12/2020 15:26:39 cst]
2020/02/12 15:26:46 cst : collecting adr incident files...
2020/02/12 15:27:56 cst : completed collection of additional diagnostic information...
2020/02/12 15:28:01 cst : completed local collection
2020/02/12 15:28:01 cst : remote collection in progress...
.---------------------------------------.
| collection summary |
------------ ----------- ------- ------
| host | status | size | time |
------------ ----------- ------- ------
| dbserver01 | completed | 3.2mb | 85s |
| dbserver02 | completed | 2.7mb | 82s |
'------------ ----------- ------- ------'
logs are being collected to: /u01/app/grid/oracle.ahf/data/repository/collection_wed_feb_12_15_26_35_cst_2020_node_all
/u01/app/grid/oracle.ahf/data/repository/collection_wed_feb_12_15_26_35_cst_2020_node_all/dbserver02.tfa_wed_feb_12_15_26_35_cst_2020.zip
/u01/app/grid/oracle.ahf/data/repository/collection_wed_feb_12_15_26_35_cst_2020_node_all/dbserver01.tfa_wed_feb_12_15_26_35_cst_2020.zip
[root@dbserver02 bin]#
抓完了,生成两个zip包,因为rac节点有两个,它会自动取。
然后就可以将这两个zip上传到mos了。