Sunday, April 19, 2020

Unpublished Syntax for Oracle "dbaas_diag_tool.pl" Script For Diagnostic Collection

Oracle cloud presents a lot of new tooling and scripts, with enhancements and refinements occurring almost daily.  I recently had to work a support request (SR) and was asked by the Oracle support engineer to do an environment collection using a tool called dbaas-diag-tool.  This tool is actually a perl script and will be located here on Oracle provisioned exa-Cloud linux servers:

/var/opt/oracle/misc/dbaas_diag_tool.pl

There was an Exadata compute node which rebooted during a patching event.  So we opened a support request for direction, as the patch failed.  The request from support was to run the tool and collect diagnostic information from a "four hour window around the event".  However, the syntax supplied only includes syntax for days of collection, not hourly.  So I tried to collect syntax documentation from various sources, without much info.  Here is what a syntax help request returns:

# /var/opt/oracle/misc/dbaas_diag_tool.pl --help
Usage: perl /var/opt/oracle/misc/dbaas_diag_tool.pl \
            [-help|-h|-?] [--envtype ] [--dbname ] [--operation collect] [--gettfalogs ] [--getdbaaslogsonly ]  [ --diagdir
 Example:
         perl /var/opt/oracle/misc/dbaas_diag_tool.pl
         perl /var/opt/oracle/misc/dbaas_diag_tool.pl -h
         perl /var/opt/oracle/misc/dbaas_diag_tool.pl --envtype DBCS
         perl /var/opt/oracle/misc/dbaas_diag_tool.pl --healthcheck
         perl /var/opt/oracle/misc/dbaas_diag_tool.pl --envtype DBCS --operation collect
         perl /var/opt/oracle/misc/dbaas_diag_tool.pl --starttime YYYY-MM-DD
         perl /var/opt/oracle/misc/dbaas_diag_tool.pl --starttime YYYY-MM-DD --endtime YYYY-MM-DD
         perl /var/opt/oracle/misc/dbaas_diag_tool.pl --getdbaaslogsonly True|False
Note: Currently tool only supports envtype and operation
Note: TFA Logs are collected only if getTFALogs is set to True. By default it is False
Note: dbname is relevant only for envtype and ignored in other environments


Note that the syntax specifies "starttime" and "endtime" but does not give the format for time in hours, minutes or seconds?  Even the request from the engineer did not include the syntax for such granularity.  Left to ponder this, after trying help, above, I referenced various support documents, without success.  
Doc ID 2219712.1 seemed promising, but only contained information for collecting "TFA logs".  Another document (Doc ID 2094679.1)  seemed promising, but also did not include the needed syntax.   I even reviewed the perl script itself, however, it makes many calls to unpublished subroutines, so I didn't get anywhere.  

However, I did notice that the output log file from the process includes the date, in the same format, with an underscore and colon between each value, so I tried that.  Alas, no luck.  However, within the code was the following one-line hint:

 my ($date_out, $date_err) = $LOG->logexe("date \+\'\%Y\-\%m\-\%d \%H\-\%M\-\%S\'");

This syntax is what will work.  Notice double-quote delimiters are required around starttime and endtime because a space must be imbedded between day and hour:

/var/opt/oracle/misc/dbaas_diag_tool.pl --starttime "2020-04-18 10:00:00" --endtime "2020-04-18 14:00:00"

So, in the end, Oracle should probably update their documentation to include this syntax.  I hope this will help if you need to run this useful utility.  

No comments:

Post a Comment