{"id":88,"date":"2020-06-09T10:16:47","date_gmt":"2020-06-09T02:16:47","guid":{"rendered":"http:\/\/www.gbase8.cn\/?p=88"},"modified":"2021-01-25T10:55:13","modified_gmt":"2021-01-25T02:55:13","slug":"gbase8a-%e9%9b%86%e7%be%a4%e6%9f%a5%e7%9c%8b%e5%ba%93%e9%87%8c%e6%9c%89%e5%93%aa%e4%ba%9b%e8%a7%86%e5%9b%be","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/88","title":{"rendered":"\u5357\u5927\u901a\u7528GBase8a \u96c6\u7fa4\u67e5\u770b\u5e93\u91cc\u6709\u54ea\u4e9b\u89c6\u56fe(\u7c7b\u4f3c show views)"},"content":{"rendered":"<p>GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u63d0\u4f9b\u4e86\u5143\u6570\u636e\u8868 information_schema.view \u6765\u83b7\u5f97\u89c6\u56fe\u7684\u60c5\u51b5\u3002\u8bf7\u6ce8\u610f\u5728show tables\u65f6\uff0c\u9ed8\u8ba4\u4e5f\u4f1a\u628aview\u89c6\u56fe\u663e\u793a\u51fa\u6765\uff0c\u53ef\u4ee5\u901a\u8fc7table_type\u7684\u503c\u8fdb\u884c\u533a\u5206\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f\uff1a\u56e0\u4e3a\u89c6\u56fe\u548c\u8868\u5728\u76f8\u540c\u7684\u76ee\u5f55\u4e0b\uff0c\u5982\u8868\u5f88\u591a\uff0c\u67e5\u8be2\u4f1a\u8017\u65f6\u5f88\u957f\u3002\u76ee\u524d\u6ca1\u6709\u7c7b\u4f3ctable_distributon\u6837\u7684\u8868\u6765\u63d0\u5347\u6027\u80fd\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2b0ba29a00f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2b0ba29a00f\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/88\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/88\/#%E8%AF%AD%E6%B3%95\" >\u8bed\u6cd5<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/88\/#%E9%80%9A%E8%BF%87SHOW_%E5%91%BD%E4%BB%A4\" >\u901a\u8fc7SHOW \u547d\u4ee4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/88\/#%E9%80%9A%E8%BF%87TABLES%E7%B3%BB%E7%BB%9F%E5%85%83%E6%95%B0%E6%8D%AE%E8%A1%A8%E6%9F%A5%E8%AF%A2\" >\u901a\u8fc7TABLES\u7cfb\u7edf\u5143\u6570\u636e\u8868\u67e5\u8be2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/88\/#%E9%80%9A%E8%BF%87VIEWS%E7%9A%84%E5%85%83%E6%95%B0%E6%8D%AE%E8%A1%A8\" >\u901a\u8fc7VIEWS\u7684\u5143\u6570\u636e\u8868<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/88\/#%E5%8F%82%E8%80%83-2\" >\u53c2\u8003<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.gbase8.cn\/en\/2436\/\">GBase 8a\u7684show\u547d\u4ee4\u5217\u8868\u548c\u4f7f\u7528<\/a><\/p>\n\n\n\n<p>\u5efa\u8bae\uff1a\u5728\u8868\u5f88\u591a\u65f6\uff0c\u5c06\u89c6\u56fe\u5efa\u7acb\u5230\u3010\u72ec\u7acb\u7684\u6570\u636e\u5e93\u3011\u4e0b\u9762\u3002\u6bd4\u5982\u4e1a\u52a1\u5e93\u53ebtestdb,\u89c6\u56fe\u5e93\u53ebv_testdb\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%AF%AD%E6%B3%95\"><\/span>\u8bed\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9A%E8%BF%87SHOW_%E5%91%BD%E4%BB%A4\"><\/span>\u901a\u8fc7SHOW \u547d\u4ee4<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u7c7b\u4f3c\u8868\uff0c\u5c06\u7c7b\u578b\u6539\u6210VIEW\u5c31\u53ef\u4ee5\u4e86\u3002 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show tables where table_type='VIEW'<\/code><\/pre>\n\n\n\n<p>\u7b49\u540c\u4e8e show views\u7684\u6548\u679c<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"673\" height=\"114\" src=\"http:\/\/www.gbase8.cn\/wp-content\/uploads\/2020\/06\/image-33.png\" alt=\"\" class=\"wp-image-89\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9A%E8%BF%87TABLES%E7%B3%BB%E7%BB%9F%E5%85%83%E6%95%B0%E6%8D%AE%E8%A1%A8%E6%9F%A5%E8%AF%A2\"><\/span>\u901a\u8fc7TABLES\u7cfb\u7edf\u5143\u6570\u636e\u8868\u67e5\u8be2<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u968f\u610f\u8fc7\u6ee4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select table_schema,table_name,table_type from information_schema.tables where table_type='view';\r\n+--------------+------------+------------+\r\n| table_schema | table_name | table_type |\r\n+--------------+------------+------------+\r\n| testdb       | v_t1       | VIEW       |\r\n| testdb       | v_t2       | VIEW       |\r\n| testmirror   | v_t1       | VIEW       |\r\n+--------------+------------+------------+\r\n3 rows in set (Elapsed: 00:00:00.02)\r\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"905\" height=\"121\" src=\"http:\/\/www.gbase8.cn\/wp-content\/uploads\/2020\/06\/image-34.png\" alt=\"\" class=\"wp-image-90\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9A%E8%BF%87VIEWS%E7%9A%84%E5%85%83%E6%95%B0%E6%8D%AE%E8%A1%A8\"><\/span>\u901a\u8fc7VIEWS\u7684\u5143\u6570\u636e\u8868<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select * from information_schema.views;\r\n+---------------+----------+--------------+------------+-------------------------------------------------------------------------------------------------------------------+--------------+--------------+---------+---------------+----------------------+----------------------+\r\n| TABLE_CATALOG | TABLE_VC | TABLE_SCHEMA | TABLE_NAME | VIEW_DEFINITION                                                                                                   | CHECK_OPTION | IS_UPDATABLE | DEFINER | SECURITY_TYPE | CHARACTER_SET_CLIENT | COLLATION_CONNECTION |\r\n+---------------+----------+--------------+------------+-------------------------------------------------------------------------------------------------------------------+--------------+--------------+---------+---------------+----------------------+----------------------+\r\n| NULL          | vc01     | testdb       | v_t1       | select `vc00001`.`testdb`.`t1`.`id` AS `id`,`vc00001`.`testdb`.`t1`.`name` AS `name` from `vc00001`.`testdb`.`t1` | NONE         | NO           | root@%  | DEFINER       | utf8                 | utf8_general_ci      |\r\n| NULL          | vc01     | testdb       | v_t2       | select `vc00001`.`testdb`.`t2`.`id` AS `id` from `vc00001`.`testdb`.`t2`                                          | NONE         | NO           | root@%  | DEFINER       | utf8                 | utf8_general_ci      |\r\n| NULL          | vc01     | testmirror   | v_t1       | select `vc00001`.`testmirror`.`t1`.`id` AS `id` from `vc00001`.`testmirror`.`t1`                                  | NONE         | NO           | root@%  | DEFINER       | utf8                 | utf8_general_ci      |\r\n+---------------+----------+--------------+------------+-------------------------------------------------------------------------------------------------------------------+--------------+--------------+---------+---------------+----------------------+----------------------+\r\n3 rows in set (Elapsed: 00:00:00.01)\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83-2\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"http:\/\/www.gbase8.cn\/en\/?p=79\">GBase8a \u96c6\u7fa4\u67e5\u770b\u5e93\u91cc\u6709\u54ea\u4e9b\u8868\uff0c\u6216\u67d0\u5f20\u8868\u662f\u5426\u5b58\u5728<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.gbase8.cn\/en\/1269\/\">GBase 8a \u5143\u6570\u636e\u8868\u4ecb\u7ecd Information_schema<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u63d0\u4f9b\u4e86\u5143\u6570\u636e\u8868 information_schema.view \u6765\u83b7\u5f97\u89c6\u56fe\u7684\u60c5\u51b5\u3002\u8bf7\u6ce8\u610f\u5728show tables\u65f6\uff0c\u9ed8\u8ba4\u4e5f\u4f1a\u628aview\u89c6\u56fe\u663e\u793a\u51fa\u6765\uff0c\u53ef\u4ee5\u901a\u8fc7table_type\u7684\u503c\u8fdb\u884c\u533a\u5206\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[69],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-69"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":8,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":3721,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/88\/revisions\/3721"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}