{"id":1,"date":"2010-02-25T23:54:59","date_gmt":"2010-02-25T23:54:59","guid":{"rendered":"http:\/\/sqlornosql.10sa.com\/?p=1"},"modified":"2010-09-09T08:18:07","modified_gmt":"2010-09-09T08:18:07","slug":"hello-world","status":"publish","type":"post","link":"http:\/\/10sa.com\/sql_stories\/?p=1","title":{"rendered":"Firebird 1.5.x. Blackbox."},"content":{"rendered":"<p>Hi,<br \/>\nLast time I have been forced to administrate Firebird in version 1.5. My main problem was that lack of knowledge what this system actually is doing, what kind of SQL is executed, which machines request server to response. Unfortunatelly, my internet explorations about this gave me clear answer: Firebird in this version is &#8220;blackbox&#8221;.<\/p>\n<p>My own solution to this inconvenience was operating system tool called strace and thanks to these instructions I was able to see much more&#8230;<\/p>\n<pre lang=\"bash\">\r\npgrep -u firebird -f fbserver | xargs strace -s 512 -v -tt -e trace=\"accept,recv,select\" \\\r\n-o \/tmp\/strace-fbserver -p ;\r\ntail -f \/tmp\/strace-fbserver | sed 's\/\\\\0\/\/g' | sed 's\/\\\\\/\/g' | \\\r\ngrep -e \"select\\|execute\"\r\n<\/pre>\n<p>While reading some articles about MySQL I found a very interesting solution on base of view of network traffic. Source: <a href=\"http:\/\/www.mysqlperformanceblog.com\/2008\/11\/07\/poor-mans-query-logging\/\">mysqlperformanceblog <\/a><\/p>\n<pre lang=\"bash\">\r\ntcpdump -i eth0 -s 0 -l -w - dst port 3050 | strings | perl -e '\r\nwhile(<>) { chomp; next if \/^[^ ]+[ ]*$\/;\r\nif(\/^(SELECT|UPDATE|DELETE|INSERT|SET|COMMIT|ROLLBACK|CREATE|DROP|ALTER)\/i) {\r\nif (defined $q) { print \"$q\\n\"; }\r\n$q=$_;\r\n} else {\r\n$_ =~ s\/^[ \\t]+\/\/; $q.=\" $_\";\r\n}\r\n}'\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to trace Firebird on Linux to discover what queries \/ procedures are executed, which machines are connected to and more with strace and tcpdump.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,3],"tags":[4,5],"_links":{"self":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/1"}],"collection":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1"}],"version-history":[{"count":23,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":3,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions\/3"}],"wp:attachment":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}