{"id":3696,"date":"2021-01-25T09:59:40","date_gmt":"2021-01-25T01:59:40","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=3696"},"modified":"2021-02-05T16:31:04","modified_gmt":"2021-02-05T08:31:04","slug":"gbase-8a%e6%9f%a5%e7%9c%8b%e5%92%8c%e4%bf%ae%e6%94%b9%e8%a1%a8%e7%9a%84%e6%8b%a5%e6%9c%89%e8%80%85uid","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/3696","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u67e5\u770b\u548c\u4fee\u6539\u8868\u7684\u62e5\u6709\u8005UID"},"content":{"rendered":"<p>\u5728GBase 8a\u6570\u636e\u96c6\u7fa4\u4e2d\uff0c\u6bcf\u5f20\u8868\u90fd\u6709\u4e00\u4e2a\u62e5\u6709\u8005\u6216\u6240\u6709\u8005(owner, UID)\uff0c\u8be5UID\u4e3b\u8981\u7528\u4e8e\u8d44\u6e90\u63a7\u5236\uff0c\u6bd4\u5982\u78c1\u76d8\u7a7a\u95f4\u7b49\u3002\u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u67e5\u770b\uff0c\u4fee\u6539\u8868\u7684\u62e5\u6709\u8005UID\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-6a2ac0163b33f\" 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-6a2ac0163b33f\"  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\/3696\/#%E6%9F%A5%E7%9C%8B\" >\u67e5\u770b<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/3696\/#%E8%AF%AD%E6%B3%95\" >\u8bed\u6cd5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/3696\/#%E6%A0%B7%E4%BE%8B\" >\u6837\u4f8b<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/3696\/#%E9%80%9A%E8%BF%87UID%E6%9F%A5%E7%9C%8B%E7%94%A8%E6%88%B7\" >\u901a\u8fc7UID\u67e5\u770b\u7528\u6237<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/3696\/#%E4%BF%AE%E6%94%B9\" >\u4fee\u6539<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/3696\/#%E8%AF%AD%E6%B3%95-2\" >\u8bed\u6cd5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.gbase8.cn\/en\/3696\/#%E6%A0%B7%E4%BE%8B-2\" >\u6837\u4f8b<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.gbase8.cn\/en\/3696\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8B\"><\/span>\u67e5\u770b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u53ef\u4ee5\u901a\u8fc7show \u8bed\u53e5\u83b7\u5f97\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5143\u6570\u636e\u8868\u83b7\u5f97\u8868\u7684\u6240\u6709\u8005UID\u3002<\/p>\n\n\n\n<h3 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><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>show full create table {TABLE_NAME};<\/code><\/pre>\n\n\n\n<p>\u6216\u8005\u4ece\u5143\u6570\u636e\u8868\u91cc\u67e5\u8be2<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select table_schema,table_name,scn,table_id,owner_uid from information_schema.tables where table_schema={DBNAME} and table_name={TABLE_NAME};\r<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%A0%B7%E4%BE%8B\"><\/span>\u6837\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5982\u4e0b\u6837\u4f8b\u4e2d\u7684UID(1)\u8868\u793a\u8be5\u8868\u7684\u62e5\u6709\u8005\u662fUID=1\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; show full create table t1;\n+-------+-------------------------------------------------------------------------------------------------------------------------------------------------+\n| Table | Create Table                                                                                                                                    |\n+-------+-------------------------------------------------------------------------------------------------------------------------------------------------+\n| t1    | CREATE TABLE \"t1\" (\n  \"id\" int(11) DEFAULT NULL\n) ENGINE=EXPRESS TID(105) UID(1) DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' COLUMN_IDS(0) |\n+-------+-------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (Elapsed: 00:00:00.01)\n<\/code><\/pre>\n\n\n\n<p>\u901a\u8fc7\u5143\u6570\u636e\u8868\u67e5\u770b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select table_vc,table_schema,table_name,scn,table_id,owner_uid,vc_id from information_schema.tables where table_schema='testdb' and table_name='t1';\r\n+----------+--------------+------------+------+----------+-----------+---------+\r\n| table_vc | table_schema | table_name | scn  | table_id | owner_uid | vc_id   |\r\n+----------+--------------+------------+------+----------+-----------+---------+\r\n| vc01     | testdb       | t1         | 2049 |      105 |         2 | vc00001 |\r\n| vc02     | testdb       | t1         | 2049 |      105 |         2 | vc00002 |\r\n+----------+--------------+------------+------+----------+-----------+---------+\r\n2 rows in set (Elapsed: 00:00:00.00)\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9A%E8%BF%87UID%E6%9F%A5%E7%9C%8B%E7%94%A8%E6%88%B7\"><\/span>\u901a\u8fc7UID\u67e5\u770b\u7528\u6237<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u53ef\u4ee5\u4ece\u5143\u6570\u636e\u8868user\u91cc\u67e5\u770b\u5230UID\u5bf9\u5e94\u7684user\u540d\u5b57\u3002\u5982\u4e0b\u53ef\u4ee5\u770b\u5230UID=1\u5bf9\u5e94\u7684\u662froot\u6570\u636e\u5e93\u7528\u6237\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select trim(user),uid from gbase.user;\n+------------+-----+\n| trim(user) | uid |\n+------------+-----+\n| root       |   1 |\n| gbase      |   2 |\n| uservc1    | 102 |\n| testdb     | 289 |\n+------------+-----+\n4 rows in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BF%AE%E6%94%B9\"><\/span>\u4fee\u6539<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%AF%AD%E6%B3%95-2\"><\/span>\u8bed\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>alter table TABLE_NAME set owner USER_NAME<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%A0%B7%E4%BE%8B-2\"><\/span>\u6837\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5982\u4e0b\u4f8b\u5b50\u5c06\u8868\u7684\u6240\u6709\u8005\u4eceroot(UID=1)\u6539\u6210\u4e86gbase(UID=2)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; alter table t1 set owner gbase;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.13)\n\ngbase&gt; show full create table t1;\n+-------+-------------------------------------------------------------------------------------------------------------------------------------------------+\n| Table | Create Table                                                                                                                                    |\n+-------+-------------------------------------------------------------------------------------------------------------------------------------------------+\n| t1    | CREATE TABLE \"t1\" (\n  \"id\" int(11) DEFAULT NULL\n) ENGINE=EXPRESS TID(105) UID(2) DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' COLUMN_IDS(0) |\n+-------+-------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\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\/1845\/\">GBase 8a\u67e5\u770b\u8868\u7684tableId<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.gbase8.cn\/en\/97\/\">GBase8a \u96c6\u7fa4\u67e5\u770b\u5efa\u8868\u7ed3\u6784\uff0c\u5b58\u50a8\u8fc7\u7a0b\u7684\u8bed\u53e5<\/a><\/p>\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>","protected":false},"excerpt":{"rendered":"<p>\u5728GBase 8a\u6570\u636e\u96c6\u7fa4\u4e2d\uff0c\u6bcf\u5f20\u8868\u90fd\u6709\u4e00\u4e2a\u62e5\u6709\u8005\u6216\u6240\u6709\u8005(owner, UID)\uff0c\u8be5UID\u4e3b\u8981\u7528\u4e8e\u8d44\u6e90\u63a7\u5236\uff0c\u6bd4\u5982\u78c1\u76d8\u7a7a\u95f4\u7b49\u3002\u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u67e5\u770b\uff0c\u4fee\u6539\u8868\u7684\u62e5\u6709\u8005UID\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[69],"class_list":["post-3696","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\/3696","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=3696"}],"version-history":[{"count":4,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/3696\/revisions"}],"predecessor-version":[{"id":3705,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/3696\/revisions\/3705"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=3696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=3696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=3696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}