{"id":2576,"date":"2012-11-09T15:03:18","date_gmt":"2012-11-09T20:03:18","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=2576"},"modified":"2012-11-09T15:03:18","modified_gmt":"2012-11-09T20:03:18","slug":"tracing-sql-across-the-wire","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2012\/11\/09\/tracing-sql-across-the-wire\/","title":{"rendered":"Tracing SQL across the wire"},"content":{"rendered":"<p>This can be really useful in place of database tracing, especially when you want to see the action the *application* takes, and not just what it does in the database.<\/p>\n<pre lang=\"text\">\r\n[user@************** common]# tcpdump -A -nn port 1521 | \\\r\n>                               awk '{if (tolower($0) ~ \"select\" || tolower($0) ~ \"update\") {p=1;print} \\\r\n>                                     else if(p == 1 && $0 !~ \"^[0-9][0-9]:\") {print} \\\r\n>                                     else if ($0 ~ \"^[0-9][0-9]:\") {p=0}}'\r\ntcpdump: verbose output suppressed, use -v or -vv for full protocol decode\r\nlistening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes\r\n.......................SELECT t1.config_path,t1.content_id\r\n   FROM srch_config t1\r\n  WHERE ((t1.uniq_server_id IS NULL)\r\n    OR (:1  = t1.uniq_server_id)).................... .......i....__NULL__\r\n.......................SELECT t1.config_path,t1.content_id\r\n   FROM srch_config t1\r\n  WHERE ((t1.uniq_server_id IS NULL)\r\n    OR (:1  = t1.uniq_server_id)).................... .......i....__NULL__\r\n.......................SELECT t1.config_path,t1.content_id\r\n   FROM srch_config t1\r\n  WHERE (NOT ((t1.uniq_server_id IS NULL))\r\n    AND NOT ((:1  = t1.uniq_server_id))).................... .......i....__NULL__\r\n.......................SELECT t1.config_path,t1.content_id,t1.generation,t1.claimed_generation,t1.nxt_inc_generation,t1.uniq_server_id,t1.last_activity,t1.last_full_index,t1.last_incr_index\r\n   FROM srch_config t1\r\n  WHERE ((t1.config_path = :1  AND t1.content_id = :2 ))............................i...............i...-\/atg\/userprofiling\/search\/ProfileOutputConfig.DEFAULT\r\n.......................SELECT t1.config_path,t1.content_id\r\n   FROM srch_config t1\r\n  WHERE ((t1.uniq_server_id IS NULL)\r\n    OR (:1  = t1.uniq_server_id)).................... .......i....__NULL__\r\n.......................SELECT t1.config_path,t1.content_id\r\n   FROM srch_config t1\r\n  WHERE ((t1.uniq_server_id IS NULL)\r\n    OR (:1  = t1.uniq_server_id)).................... .......i....__NULL__\r\n.......................SELECT t1.config_path,t1.content_id\r\n   FROM srch_config t1\r\n  WHERE ((t1.uniq_server_id IS NULL)\r\n    OR (:1  = t1.uniq_server_id)).................... .......i....__NULL__\r\n.......................SELECT t1.config_path,t1.content_id\r\n   FROM srch_config t1\r\n  WHERE ((t1.uniq_server_id IS NULL)\r\n    OR (:1  = t1.uniq_server_id)).................... .......i....__NULL__\r\n...........................UPDATE dms_queue_entry  SET handling_client_id = :1 ,      read_state = :2   WHERE handling_client_id < 0    AND delivery_date < :3     AND queue_id IN (SELECT qr.queue_id                     FROM dms_queue_recv qr                     WHERE qr.client_id = :4 ) ...........................i..............i..............i..............i.....^)............$.\\.+..^)..\r\n...........................UPDATE dms_topic_entry SET read_state = :1  WHERE delivery_date < :2    AND read_state = 0   AND subscriber_id IN (SELECT ts.subscriber_id                         FROM dms_topic_sub ts                         WHERE ts.client_id = :3                            AND ts.active = 1) ...........................i..............i..............i.............$.\\.+...^)..\r\n.......................SELECT t1.config_path,t1.content_id\r\n   FROM srch_config t1\r\n  WHERE ((t1.uniq_server_id IS NULL)\r\n    OR (:1  = t1.uniq_server_id)).................... .......i....__NULL__\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This can be really useful in place of database tracing, especially when you want to see the action the *application* takes, and not just what it does in the database. [user@************** common]# tcpdump -A -nn port 1521 | \\ >&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2012\/11\/09\/tracing-sql-across-the-wire\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[28,27],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2576"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2576"}],"version-history":[{"count":5,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2576\/revisions"}],"predecessor-version":[{"id":2581,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2576\/revisions\/2581"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2576"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}