tcpdump to see Oracle errors

Not all exceptions are created equally, and most you can ignore (the one below you can, in general). However, if you have to troubleshoot on JBOSS (or anywhere a Linux application connects to an Oracle database), what is below is a good “quicky” command the root user can run to quickly dump the Oracle exceptions being thrown back over the wire.

tcpdump -i eth1 tcp port 1521 -A -s1500 | awk '$1 ~ "ORA-" {i=1;split($1,t,"ORA-");while (i <= NF) {if (i == 1) {printf("%s","ORA-"t[2])}else {printf("%s ",$i)};i++}printf("\n")}'

…with the output below…

[root@cmhlqecomecm01 ~]# tcpdump -i eth1 tcp port 1521 -A -s1500 | awk '$1 ~ "ORA-" {i=1;split($1,t,"ORA-");while (i <= NF) {if (i == 1) {printf("%s","ORA-"t[2])}else {printf("%s ",$i)};i++}printf("\n")}'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 1500 bytes
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found

Just something to put in your toolkit.

2 comments for “tcpdump to see Oracle errors

  1. Colin Hines
    June 29, 2016 at 9:57 AM

    You made my day with this! Thanks!

  2. Victor Gomoiu
    March 30, 2020 at 7:15 AM

    Amazing, thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.