{"id":23,"date":"2017-04-04T10:28:26","date_gmt":"2017-04-04T10:28:26","guid":{"rendered":"http:\/\/www.yohz.com\/blogs\/?p=23"},"modified":"2017-04-04T10:28:26","modified_gmt":"2017-04-04T10:28:26","slug":"sql-multi-select-use-case","status":"publish","type":"post","link":"https:\/\/www.yohz.com\/blogs\/2017\/04\/04\/sql-multi-select-use-case\/","title":{"rendered":"SQL Multi Select use case"},"content":{"rendered":"<p>If you have manage multiple databases in your work, there would have been occasions where you needed to run the same set of queries against multiple databases or database servers. \u00a0The regular and tedious way to do this would have been to connect to each database\/server, run your query, log the results, and move on to the next database\/server.<\/p>\n<p><a href=\"http:\/\/www.yohz.com\/sms_details.htm\">SQL Multi Select<\/a> removes the tedium of the above process. \u00a0Basically, you set up a list of all the servers you manage in your environment. \u00a0You then group these servers by function (each server can exist in multiple groups). \u00a0For example, you may have a group containing just your development servers, another group for your production servers etc.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-61\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_01.png\" alt=\"\" width=\"542\" height=\"422\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_01.png 542w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_01-300x234.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_01-150x117.png 150w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/p>\n<p>Now, you can run a query, or a set of queries, against these server groups. \u00a0The results of these queries are consolidated in a single result set, so you can easily compare the results across different servers. \u00a0For ad-hoc queries, this makes it easy to run the same query on multiple database\/servers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-62\" src=\"http:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_02.png\" alt=\"\" width=\"796\" height=\"534\" srcset=\"https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_02.png 796w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_02-300x201.png 300w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_02-768x515.png 768w, https:\/\/www.yohz.com\/blogs\/wp-content\/uploads\/2017\/04\/sms_overview_02-150x101.png 150w\" sizes=\"(max-width: 796px) 100vw, 796px\" \/><\/p>\n<p>You may also have queries you run repeatedly e.g. queries to check database sizes, server statuses etc. \u00a0You can use the SQL Multi Select command line interface (available only in the Standard and Professional editions) to run these queries in a scheduled job, and have the results saved in text files or in a SQLite database.<\/p>\n<p><a href=\"http:\/\/www.yohz.com\/sms_details.htm\">SQL Multi Select<\/a> supports PostgreSQL, MySQL, and Oracle databases. \u00a0All server groups will contain servers of the same type, so for example, you cannot mix MySQL and Oracle servers in the same query group.<\/p>\n<div class=\"fcbkbttn_buttons_block\" id=\"fcbkbttn_left\"><div class=\"fcbkbttn_like \"><fb:like href=\"https:\/\/www.yohz.com\/blogs\/2017\/04\/04\/sql-multi-select-use-case\/\" action=\"like\" colorscheme=\"light\" layout=\"button\"  size=\"small\"><\/fb:like><\/div><div class=\"fb-share-button  \" data-href=\"https:\/\/www.yohz.com\/blogs\/2017\/04\/04\/sql-multi-select-use-case\/\" data-type=\"button\" data-size=\"small\"><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>If you have manage multiple databases in your work, there would have been occasions where you needed to run the same set of queries against multiple databases or database servers. \u00a0The regular and tedious way to do this would have been to connect to each database\/server, run your query, log the results, and move on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9],"tags":[10],"_links":{"self":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/23"}],"collection":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":3,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/posts\/23\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yohz.com\/blogs\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}