Thursday, 25 May 2023

Harnessing tfactl for Diagnostic Data Collection

 If you're managing Oracle Grid Infrastructure (GI), Automatic Storage Management (ASM), or Real Application Clusters (RAC), you know that issues can pop up unexpectedly. Enter tfactl, a powerful tool for collecting diagnostic data to troubleshoot these components. Let's dive into how to locate and use tfactl effectively, turning troubleshooting from a headache into a breeze.

Locating the executable
Before we can use tfactl, we need to find it. Typically, it resides in your Oracle home directory. Here’s a quick way to locate it:

locate tfactl

/u01/app/19.0.0/grid/bin/tfactl
/u01/app/19.0.0/grid/suptools/tfa/release/tfa_home/bin/tfactl
/u01/app/19.0.0/grid/suptools/tfa/release/tfa_home/bin/tfactl.bat.tmpl
/u01/app/19.0.0/grid/suptools/tfa/release/tfa_home/bin/tfactl.pl
/u01/app/19.0.0/grid/suptools/tfa/release/tfa_home/bin/tfactl.tmpl

The main executable we’re interested in is typically /u01/app/19.0.0/grid/bin/tfactl.

Collecting the diagnostic data
To collect diagnostic data, you’ll use the diagcollect command within tfactl. This command allows you to specify a time range for the data you need. Here’s the general syntax:

GI_HOME/tfa/bin/tfactl diagcollect -from "MMM/dd/yyyy hh:mm:ss" -to "MMM/dd/yyyy hh:mm:ss"

Example
Here’s a real-world example of running the diagcollect command:

/u01/app/19.0.0/grid/bin/tfactl diagcollect -from "May/12/2023 06:00:00" -to "May/12/2023 07:00:00"



Collecting data for all nodes
Scanning files from May/12/2023 06:00:00 to May/12/2023 07:00:00

Collection Id : 202305120607wmptc01

Detailed Logging at : /u01/app/grid/tfa/repository/collection_Wed_May_12_06_34_07_GMT_2023_node_all/diagcollect_202305120607_wmptc01.log
2023/05/12 07:14:22 GMT : NOTE : Any file or directory name containing the string .com will be renamed to replace .com with dotcom
2023/05/12 07:14:22 GMT : Collection Name : tfa_Wed_May_08_08_34_08_GMT_2023.zip
2023/05/12 07:14:22 GMT : Collecting diagnostics from hosts : [ibrac02, ibrac01]
2023/05/12 07:14:22 GMT : Scanning of files for Collection in progress...
2023/05/12 07:14:22 GMT : Collecting additional diagnostic information...
2023/05/12 07:16:07 GMT : Getting list of files satisfying time range [05/12/2023 06:00:00 GMT, 05/12/2023 07:00:00 GMT]
2023/05/12 07:17:40 GMT : Completed collection of additional diagnostic information...
2023/05/12 07:19:23 GMT : Collecting ADR incident files...
2023/05/12 07:19:23 GMT : Completed Local Collection
2023/05/12 07:19:23 GMT : Remote Collection in Progress...
.-------------------------------------------------------------------.
|                         Collection Summary                        |
+---------+------------------------------------------+-------+------+
| Host    | Status                                   | Size  | Time |
+---------+------------------------------------------+-------+------+
| wmptc02 | Failed Unable to connect to Node ibrac02 |       |      |
| wmptc01 | Completed                                | 247MB | 421s |
'---------+------------------------------------------+-------+------'

Logs are being collected to: /u01/app/grid/tfa/repository/collection_Wed_May_12_06_34_07_GMT_2023_node_all
/u01/app/grid/tfa/repository/collection_Wed_May_12_06_34_07_GMT_2023_node_all/wmptc01.tfa_Wed_May_12_06_34_07_GMT_2023.zip



Interpreting the output
The output provides a comprehensive summary of the data collection process:

Collection Id: Unique identifier for the data collection session.
Detailed Logging: Path to the log file containing detailed information about the collection.
Collection Name: The name of the zip file containing the collected data.
Host Status: Status of data collection for each host. In this case, it completed for wmptc01 but failed for wmptc02 due to connectivity issues.
Log Directory: Path to the directory where the logs and collected data are stored.

Conclusion
Using tfactl for diagnostic data collection is a powerful way to troubleshoot issues in Oracle GI, ASM, and RAC. By specifying a time range and utilizing diagcollect, you can gather relevant data efficiently and effectively. Next time you're faced with a problem, let tfactl be your go-to tool for swift and comprehensive diagnostics.

Happy troubleshooting! ✨



No comments:

Post a Comment