1.TFA的目的:
TFA是個11.2版本上推出的用來收集Grid Infrastructure/RAC環境下的診斷日志的工具,它可以用非常簡單的命令協助用戶收集RAC里的日志,以便進一步進行診斷;TFA是類似diagcollection的一個oracle 集群日志收集器,而且TFA比diagcollection集中和自動化的診斷信息收集能力更強大。TFA有以下幾個特點:
1. TFA可以在一台機器上執行一條簡單的命令把所有節點的日志進行打包,封裝;
2. TFA可以在收集的過程中對日志進行”trim”操作,減少數據的收集量;
3. TFA可以收集用來診斷用的“一段時間內”的數據;
4. TFA可以把所有節點的日志收集並封裝好放在某一個節點上以便傳輸閱讀;
5. TFA可以指定Cluster中的某一部分組件進行日志收集,如:ASM ,RDBMS,Clusterware
6. TFA可以根據條件配置對告警日志進行實時掃描(DB Alert Logs, ASM Alert Logs, Clusterware Alert Logs, etc);
7. TFA可以根據實時掃描的結果自動的收集診斷日志;
8. TFA可以根據指定的錯誤進行對告警日志的掃描;
9. TFA可以根據指定的錯誤掃描后的結果收集診斷日志;
2. TFA的安裝要求:
平台:
目前TFA支持以下幾種平台:
Intel Linux(Enterprise Linux, RedHat Linux, SUSE Linux)
Linux Itanium
Oracle Solaris SPARC
Oracle Solaris x86-64
AIX (requires bash shell version 3.2 or higher installed)
HPUX Itanium
HPUX PA-RISC
3.支持的數據庫版本:
TFA目前的設計是脫離RDBMS和CRS進行設計的,所以設計的初衷是針對所有的版本而設計的,不受RDBMS或者CRS的版本限制;
下載 TFA Collector:
該版本的TFA和相關TFA用戶指南可以通過點擊下面的相關下載鏈接。
TFA 收集器:
https://mosemp.us.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1513912.2:TFA_NOJRE&clickstream=no
TFA 用戶手冊:
https://mosemp.us.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1513912.2:TFA_USER_GUIDE&clickstream=no
4. TFA快速安裝指南:
安裝:
注意:在安裝之前請確保您的環境上已經安裝了JRE1.6或者是更高版本的JRE,如果沒有,請先安裝JRE1.6
1. 請使用root用戶登錄系統
2. 在所有的節點上為TFA准備一個安裝的位置,注意這個位置不要放在Cluster file system中;
3. 在節點1上執行installTFALite.sh來啟動安裝過程:
---------------------------------
[root@rac1 tmp]# ./installTFALite.sh
Starting TFA installation
---------------------------------
備注: 最新版本的TFA已經把installTFALite.sh修改成了installTFALite,安裝的時候可以直接執行installTFALite,並且可以指定TFA BASE和JAVA_HOME
4. 當系統提示安裝位置,輸入在第2步中選擇的位置的TFA安裝,:
---------------------------------
Enter a location for installing TFA [/opt/oracle/tfa]:/opt/oracle/tfa
Checking for available space in /opt/oracle/tfa/
---------------------------------
5. 請輸入之前安裝了JRE1.6的JAVA_HOME,注意這個位置需要在所有的節點上都相同:
---------------------------------
Enter a Java Home that contains Java 1.6 or later : /usr/java/jre1.7.0_11
Running Auto Setup for TFA as user root...
---------------------------------
6. 按照以下說明完成安裝:
------------------------------------------------------------------
Would you like to do a [L]ocal only or [C]lusterwide installation ? [L|l|C|c] [C] :
The following installation requires temporary use of SSH.
If SSH is not configured already then we will remove SSH
when complete.
Do you wish to Continue ? [Y|y|N|n] [N] Y
Installing TFA at /opt/oracle/tfa in all hosts
Discovering Nodes and Oracle resources
Checking whether CRS is up and running
Getting list of nodes in cluster
Checking ssh user equivalency settings on all nodes in cluster
Node rac2 is configured for ssh user equivalency for root user
Searching for running databases . . . . .
.
List of running databases registered in OCR
1. ORCL
. .
Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
TFA Will be Installed on the Following Nodes
++++++++++++++++++++++++++++++++++++++++++++
Install Nodes
=============
rac1
rac2
Do you wish to make changes to the Node List ? [Y/y/N/n] [N]
TFA will scan the following Directories
++++++++++++++++++++++++++++++++++++++++++++
.----------------------------------------------------------------.
| rac2 |
+-----------------------------------------------------+----------+
| Trace Directory | Resource |
+-----------------------------------------------------+----------+
| /u01/app/11.2.0/grid/cfgtoollogs | INSTALL |
| /u01/app/11.2.0/grid/crs/log | CRS |
| /u01/app/11.2.0/grid/css/log | CRS |
| /u01/app/11.2.0/grid/cv/log | CRS |
| /u01/app/11.2.0/grid/evm/admin/log | CRS |
| /u01/app/11.2.0/grid/evm/admin/logger | CRS |
| /u01/app/11.2.0/grid/evm/log | CRS |
| /u01/app/11.2.0/grid/install | INSTALL |
| /u01/app/11.2.0/grid/log/ | CRS |
| /u01/app/11.2.0/grid/network/log | CRS |
| /u01/app/11.2.0/grid/oc4j/j2ee/home/log | CRSOC4J |
| /u01/app/11.2.0/grid/opmn/logs | CRS |
| /u01/app/11.2.0/grid/racg/log | CRS |
| /u01/app/11.2.0/grid/rdbms/log | ASM |
| /u01/app/11.2.0/grid/scheduler/log | CRS |
| /u01/app/11.2.0/grid/srvm/log | CRS |
| /u01/app/oraInventory/ContentsXML | INSTALL |
| /u01/app/oraInventory/logs | INSTALL |
| /u01/app/oracle/cfgtoollogs | CFGTOOLS |
| /u01/app/oracle/diag/asm/+asm/+ASM2/trace | ASM |
| /u01/app/oracle/diag/rdbms/orcl/ORCL2/trace | RDBMS |
| /u01/app/oracle/diag/tnslsnr | TNS |
| /u01/app/oracle/diag/tnslsnr/rac2/listener/trace | TNS |
| /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs | INSTALL |
| /u01/app/oracle/product/11.2.0/dbhome_1/install | INSTALL |
'-----------------------------------------------------+----------'
.----------------------------------------------------------------.
| rac1 |
+-----------------------------------------------------+----------+
| Trace Directory | Resource |
+-----------------------------------------------------+----------+
| /u01/app/11.2.0/grid/cfgtoollogs | INSTALL |
| /u01/app/11.2.0/grid/crs/log | CRS |
| /u01/app/11.2.0/grid/css/log | CRS |
| /u01/app/11.2.0/grid/cv/log | CRS |
| /u01/app/11.2.0/grid/evm/admin/log | CRS |
| /u01/app/11.2.0/grid/evm/admin/logger | CRS |
| /u01/app/11.2.0/grid/evm/log | CRS |
| /u01/app/11.2.0/grid/install | INSTALL |
| /u01/app/11.2.0/grid/log/ | CRS |
| /u01/app/11.2.0/grid/network/log | CRS |
| /u01/app/11.2.0/grid/oc4j/j2ee/home/log | CRSOC4J |
| /u01/app/11.2.0/grid/opmn/logs | CRS |
| /u01/app/11.2.0/grid/racg/log | CRS |
| /u01/app/11.2.0/grid/rdbms/log | ASM |
| /u01/app/11.2.0/grid/scheduler/log | CRS |
| /u01/app/11.2.0/grid/srvm/log | CRS |
| /u01/app/oraInventory/ContentsXML | INSTALL |
| /u01/app/oraInventory/logs | INSTALL |
| /u01/app/oracle/cfgtoollogs | CFGTOOLS |
| /u01/app/oracle/diag/asm/+asm/+ASM1/trace | ASM |
| /u01/app/oracle/diag/rdbms/orcl/ORCL1/trace | RDBMS |
| /u01/app/oracle/diag/tnslsnr | TNS |
| /u01/app/oracle/diag/tnslsnr/rac1/listener/trace | TNS |
| /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs | INSTALL |
| /u01/app/oracle/product/11.2.0/dbhome_1/install | INSTALL |
'-----------------------------------------------------+----------'
Do you wish to change the Trace Directory List ? [Y/y/N/n] [N]
Installing TFA on rac1
Installing TFA on rac2
TFA is running
Successfully added host: rac2
.--------------------------------.
| Host | Status of TFA | PID |
+--------+---------------+-------+
| rac1 | RUNNING | 11685 |
| rac2 | RUNNING | 5081 |
'--------+---------------+-------'
Setting TFA cookie in all nodes
Successfully set cookie=77411b8fff446d2954d5c080225052ac
TFA Cookie: 77411b8fff446d2954d5c080225052ac
Summary of TFA Installation
.-----------------------------------------------------------.
| rac1 |
+---------------------+-------------------------------------+
| Parameter | Value |
+---------------------+-------------------------------------+
| Install location | /opt/oracle/tfa/tfa_home |
| Repository location | /opt/oracle/tfa/tfa_home/repository |
| Repository usage | 0 MB out of 10240 MB |
'---------------------+-------------------------------------'
.-----------------------------------------------------------.
| rac2 |
+---------------------+-------------------------------------+
| Parameter | Value |
+---------------------+-------------------------------------+
| Install location | /opt/oracle/tfa/tfa_home |
| Repository location | /opt/oracle/tfa/tfa_home/repository |
| Repository usage | 0 MB out of 10240 MB |
'---------------------+-------------------------------------'
TFA is successfully installed..
------------------------------------------------------------------
4.TFA啟動和停止:
TFA運行在Linux和Unix平台上的init,所以,這將是在服務器啟動時自動啟動。
默認的情況我們把這個腳本命名為init.tfa;
所在位置取決於不同平台,如:
Linux and Solaris: /etc/init.d/init.tfa
Aix: /etc/init.tfa
HP-UX: /sbin/init.d/init.tfa
以下命令式在Linux平台下作為例子:
啟動:
# /etc/init.d/init.tfa start
停止:
# /etc/init.d/init.tfa stop
重啟:
# /etc/init.d/init.tfa restart
5.手動收集診斷信息:
我們通過調用tfactl的命令和診斷動詞diagnostic來控制TFA收集我們期望的診斷信息。Tfactl 提供給用戶多種可選擇的模式進行收集,如 ,收集一個時間段內的日志信息來減少我們收集日志的量;
具體操作的命令您可以通過以下方式看到:
--------------------------------------------------------------
#$TFA_HOME/bin/tfactl diagcollect -h
Usage: /u01/app/tfa/tfa_home/bin/tfactl diagcollect [-all | -database | -asm | -crs | -os | -install | -node | -tag ]
[-since <n><h|d>| -from <time> -to <time> | -for <time>]
[-copy | -nocopy] [-symlink][-notrim]
Options:
-all Collect logs of all types
-crs Collect only CRS logs
-asm Collect only ASM logs
-database Collect only database logs from databases specified
-os Collect only OS files
-install Collect only INSTALL files
-node Specify comma separated list of host names for collection.
-copy Copy back the zip files to master node from all nodes
-nocopy Does not copy back the zip files to master node from all nodes
-notrim Does not trim the files collected
-symlink This option should be used with -for.
Creates symlinks for files which are updated during the input time.
-since <n><h|d> Files from past 'n' [d]ays or 'n' [h]ours
-from <time> From time
-to <time> To time
-for <time> Specify a incident time.
-z <file> Output file name
-tag <description> Enter a tag for the zip(s) created
--------------------------------------------------------------
在下面的例子中,我們使用了 -all,�����訴TFA收集診斷所有類型的日志,從午夜1月21日至1月21日13:00 進行收集。該命令將啟動指定的診斷在后台收集所有群集節點上,壓縮成zip文件放置在每個節點的TFA_HOME中:
--------------------------------------------------------------
# $TFA_HOME/bin/tfactl diagcollect -all -from "Jan/21/2013 00:00:00" -to "Jan/21/2013 13:00:00"
time: Jan/21/2013
Valid pattern
Month : 1
time: Jan/21/2013 13:00:00
Valid pattern
Month : 1
rac1:startdiagcollection: -database -asm -crs -os -install -from Jan/21/2013 -to Jan/21/2013 13:00:00 -z Mon_Jan_21_11_52_20_EST_2013 -node all -copy
Logs are collected to:
/opt/oracle/tfa/tfa_home/repository/rac1.Mon_Jan_21_11_52_20_EST_2013.zip
/opt/oracle/tfa/tfa_home/repository/rac2.Mon_Jan_21_11_52_20_EST_2013.zip
--------------------------------------------------------------
6.診斷問題or上傳診斷信息給Oracle Support工程師:
無論我們用哪種方法對診斷信息進行收集,日志信息都會被打包好放置在$TFA_HOME/repository的目錄下,以便您上傳該文件給Oracle的support工程師
7.推薦參考文檔:
TFA Collector- The Preferred Tool for Automatic or ADHOC Diagnostic Gathering Across All Cluster Nodes [ID 1513912.2]
在本篇博客中我們來詳細了解一下TFA的功能,以及如何利用它的便捷之處。
1. 便捷的日志收集和分析工具Trace File Analyzer
客戶在和技術支持的工程師解決GI(RAC)問題的時候,一個最大的問題就是及時的收集各個節點上和問題相關的日志和診斷數據,特別是收集的數據還有跨節點。另外,RAC里的trace日志文件是輪循使用的,如果發生問題之后不及時收集日志就會被覆蓋。對於單機的環境ADR(Automatic Diagnostic Repository)雖然可以很好的避免這個問題,它會對故障發生后對故障生成的文件進行打包,但是ADR並不能收集RAC的日志。對於Cluster的日志收集我們以前會經常使用diagcollection.pl這個腳本,但是這個腳本的弊端是它不會甄別日志里的內容,會把所有的RAC日志從頭至尾都收集一遍。如果您曾經使用過diagcollection.pl一定會知道這個腳本收集的日志是非常大的,而且diagcollection.pl的腳本必須要在各個節點上分別使用root用戶分別運行,使用不便利。
TFA基本上克服了上邊的這些問題,TFA通過在每一個節點上運行一個Java的虛擬環境,來判斷什么時候需要啟動來收集,壓縮日志,並且來判斷哪些日志是解決問題必要,TFA是運行在GI和RDBMS之外的產品,所以它甚至和當前使用的版本和平台都沒有關系。
所以,在處理Oracle GI 和 RAC問題時,使用 TFA可以一鍵收集所有需要的日志,而且會過濾掉不需要的日志。
也有客戶擔心使用TFA會對系統有影響,了解了上述它的功能之后,您就可以知道它只是一個日志收集工具,並不會對系統產生變更,他對OS的負載壓力是輕量級的。
2.TFA的進程介紹和收集日志的便利方法:
TFA的功能是由一個TFA的進程和TFA的命令接口CLI構成,我們可以把它安裝布置在任何環境里,TFA進程是個JAVA的進程,如下:
| 節點1上: [grid@host1 root 3335 1 2 Feb26 ? 00:55:28 /u01/app/11.2.0.4/grid/jdk/jre/bin/java
節點2上: [grid@host2 root 3295 1 0 Feb25 ? 00:19:26 [grid@nascds11 ~]$ |
以上可以看到TFAMain是個由root用戶啟動的,它是個多線程的進程,同時會自動的完成對節點和節點之間以及CLI接口的驅動任務。節點和節點之間的TFAMain進程通過secure socket彼此進行監聽並進行任務交互。
它的啟動和RAC的ohasd一樣,也是配置在/etc/init.d中,如:
/etc/init.d/init.tfa
關於TFA的各種環境的安裝,升級,卸載等管理,請參考下邊的文檔:
TFA Collector- The Preferred Tool for Automatic or ADHOC Diagnostic Gathering Across All Cluster Nodes [ID 1513912.2]
以及我之前寫的博客:Oracle GI 日志收集工具 - TFA 簡介。
我們這里來介紹一下如何能更方便的使用TFA進行日志過濾和收集,以及新加的功能。
2.1 我們先看以下tfa管理的節點和目前的狀態:
[root@host1 tmp]# tfactl print hosts
Host Name : host1
Host Name : host2
[root@host1 tmp]# tfactl print status
.---------------------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID | Inventory Status |
+-------+---------------+-------+------+------------+----------------------+------------------+
| host1 | RUNNING | 18686 | 5000 | 12.1.2.6.3 | 12126320160104141621 | COMPLETE |
| host2 | RUNNING | 18030 | 5000 | 12.1.2.6.3 | 12126320160104141621 | COMPLETE |
'-------+---------------+-------+------+------------+----------------------+------------------'
2.2 如果我們安裝了一些其它工具收集的日志,我們想讓TFA來幫我們一同管理,我們也可以直接把對應的目錄添加進來,語法查詢,請使用以下命令:
[root@host1 tmp]# tfactl directory -h
如:
/u01/app/11.2.0/grid/bin/tfactl directory add /nmon/log/
[root@host1 oswbb]# mkdir -p /nmon/log
[root@host1 oswbb]# /u01/app/11.2.0/grid/bin/tfactl directory add /nmon/log
Unable to determine component for directory: /nmon/log
Please choose a component for this Directory [RDBMS|CRS|ASM|INSTALL|OS|CFGTOOLS|TNS|DBWLM|ACFS|ALL] : OS
Do you wish to assign more components to this Directory ? [Y/y/N/n] [N] n
Running Inventory ...
Successfully added directory to TFA
2.3 客戶可能會經常碰見我們技術支持的人需要收集OS watcher ,最新版本的TFA在安裝的過程會把OSW也進行封裝,並且按照默認的方式進行啟動,如:
[root@host1 tmp]# ps -ef |grep osw
grid 19047 1 0 12:20 ? 00:00:00 /bin/sh ./OSWatcher.sh 30 48 NONE /u01/app/grid/tfa/repository/suptools/host1/oswbb/grid/archive
grid 20169 19047 0 12:20 ? 00:00:00 /bin/sh ./OSWatcherFM.sh 48 /u01/app/grid/tfa/repository/suptools/host1/oswbb/grid/archive
但是如果您想讓這個功能完全生效,您還是需要把Exampleprivate.net修改成private.net,並且修改連的私網和平台信息,才能對私網數據進行采集。
2.4 按照我們自己定制的規則進行日志收集
收集日志的語法如下,可以通過以下命令進行查詢獲取:
[root@host1 oswbb]# tfactl diagcollect -h
我們這里解釋集中常用的方式:
2.4.1 收集2個小時之前的由TFA管理的所有的日志:
#tfactl diagcollect –all –since 2h
2.4.2 收集1天內由TFA管理的所有日志,並壓縮存放在本地foo為后綴
#tfactl diagcollect -since 1d -z foo
[root@host1 oswbb]# tfactl diagcollect -since 1d -z foo
Collecting data for all nodes
Collection Id : 20160228124457host1
Repository Location in host1 : /u01/app/grid/tfa/repository
Collection monitor will wait up to 30 seconds for collections to start
2016/02/28 12:45:01 CST : Collection Name : tfa_foo.zip
2016/02/28 12:45:01 CST : Sending diagcollect request to host : host2
2016/02/28 12:45:01 CST : Scanning of files for Collection in progress...
2016/02/28 12:45:01 CST : Collecting extra files...
2016/02/28 12:45:06 CST : Getting list of files satisfying time range [02/27/2016 12:45:01 CST, 02/28/2016 12:45:06 CST]
2016/02/28 12:45:06 CST : Starting Thread to identify stored files to collect
2016/02/28 12:45:06 CST : Getting List of Files to Collect
2016/02/28 12:45:07 CST : Trimming file : host1/u01/app/11.2.0/grid/log/host1/client/olsnodes.log with original file size : 2.7MB
2016/02/28 12:45:07 CST : Finished Getting List of Files to Collect
2016/02/28 12:45:07 CST : Collecting ADR incident files...
2016/02/28 12:45:07 CST : Waiting for collection of extra files
…
Logs are being collected to: /u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_44_57_CST_2016_node_all
/u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_44_57_CST_2016_node_all/host1.tfa_foo.zip
/u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_44_57_CST_2016_node_all/host2.tfa_foo.zip
2.4.3 收集1個小時的所有節點上數據庫相關的日志,並壓縮放在本地,以test為后綴:
tfactl diagcollect -database orcl -since 1h -z test
[root@host1 oswbb]# tfactl diagcollect -database orcl -since 1h -z test
Collecting data for all nodes
Collection Id : 20160228124936host1
Repository Location in host1 : /u01/app/grid/tfa/repository
Collection monitor will wait up to 30 seconds for collections to start
2016/02/28 12:49:39 CST : Collection Name : tfa_test.zip
2016/02/28 12:49:39 CST : Sending diagcollect request to host : host2
2016/02/28 12:49:40 CST : Scanning of files for Collection in progress...
……
2016/02/28 12:50:01 CST : Total time taken : 22s
2016/02/28 12:50:01 CST : Remote Collection in Progress...
2016/02/28 12:50:20 CST : host2:Completed Collection
2016/02/28 12:50:20 CST : Completed collection of zip files.
Logs are being collected to: /u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_49_36_CST_2016_node_all
/u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_49_36_CST_2016_node_all/host1.tfa_test.zip
/u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_49_36_CST_2016_node_all/host2.tfa_test.zip
2.4.4 收集1個小時的節點host1上的日志
tfactl diagcollect -node host1 -since 1h
[root@host1 oswbb]# tfactl diagcollect -node host1 -since 1h
Collecting data for host1 node(s)
Collection Id : 20160228125644host1
Repository Location in host1 : /u01/app/grid/tfa/repository
Collection monitor will wait up to 30 seconds for collections to start
....
2016/02/28 12:56:48 CST : Collection Name : tfa_Sun_Feb_28_12_56_44_CST_2016.zip
2016/02/28 12:56:48 CST : Scanning of files for Collection in progress...
2016/02/28 12:56:48 CST : Collecting extra files...
.....
Logs are being collected to: /u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_56_44_CST_2016_node_host1
/u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_56_44_CST_2016_node_host1/host1.tfa_Sun_Feb_28_12_56_44_CST_2016.zip
2.4.5 收集所有節點上在"Feb/28/2016"發生的日志
tfactl diagcollect -for "Feb/28/2016"
[root@host1 oswbb]# tfactl diagcollect -for "Feb/28/2016"
Collecting data for all nodes
Scanning files for Feb/28/2016 00:00:00
Collection Id : 20160228125814host1
Repository Location in host1 : /u01/app/grid/tfa/repository
Collection monitor will wait up to 30 seconds for collections to start
2016/02/28 12:58:20 CST : Collection Name : tfa_Sun_Feb_28_12_58_14_CST_2016.zip
2016/02/28 12:58:20 CST : Sending diagcollect request to host : host2
2016/02/28 12:58:20 CST : Scanning of files for Collection in progress...
2016/02/28 12:58:20 CST : Collecting extra files...
.....
Logs are being collected to: /u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_58_14_CST_2016_node_all
/u01/app/grid/tfa/repository/collection_Sun_Feb_28_12_58_14_CST_2016_node_all/host1.tfa_Sun_Feb_28_12_58_14_CST_2016.zip
2.4.6 指定時間區域,對節點1上的ASM的日志進行收集
tfactl diagcollect -asm -node host1 -from "Feb/27/2016" -to "Feb/28/2016 01:00:00"
[root@host1 oswbb]# tfactl diagcollect -asm -node host1 -from "Feb/27/2016" -to "Feb/28/2016 01:00:00"
Collecting data for host1 node(s)
Scanning files from Feb/27/2016 00:00:00 to Feb/28/2016 01:00:00
Collection Id : 20160228130124host1
Repository Location in host1 : /u01/app/grid/tfa/repository
Collection monitor will wait up to 30 seconds for collections to start
2016/02/28 13:01:28 CST : Collection Name : tfa_Sun_Feb_28_13_01_24_CST_2016.zip
2016/02/28 13:01:28 CST : Scanning of files for Collection in progress...
2016/02/28 13:01:28 CST : Collecting extra files...
Logs are being collected to: /u01/app/grid/tfa/repository/collection_Sun_Feb_28_13_01_24_CST_2016_node_host1
/u01/app/grid/tfa/repository/collection_Sun_Feb_28_13_01_24_CST_2016_node_host1/host1.tfa_Sun_Feb_28_13_01_24_CST_2016.zip
通過以上例子,我們可以看到我們可以通過指定一些我們需要的參數來進行日志的過濾和收集,更准確的收集我們需要的日志,避免了通過diagcollection.pl收集上來冗余的無用的日志文件,提高了溝通的效率,簡化了分析難度。
除了我們上述介紹的內容之外,TFA還有一些其它的功能:如,采集AWR的功能,自動收集日志的功能,對非root用戶進行權限控制的功能等等。
3.封裝的新功能
TFA版本從12.1.2.3.0之后封裝了很多現有的Oracle問題分析的工具,包括ORAchk ,EXAchk,OSWatcher,Procwatcher,ORATOP,SQLT,DARDA,alertsummary等等,這些工具我們都可以通過TFACL的接口進行調用,我們可以通過以下方式查看這些封裝的工具以及狀態:
tfactl> toolstatus
.------------------------------------.
| External Support Tools |
+-------+--------------+-------------+
| Host | Tool | Status |
+-------+--------------+-------------+
| host1 | alertsummary | DEPLOYED |
| host1 | exachk | DEPLOYED |
| host1 | ls | DEPLOYED |
| host1 | pstack | DEPLOYED |
| host1 | orachk | DEPLOYED |
| host1 | sqlt | DEPLOYED |
| host1 | grep | DEPLOYED |
| host1 | summary | DEPLOYED |
| host1 | prw | NOT RUNNING |
| host1 | vi | DEPLOYED |
| host1 | tail | DEPLOYED |
| host1 | param | DEPLOYED |
| host1 | dbglevel | DEPLOYED |
| host1 | darda | DEPLOYED |
| host1 | history | DEPLOYED |
| host1 | oratop | DEPLOYED |
| host1 | oswbb | RUNNING |
| host1 | changes | DEPLOYED |
| host1 | events | DEPLOYED |
| host1 | ps | DEPLOYED |
'-------+--------------+-------------'
這里給大家演示幾個常用的調用方式:
3.1 調用orachk:
[root@host1 oswbb]# tfactl
tfactl> orachk
This computer is for [S]ingle instance database or part of a [C]luster to run RAC database [S|C] [C]:C
Unable to determine nodes in cluster. Do you want to enter manually.[y/n][y]y
Enter cluster node names delimited by comma.by defalut localhost will be printed. (eg. node2,node3,node4)
host1,host1,host2
Checking ssh user equivalency settings on all nodes in cluster
Node host2 is configured for ssh user equivalency for root user
CRS binaries found at /u01/app/11.2.0/grid. Do you want to set CRS_HOME to /u01/app/11.2.0/grid?[y/n][y]
Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS
Parsing file host1_iostat_16.02.28.1200.dat ...
Parsing file host1_iostat_16.02.28.1300.dat ...
Parsing file host1_vmstat_16.02.28.1200.dat ...
Parsing file host1_vmstat_16.02.28.1300.dat ...
Parsing file host1_netstat_16.02.28.1200.dat ...
Parsing file host1_netstat_16.02.28.1300.dat ...
Parsing file host1_top_16.02.28.1200.dat ...
Parsing file host1_top_16.02.28.1300.dat ...
Parsing file host1_ps_16.02.28.1200.dat ...
Parsing file host1_ps_16.02.28.1300.dat ...
Parsing Completed.
Enter 1 to Display CPU Process Queue Graphs
Enter 2 to Display CPU Utilization Graphs
Enter 3 to Display CPU Other Graphs
Enter 4 to Display Memory Graphs
Enter 5 to Display Disk IO Graphs
Enter 6 to Generate All CPU Gif Files
Enter 7 to Generate All Memory Gif Files
Enter 8 to Generate All Disk Gif Files
Enter L to Specify Alternate Location of Gif Directory
Enter T to Alter Graph Time Scale Only (Does not change analysis dataset)
Enter D to Return to Default Graph Time Scale
Enter R to Remove Currently Displayed Graphs
Enter A to Analyze Data
Enter S to Analyze Subset of Data(Changes analysis dataset including graph time scale)
Enter P to Generate A Profile
Enter X to Export Parsed Data to File
Enter Q to Quit Program
Please Select an Option:1
3.3調用 Procwatcher
tfactl> prw deploy
Sun Feb 28 13:26:15 CST 2016: Building default prwinit.ora at /u01/app/grid/tfa/repository/suptools/prw/root/prwinit.ora
Clusterware must be running with adequate permissions to deploy, exiting
tfactl> prw start
Sun Feb 28 13:27:00 CST 2016: Starting Procwatcher as user root
Sun Feb 28 13:27:00 CST 2016: Thank you for using Procwatcher.
Sun Feb 28 13:27:00 CST 2016: Please add a comment to Oracle Support Note 459694.1
Sun Feb 28 13:27:00 CST 2016: if you have any comments, suggestions, or issues with this tool.
Procwatcher files will be written to: /u01/app/grid/tfa/repository/suptools/prw/root
Sun Feb 28 13:27:00 CST 2016: Started Procwatcher
tfactl> prw stop
Sun Feb 28 13:27:20 CST 2016: Stopping Procwatcher
Sun Feb 28 13:27:20 CST 2016: Checking for stray debugging sessions...(waiting 1 second)
Sun Feb 28 13:27:21 CST 2016: No debugging sessions found, all good, exiting...
Sun Feb 28 13:27:21 CST 2016: Thank you for using Procwatcher.
Sun Feb 28 13:27:21 CST 2016: Please add a comment to Oracle Support Note 459694.1
Sun Feb 28 13:27:21 CST 2016: if you have any comments, suggestions, or issues with this tool.
Sun Feb 28 13:27:21 CST 2016: Procwatcher Stopped
由於封裝功能比較多,而且Oracle還在進一步增強,我們沒辦法一一列出,但是以上的這些工具的植入調用,我們都可以通過tfactl的接口來簡單的實現,具體用法請參考1513912.2中的解釋.
4 附錄.推薦文檔:
TFA Collector- The Preferred Tool for Automatic or ADHOC Diagnostic Gathering Across All Cluster Nodes [ID 1513912.2]
