Purpose:
This Perl script will extract the SQL Statements out of an Oracle 10046 Trace File.
Usage:
trc2sql.pl < input.trc > output.sql
Source Code
trc2sql.pl :
#!/usr/bin/perl
# David Mann
# ba6.us
# Extract SQL from an Oracle SQL Trace File (10046)
#
# Usage:
# Data is read from STDIN
# trc2sql.pl < input.trc > output.sql
#
# Change log:
# 13-OCT-2011 : Release
$InSQL = 0;
while (<>) {
$MyLine = $_;
$LineNum = $LineNum + 1;
# If END OF STMT found, stop printing