Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Use AWK to convert SQLNET (NET8) LEVEL 16 PACKETS TO LONG LINES.
Have you ever wanted to convert somthing like:
nspsend: 00 2F 00 00 06 00 00 00 |./......| nspsend: 00 00 03 03 08 01 00 00 |........| nspsend: 00 20 32 48 00 16 00 00 |. 2H....| nspsend: 00 53 45 4C 45 43 54 20 |.SELECT | nspsend: 55 53 45 52 20 46 52 4F |USER FRO| nspsend: 4D 20 44 55 41 4C 00 00 |M DUAL..|
to:
nspsend:
020000000000000002340100054444525545245442454400
0F0060000033810000280600035C53405352062FD0451C00
./............... 2H.....SELECT USER FROM DUAL..
in order to see (and search for) the full SQL?
Then ftp ascii your files to UNIX,
and use the following AWK script.
e.g. awk -f myfile.awk sqlnet.trc > output.txt
sometime nawk works better than awk.
$0 ~ /\|........\|/ { flag=1 prev = $0 for (i = 0; i < 8; ++i) { T1=T1""substr($0,10+i*3,1) T2=T2""substr($0,11+i*3,1) } i = NF - 1 T3=T3$i next } {if ( flag==1 ) { flag = 0 print substr(prev,1,8)
# print substr(prev,8,8)
print T1 print T2 print T3 print "" T1="";T2="";T3="" } }
Have fun,
Paul Kindervater
Received on Wed Dec 19 2001 - 07:20:42 CST