Enhancements to Oracle trace file conversion and replay #718
Labels
database
Database specific
enhancement
New feature or request
help wanted
Extra attention is needed
tracefile
Is your feature request related to a problem? Please describe.
HammerDB includes as a long-standing feature the option to convert and replay Oracle trace files. Recently there has been interest in this feature e.g. #695, however we know there is an opportunity to improve it.
Describe the solution you'd like
Where there is interest there is the potential to enhance and improve HammerDB Oracle trace conversion and replay to re-run workloads captured from Oracle on Oracle and other databases.
Describe alternatives you've considered
Oracle has the licensed option of RAT (real application testing) although this does not allow replay against other databases and is not open source.
Additional context
This work has been done in the past and there is the opportunity for an interested party to pick it up. In particular, this issue serves to note that there are known issues in the current implementation and highlight these to prevent the assumption that this feature is fully complete and give the opportunity for further discussion and effort to complete it.
As an example the following shows Oracle trace file output as described in the documentation https://www.hammerdb.com/docs/ch14.html.
In the HammerDB GUI in the side menu there is the button "Convert Trace to Oratcl" that is active when Oracle is selected. When a trace file is loaded then pressing this button will convert it into a format that can replayed against the database. The following is an example of tracing the HammerDB TPROC-C workload.
Note that it should be obvious that in many cases simply re-running the same trace against the database will result in errrors. For example if the TPROC-H insert refresh function is traced then replaying the inserts will result in constraint violations. Tracing and converting is intended as a template for building a bespoke test workload.
The following are a list of known enhancements that can do done to improve the conversion of Oracle trace files for replay:
Add Convert Trace to Oratcl option to the CLI - very easy as existing functionality is there.
Run the trace conversion in a separate thread. Do a pre-pass to extract dep=0 and remove recursive SQL.
Convert timestamps from memory dumps dty=180. Note memory dump ordering depends on the machine type and you can get this from the header e.g. x8_64 is little endian. There is a question on the Oracle AskTom site that shows exactly how to do this. For a timestamp you identify the variable as a TIMESTAMP (dty=180), and convert a dump of three memory locations:
Example Perl program that does this:
the actual value which is being inserted is available and is highlighted on the second line after the "value=" line.
so would be converted if formatted as follows:
• The string "dty=23" indicates that the value is a RAW datatype.
• The "Dump of memory" line must be discarded.
• The value is a hex value which will get implicitly converted to the RAW value by Oracle.
• The space between the first and last 8 characters must be removed.
• The value must be placed in " " and included after the "value=" string.
Ref-cursor variables returned by oraplexec must be specified as a currently open statement handle from the same logon connection:
EXEC#140104750370288:c=2298,e=1806,p=0,cr=0,cu=0,mis=0,r=1,dep=1,og=4,plh=0,tim=1513246662
http://www.juliandyke.com/Presentations/Presentations.html#IsRATWorthCatching
Improve special character handling. $ "" i.e. empty bind variable and NULL to {} were examples:
Enable option to convert trace format to other databases.
The text was updated successfully, but these errors were encountered: