{"id":160207,"date":"2024-11-03T21:10:19","date_gmt":"2024-11-03T13:10:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/160207\/"},"modified":"2024-11-03T21:10:21","modified_gmt":"2024-11-03T13:10:21","slug":"oceanbase-%e6%95%99%e7%a8%8b%ef%bc%9aoceanbase-rename-table","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/160207\/","title":{"rendered":"OceanBase \u6559\u7a0b\uff1aOceanBase RENAME TABLE"},"content":{"rendered":"<h1 id=\"oceanbase-%e6%95%99%e7%a8%8b%ef%bc%9aoceanbase-rename-table-PeTyNsCmxT\">OceanBase \u6559\u7a0b\uff1aOceanBase RENAME TABLE<\/h1>\n<p>\u5728\u6578\u64da\u5eab\u7ba1\u7406\u4e2d\uff0c\u8868\u7684\u91cd\u547d\u540d\u662f\u4e00\u500b\u5e38\u898b\u7684\u64cd\u4f5c\u3002OceanBase \u4f5c\u70ba\u4e00\u500b\u9ad8\u6027\u80fd\u7684\u5206\u4f48\u5f0f\u6578\u64da\u5eab\uff0c\u63d0\u4f9b\u4e86\u7c21\u55ae\u800c\u6709\u6548\u7684\u65b9\u5f0f\u4f86\u91cd\u547d\u540d\u8868\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u5728 OceanBase \u4e2d\u4f7f\u7528 RENAME TABLE \u8a9e\u53e5\uff0c\u4e26\u63d0\u4f9b\u76f8\u95dc\u7684\u793a\u4f8b\u548c\u6ce8\u610f\u4e8b\u9805\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-rename-table%ef%bc%9f-PeTyNsCmxT\">\u4ec0\u9ebc\u662f RENAME TABLE\uff1f<\/h2>\n<p>RENAME TABLE \u662f\u4e00\u500b SQL \u8a9e\u53e5\uff0c\u7528\u65bc\u66f4\u6539\u6578\u64da\u5eab\u4e2d\u8868\u7684\u540d\u7a31\u3002\u9019\u5728\u6578\u64da\u5eab\u8a2d\u8a08\u904e\u7a0b\u4e2d\u975e\u5e38\u6709\u7528\uff0c\u7279\u5225\u662f\u7576\u9700\u8981\u66f4\u6539\u8868\u7684\u7d50\u69cb\u6216\u8a9e\u7fa9\u6642\u3002\u4f7f\u7528 RENAME TABLE \u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u4fdd\u6301\u6578\u64da\u5eab\u7684\u6e05\u6670\u6027\u548c\u4e00\u81f4\u6027\u3002<\/p>\n<h2 id=\"oceanbase-%e4%b8%ad%e7%9a%84-rename-table-%e8%aa%9e%e6%b3%95-PeTyNsCmxT\">OceanBase \u4e2d\u7684 RENAME TABLE \u8a9e\u6cd5<\/h2>\n<p>\u5728 OceanBase \u4e2d\uff0cRENAME TABLE \u7684\u57fa\u672c\u8a9e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code>RENAME TABLE  TO ;<\/code><\/pre>\n<p>\u9019\u88e1\uff0c \u662f\u60a8\u60f3\u8981\u91cd\u547d\u540d\u7684\u73fe\u6709\u8868\u7684\u540d\u7a31\uff0c\u800c  \u662f\u60a8\u5e0c\u671b\u8ce6\u4e88\u8a72\u8868\u7684\u65b0\u540d\u7a31\u3002<\/p>\n<h2 id=\"%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b-PeTyNsCmxT\">\u4f7f\u7528\u793a\u4f8b<\/h2>\n<p>\u5047\u8a2d\u6211\u5011\u6709\u4e00\u500b\u540d\u70ba <code>employees<\/code> \u7684\u8868\uff0c\u6211\u5011\u5e0c\u671b\u5c07\u5176\u91cd\u547d\u540d\u70ba <code>staff<\/code>\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u8a9e\u53e5\uff1a<\/p>\n<pre><code>RENAME TABLE employees TO staff;<\/code><\/pre>\n<p>\u57f7\u884c\u4e0a\u8ff0\u8a9e\u53e5\u5f8c\uff0c<code>employees<\/code> \u8868\u5c07\u88ab\u91cd\u547d\u540d\u70ba <code>staff<\/code>\u3002\u9019\u6a23\uff0c\u6240\u6709\u5c0d\u8a72\u8868\u7684\u5f15\u7528\u90fd\u9700\u8981\u66f4\u65b0\u70ba\u65b0\u540d\u7a31\u3002<\/p>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-PeTyNsCmxT\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<ul>\n<li><strong>\u6b0a\u9650\u8981\u6c42\uff1a<\/strong>\u57f7\u884c RENAME TABLE \u64cd\u4f5c\u7684\u7528\u6236\u5fc5\u9808\u64c1\u6709\u5c0d\u8a72\u8868\u7684 ALTER \u6b0a\u9650\u3002<\/li>\n<li><strong>\u8868\u7684\u4f9d\u8cf4\u6027\uff1a<\/strong>\u5982\u679c\u5176\u4ed6\u5c0d\u8c61\uff08\u5982\u8996\u5716\u3001\u89f8\u767c\u5668\u7b49\uff09\u4f9d\u8cf4\u65bc\u8a72\u8868\uff0c\u5247\u5728\u91cd\u547d\u540d\u5f8c\u53ef\u80fd\u9700\u8981\u624b\u52d5\u66f4\u65b0\u9019\u4e9b\u5c0d\u8c61\u3002<\/li>\n<li><strong>\u4e8b\u52d9\u652f\u6301\uff1a<\/strong>\u5728 OceanBase \u4e2d\uff0cRENAME TABLE \u662f\u4e00\u500b\u539f\u5b50\u64cd\u4f5c\uff0c\u9019\u610f\u5473\u8457\u8981\u9ebc\u5b8c\u5168\u6210\u529f\uff0c\u8981\u9ebc\u5b8c\u5168\u5931\u6557\uff0c\u9019\u6709\u52a9\u65bc\u4fdd\u6301\u6578\u64da\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-PeTyNsCmxT\">\u7d50\u8ad6<\/h2>\n<p>\u5728 OceanBase \u4e2d\u4f7f\u7528 RENAME TABLE \u662f\u4e00\u500b\u7c21\u55ae\u800c\u6709\u6548\u7684\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u9748\u6d3b\u5730\u7ba1\u7406\u6578\u64da\u5eab\u7d50\u69cb\u3002\u901a\u904e\u6b63\u78ba\u4f7f\u7528\u6b64\u8a9e\u53e5\uff0c\u60a8\u53ef\u4ee5\u8f15\u9b06\u5730\u91cd\u547d\u540d\u8868\uff0c\u4e26\u4fdd\u6301\u6578\u64da\u5eab\u7684\u6574\u6f54\u548c\u4e00\u81f4\u6027\u3002\u4e86\u89e3\u5982\u4f55\u6b63\u78ba\u4f7f\u7528 RENAME TABLE \u5c0d\u65bc\u4efb\u4f55\u4f7f\u7528 OceanBase \u7684\u958b\u767c\u8005\u4f86\u8aaa\u90fd\u662f\u4e00\u9805\u91cd\u8981\u6280\u80fd\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u6216\u5176\u4ed6\u6578\u64da\u5eab\u7ba1\u7406\u7684\u9700\u6c42\u6709\u8208\u8da3\uff0c\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to use the RENAME TABLE command in OceanBase with this comprehensive tutorial, enhancing your database management skills effectively.<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-160207","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=160207"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160207\/revisions"}],"predecessor-version":[{"id":160208,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160207\/revisions\/160208"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=160207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=160207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=160207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}