TFA 在 18.3 下的使用之一 隨庫安裝
阿新 • • 發佈:2018-11-28
os: centos 7.4
db: oracle 18c(18.3)
TFA 全稱是 Oracle Trace File Analyzer (TFA),是一款非常好用的工具集。
提供 隨庫安裝和獨立安裝 兩種安裝方式。
隨資料庫軟體一起安裝
安裝oracle 18.3軟體的最後一步,需要以root使用者執行兩個指令碼:
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/18.3.0/db_1/root.sh
執行第二個指令碼時會提示是否安裝TFA。
# /u01/app/oracle/product/18.3.0/db_1/root.sh Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] : yes Installing Oracle Trace File Analyzer (TFA). Log File: /u01/app/oracle/product/18.3.0/db_1/install/root_18c3node1_2018-11-22_16-15-14-147399837.log Finished installing Oracle Trace File Analyzer (TFA) fa_install_13325_2018_11_22-16_15_26.log
Starting TFA installation TFA Version: 181000 Build Date: 201712032224 Running Auto Setup for TFA as user root... Installing TFA now... TFA Will be Installed on 18c3node1... TFA will scan the following Directories ++++++++++++++++++++++++++++++++++++++++++++ .------------------------------------------------------------. | 18c3node1 | +-------------------------------------------------+----------+ | Trace Directory | Resource | +-------------------------------------------------+----------+ | /u01/app/oraInventory/ContentsXML | INSTALL | | /u01/app/oraInventory/logs | INSTALL | | /u01/app/oracle/cfgtoollogs | INSTALL | | /u01/app/oracle/diag | RDBMS | | /u01/app/oracle/product/18.3.0/db_1/cfgtoollogs | INSTALL | | /u01/app/oracle/product/18.3.0/db_1/install | INSTALL | | /u01/app/oracle/product/18.3.0/db_1/rdbms/log | RDBMS | | /u01/app/oracle/product/18.3.0/db_1/rdbms/trace | RDBMS | '-------------------------------------------------+----------' Installing TFA on 18c3node1: HOST: 18c3node1 TFA_HOME: /u01/app/oracle/tfa/18c3node1/tfa_home .-------------------------------------------------------------------------------. | Host | Status of TFA | PID | Port | Version | Build ID | +-----------+---------------+-------+-------+------------+----------------------+ | 18c3node1 | RUNNING | 13722 | 46405 | 18.1.0.0.0 | 18100020171203222424 | '-----------+---------------+-------+-------+------------+----------------------' Running Inventory in All Nodes... Enabling Access for Non-root Users on 18c3node1... Summary of TFA Installation: .--------------------------------------------------------------. | 18c3node1 | +---------------------+----------------------------------------+ | Parameter | Value | +---------------------+----------------------------------------+ | Install location | /u01/app/oracle/tfa/18c3node1/tfa_home | | Repository location | /u01/app/oracle/tfa/repository | | Repository usage | 0 MB out of 10240 MB | '---------------------+----------------------------------------' TFA is successfully installed... Moving Install log file to /u01/app/oracle/tfa/18c3node1/log
TFA安裝在 $ORACLE_BASE/tfa/$HOSTNAME/tfa_home 目錄下,即TFA_HOME=/u01/app/oracle/tfa/18c3node1/tfa_home
# cd /u01/app/oracle/tfa # ls -l total 0 drwxr-xr-x 8 root root 220 Nov 22 16:15 18c3node1 drwxr-xr-x 2 root root 20 Nov 22 16:15 bin drwxr-xr-t 3 root root 22 Nov 22 16:15 repository # cd /u01/app/oracle/tfa/18c3node1/tfa_home # ls -l total 48 drwxr-x--x 8 root root 4096 Nov 22 16:15 bin -rwx------ 1 root root 3272 Nov 22 16:15 client.jks -rwx------ 1 root root 939 Nov 22 16:15 client_pub.crt drwxr-xr-x 26 root root 4096 Nov 22 16:15 ext drwxr-x--- 2 root root 187 Nov 22 16:15 install drwxr-x--x 3 root root 4096 Nov 23 09:40 internal drwxr-x--x 2 root root 230 Nov 22 16:15 jlib drwxr-x--x 5 root root 185 Nov 22 16:15 jre drwxr-x--x 5 root root 39 Nov 22 16:15 perl -rw------- 1 root root 3267 Nov 22 16:15 public.jks drwxr-x--- 3 root root 22 Nov 22 16:15 receiver drwxr-xr-x 3 root root 4096 Nov 22 16:20 resources -rwx------ 1 root root 3270 Nov 22 16:15 server.jks -rwx------ 1 root root 939 Nov 22 16:15 server_pub.crt -rw-r----- 1 root root 1713 Nov 22 16:36 tfa_directories.txt -rwxr-x--- 1 root root 3262 Nov 22 16:15 tfa.jks -rw-r--r-- 1 root root 0 Nov 23 09:40 tfa.lock -rw-r--r-- 1 root root 786 Nov 22 16:26 tfa_setup.txt drwxr-xr-x 2 root root 6 Nov 22 16:20 tmp
配置隨OS啟動
# systemctl status oracle-tfa.service
# systemctl enable oracle-tfa.service
tfactl
# /u01/app/oracle/tfa/18c3node1/tfa_home
# ./bin/tfactl
WARNING - TFA Software is older than 180 days. Please consider upgrading TFA to the latest version.
tfactl>
tfactl> help
Usage : /u01/app/oracle/tfa/bin/tfactl <command> [options]
commands:diagcollect|collection|analyze|ips|run|start|stop|enable|disable|status|print|access|purge|directory|host|receiver|set|toolstatus|uninstall|diagnosetfa|syncnodes
For detailed help on each command use:
/u01/app/oracle/tfa/bin/tfactl <command> -help
怎麼又到 /u01/app/oracle/tfa/bin/tfactl 這去了?
檢視狀態
tfactl> status
.-------------------------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID | Inventory Status |
+-----------+---------------+------+-------+------------+----------------------+------------------+
| 18c3node1 | RUNNING | 6438 | 37146 | 18.1.0.0.0 | 18100020171203222424 | COMPLETE |
'-----------+---------------+------+-------+------------+----------------------+------------------'
顯示資訊
tfactl> print
Print requested details.
Usage : /u01/app/oracle/tfa/bin/tfactl print <command> [options]
commands:status|components|config|directories|hosts|receivers|collectors|robjects|actions|repository|runmode|suspendedips|protocols
For detailed help on each command use:
/u01/app/oracle/tfa/bin/tfactl print <command> -help
建議 print 每個 option 都執行一下,看看資訊,增進對TFA的瞭解。
參考: