oracle_TFA介绍以及相关操作
(2016-06-05 23:58:51)
标签:
tfadiagracitinit |
分类: oracleops |
TFA
- Trace File Analyzer Collector.
One of the biggest challenges for customers and support
engineers particularly when working Grid
Infrastructure (GI) and Real Applications Clusters (RAC)
issues is collecting pertinent data in a timely
fashion possibly across multiple nodes in a cluster. A big
part of this challenge is frequently the data
that is required is lost or overwritten, due to the diagnostic
collection not happening until sometime afterthe problem occurred.
For single Instance databases Automatic Diagnostic Repository (ADR)
does a good job of generating trace packages when a database
incident occurs, but ADR does not include
clusterware trace files and is currently not RAC aware. For
the clusterware the diagcollection tool
(diagcollection.pl) gathers all the logs when manually
requested to do so, and though this tool has proved to be useful,
it is run sometime after the problem has occurred and is generally
run to gather all possible logs without regard to their relevance
which can make the data set very large. Further it has to be run as
root across all nodes of a cluster which makes it more difficult to
manage from an operational perspective.
TFA Collector (from this point referred to as TFA) overcomes
some of these problems by running a
diagnostic JVM on each node in the cluster synchronized to
determine when diagnostic collection is
required (when enabled) as well as collecting and extracting
only the data that is pertinent to resolving the issue. TFA is
written outside of the GI/RAC/RDBMS product lines and as such could
be used for any
trace data, and is version and platform agnostic.
It is possible to limit the amount of space TFA will take up
for diagnostics by setting a maximum size.
TFA stores any metadata that it needs to persist in a Berkeley
Database (BDB) that is placed under the
TFA_HOME. The metadata for files and their events will be
stored until the file is physically deleted or
the directory it resides in is removed from TFA. TFA monitors
free space and will halt data collections
free space falls below 1GB in the TFA_HOME file system or the
repository hits its maximum repository
size.
上面是USER
GUIDE中的介绍,TFA会自动收集诊断信息,比diagcollection.pl收集更全和灵活,且是相关连收集。使用Berkeley
Database (BDB
文件数据库,嵌入式数据库)。安装环境支持大部分操作系统,只要安装bash
shell即可。
在安装11.2.0.4时执行root.sh后,会默认安装tfa,当然可以不安装。
#cat /etc/inittab =-for aix
h1:2:respawn:/etc/init.ohasd run >/dev/null 2>&1
htfa:2:respawn:/etc/init.tfa run >/dev/null 2>&1
# Setup TFA
# setup_tfa ();
start
Starts
TFA
stop
Stops
TFA
enable
Enable TFA Auto restart
disable
Disable TFA Auto restart
print
Print
requested details
access
Add or Remove or List TFA
Users and Groups
purge
Delete
collections from TFA repository
directory
Add or Remove or Modify directory in TFA
host
Add or
Remove host in TFA
diagcollect
Collect logs from across nodes in cluster
collection
Manage TFA Collections
analyze
List events summary and search
strings in alert logs.
set
Turn ON/OFF or Modify various TFA features
toolstatus
Prints the status of TFA Support Tools
run
Run the desired support tool
start
Starts the desired support tool
stop
Stops the desired support tool
uninstall
Uninstall TFA from this
node
diagnosetfa
Collect TFA Diagnostics
$GRID_HOME/crs/install/crsconfig_lib.pm --Library module for
root scripts
root.sh脚本中运行的安装的模块,对相应的部分进行注释,不安装此模块。
set_bold reset_bold InitEnv --删除tfa setup_tfa
remove_tfa
$GRID_HOME/crs/install/crsdelete.pm - root deconfig script for
Oracle Clusterware.
同时也要讲删除脚本中的相应行注释,以便后续能顺利卸载。
$GRID_HOME/crs/install/rootcrs.pl - root configuration script
for Oracle Clusterware home
root.sh脚本执行的配置文件,屏蔽tfa的安装。
$GRID_HOME/crs/install/rootcrs.pl
[root@grid1 11.2.0]# sh root.sh
Configure Oracle Grid Infrastructure for a Cluster ...
succeeded
[root@grid1 11.2.0]#$GRID_HOME; ls -ltr|grep tfa
drwxr-xr-x 2 grid oinstall
4096 Jun 5 09:10 tfa.bak
[root@grid1 11.2.0]# ps -ef|grep init
root
1 0
0 14:21 ?
00:00:00 /sbin/init
root 18671
1 0 15:42 ?
00:00:00 /bin/sh /etc/init.d/init.ohasd run
root 31073
2204 0 15:48 pts/2
00:00:00 grep init
[root@grid1 11.2.0]# cd /etc/init.d
[root@grid1 init.d]# ls -l|grep tfa
[root@grid1 init.d]#
对相应文件进行修改后,执行root.sh脚本,在对应位置已经没有了tfa的任何信息;
手工安装tfa
[root@grid1 install]# sh tfa_setup.sh -silent -crshome
/u01/app/grid/11.2.0
Starting TFA installation
Using JAVA_HOME : /u01/app/grid/11.2.0/jdk/jre
Running Auto Setup for TFA as user root...
Installing TFA now...
TFA Will be Installed on grid1...
TFA will scan the following Directories
++++++++++++++++++++++++++++++++++++++++++++
.----------------------------------------------------.
|
grid1
|
+-----------------------------------------+----------+
| Trace Directory
| Resource |
+-----------------------------------------+----------+
| /u01/app/grid/11.2.0/OPatch/crs/log
| CRS
|
| /u01/app/grid/11.2.0/cfgtoollogs
| CFGTOOLS
|
| /u01/app/grid/11.2.0/crf/db/grid1
| CRS
|
| /u01/app/grid/11.2.0/crs/log
| CRS
|
| /u01/app/grid/11.2.0/cv/log
| CRS
|
| /u01/app/grid/11.2.0/evm/admin/log
| CRS
|
| /u01/app/grid/11.2.0/evm/admin/logger |
CRS |
| /u01/app/grid/11.2.0/evm/log
| CRS
|
| /u01/app/grid/11.2.0/install
| INSTALL
|
| /u01/app/grid/11.2.0/log
| CRS
|
| /u01/app/grid/11.2.0/network/log
| CRS
|
| /u01/app/grid/11.2.0/oc4j/j2ee/home/log | DBWLM
|
| /u01/app/grid/11.2.0/opmn/logs
| CRS
|
| /u01/app/grid/11.2.0/racg/log
| CRS
|
| /u01/app/grid/11.2.0/rdbms/log
| ASM
|
| /u01/app/grid/11.2.0/scheduler/log
| CRS
|
| /u01/app/grid/11.2.0/srvm/log
| CRS
|
| /u01/app/oraInventory/ContentsXML
| INSTALL
|
| /u01/app/oraInventory/logs
| INSTALL
|
'-----------------------------------------+----------'
Installing TFA on grid1:
HOST: grid1 TFA_HOME:
/u01/app/grid/11.2.0/tfa/grid1/tfa_home
.--------------------------------------------------------------------------.
| Host | Status of TFA | PID
| Port | Version
| Build ID
|
+-------+---------------+-------+------+------------+----------------------+
| grid1 | RUNNING
| 31398 | 5000 | 12.1.2.5.1 |
12125120150818011848 |
'-------+---------------+-------+------+------------+----------------------'
Running Inventory in All Nodes...
Enabling Access for Non-root Users on grid1...
Adding default users and groups to TFA Access list...
Unable to add user 'oracle'. Please try later
Summary of TFA Installation:
.---------------------------------------------------------------.
|
grid1
|
+---------------------+-----------------------------------------+
| Parameter
| Value
|
+---------------------+-----------------------------------------+
| Install location |
/u01/app/grid/11.2.0/tfa/grid1/tfa_home |
| Repository location | /u01/app/11.2.0/tfa/repository
|
| Repository usage | 0 MB
out of 5979 MB
|
'---------------------+-----------------------------------------'
Installing oratop extension..
TFA is successfully installed...
Usage : /u01/app/grid/11.2.0/bin/tfactl [options]
=
For help with a command: /u01/app/grid/11.2.0/bin/tfactl
-help
[root@grid1 init.d]# pwd
/etc/init.d
[root@grid1 init.d]# ls -l|grep tfa
-rwxr-xr-x 1 root root 11725 Jun
5 15:53 init.tfa
[root@grid1 init.d]# cd $ORACLE_HOME
[root@grid1 11.2.0]# ls -l|grep tfa
drwxr-xr-x 4 root root
4096 Jun 5
15:53 tfa
drwxr-xr-x 2 grid oinstall
4096 Jun 5 09:10 tfa.bak
[root@grid1 11.2.0]# ps -ef|grep init
root
1 0
0 14:21 ?
00:00:00 /sbin/init
root 18671
1 0 15:42 ?
00:00:00 /bin/sh /etc/init.d/init.ohasd run
root 31302
1 0 15:53 ?
00:00:00 /bin/sh /etc/init.d/init.tfa run
root 32503
2204 0 15:54 pts/2
00:00:00 grep init
--禁用
[root@grid1 bin]# ./tfactl disable
TFA autostart has been disabled ..
[root@grid1 bin]# ./tfactl stop
Stopping TFA
TFA-00002 : Oracle Trace File Analyzer (TFA) is not
running
TFAmain Force Stopped Successfully
. . .
Successfully stopped TFA..
[root@grid1 bin]# /etc/init.d/init.tfa
shutdown
Shutting down TFA
oracle-tfa stop/waiting
. . . . .
. . .
Successfully shutdown TFA..
[root@grid1 bin]# ps -ef|grep init
root
1 0
0 08:07 ?
00:00:00 /sbin/init
root
1193 1
0 08:08 ?
00:00:00 /bin/sh
/etc/init.d/init.ohasd run
root
6464 2416 0
08:51 pts/0 00:00:00 grep
init
[root@grid1 bin]#
--启用
[root@grid1 bin]# ./tfactl enable
TFA autostart has been enabled ..
[root@grid1 bin]# /etc/init.d/init.tfa
start
Starting TFA..
oracle-tfa start/running, process 3089
Waiting up to 100 seconds for TFA to be started..
. . . . .
Successfully started TFA Process..
. . . . .
TFA Started and listening for commands
[root@grid1 bin]# ps -ef|grep init
root
1 0
0 08:07 ?
00:00:00 /sbin/init
root
1193 1
0 08:08 ?
00:00:00 /bin/sh
/etc/init.d/init.ohasd run
root
3089 1
0 08:42 ?
00:00:00 /bin/sh
/etc/init.d/init.tfa run
root
3870 2416 0
08:44 pts/0 00:00:00 grep
init
由于tfa不随GI启动和关闭,
故在打patch时,需要先将其关闭
/etc/init.d/init.tfa stop