{"id":160579,"date":"2024-11-03T23:16:29","date_gmt":"2024-11-03T15:16:29","guid":{"rendered":"https:\/\/server.hk\/cnblog\/160579\/"},"modified":"2024-11-03T23:16:31","modified_gmt":"2024-11-03T15:16:31","slug":"oceanbase-%e6%95%99%e7%a8%8b%ef%bc%9aoceanbase-%e6%95%b8%e5%80%bc%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b%e6%a6%82%e8%bf%b0","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/160579\/","title":{"rendered":"OceanBase \u6559\u7a0b\uff1aOceanBase \u6578\u503c\u6578\u64da\u985e\u578b\u6982\u8ff0"},"content":{"rendered":"<h1 id=\"oceanbase-%e6%95%99%e7%a8%8b%ef%bc%9aoceanbase-%e6%95%b8%e5%80%bc%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b%e6%a6%82%e8%bf%b0-ilZBdpNPva\">OceanBase \u6559\u7a0b\uff1aOceanBase \u6578\u503c\u6578\u64da\u985e\u578b\u6982\u8ff0<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6578\u64da\u9a45\u52d5\u6642\u4ee3\uff0c\u6578\u64da\u5eab\u7684\u9078\u64c7\u5c0d\u65bc\u61c9\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u53ef\u64f4\u5c55\u6027\u81f3\u95dc\u91cd\u8981\u3002OceanBase \u4f5c\u70ba\u4e00\u6b3e\u9ad8\u6027\u80fd\u7684\u5206\u4f48\u5f0f\u6578\u64da\u5eab\uff0c\u5df2\u7d93\u5728\u91d1\u878d\u3001\u96fb\u5546\u7b49\u9818\u57df\u5f97\u5230\u4e86\u5ee3\u6cdb\u61c9\u7528\u3002\u672c\u6587\u5c07\u5c0d OceanBase \u7684\u6578\u503c\u6578\u64da\u985e\u578b\u9032\u884c\u8a73\u7d30\u4ecb\u7d39\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528\u9019\u4e00\u6578\u64da\u5eab\u3002<\/p>\n<h2 id=\"oceanbase-%e6%95%b8%e5%80%bc%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b%e6%a6%82%e8%bf%b0-ilZBdpNPva\">OceanBase \u6578\u503c\u6578\u64da\u985e\u578b\u6982\u8ff0<\/h2>\n<p>\u5728 OceanBase \u4e2d\uff0c\u6578\u503c\u6578\u64da\u985e\u578b\u4e3b\u8981\u5206\u70ba\u6574\u6578\u985e\u578b\u548c\u6d6e\u9ede\u6578\u985e\u578b\u3002\u9019\u4e9b\u6578\u64da\u985e\u578b\u7684\u9078\u64c7\u5c0d\u65bc\u6578\u64da\u7684\u5b58\u5132\u548c\u8a08\u7b97\u6548\u7387\u6709\u8457\u76f4\u63a5\u5f71\u97ff\u3002<\/p>\n<h3 id=\"%e6%95%b4%e6%95%b8%e9%a1%9e%e5%9e%8b-ilZBdpNPva\">\u6574\u6578\u985e\u578b<\/h3>\n<p>\u6574\u6578\u985e\u578b\u7528\u65bc\u5b58\u5132\u4e0d\u5e36\u5c0f\u6578\u7684\u6578\u5b57\u3002OceanBase \u652f\u6301\u591a\u7a2e\u6574\u6578\u985e\u578b\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><code>TINYINT<\/code>\uff1a\u4f54\u7528 1 \u5b57\u7bc0\uff0c\u7bc4\u570d\u70ba -128 \u5230 127\uff08\u6709\u7b26\u865f\uff09\u6216 0 \u5230 255\uff08\u7121\u7b26\u865f\uff09\u3002<\/li>\n<li><code>SMALLINT<\/code>\uff1a\u4f54\u7528 2 \u5b57\u7bc0\uff0c\u7bc4\u570d\u70ba -32,768 \u5230 32,767\uff08\u6709\u7b26\u865f\uff09\u6216 0 \u5230 65,535\uff08\u7121\u7b26\u865f\uff09\u3002<\/li>\n<li><code>MEDIUMINT<\/code>\uff1a\u4f54\u7528 3 \u5b57\u7bc0\uff0c\u7bc4\u570d\u70ba -8,388,608 \u5230 8,388,607\uff08\u6709\u7b26\u865f\uff09\u6216 0 \u5230 16,777,215\uff08\u7121\u7b26\u865f\uff09\u3002<\/li>\n<li><code>INT<\/code>\uff1a\u4f54\u7528 4 \u5b57\u7bc0\uff0c\u7bc4\u570d\u70ba -2,147,483,648 \u5230 2,147,483,647\uff08\u6709\u7b26\u865f\uff09\u6216 0 \u5230 4,294,967,295\uff08\u7121\u7b26\u865f\uff09\u3002<\/li>\n<li><code>BIGINT<\/code>\uff1a\u4f54\u7528 8 \u5b57\u7bc0\uff0c\u7bc4\u570d\u70ba -9,223,372,036,854,775,808 \u5230 9,223,372,036,854,775,807\uff08\u6709\u7b26\u865f\uff09\u6216 0 \u5230 18,446,744,073,709,551,615\uff08\u7121\u7b26\u865f\uff09\u3002<\/li>\n<\/ul>\n<p>\u6574\u6578\u985e\u578b\u7684\u9078\u64c7\u61c9\u6839\u64da\u5be6\u969b\u9700\u6c42\u4f86\u6c7a\u5b9a\uff0c\u904e\u5927\u7684\u6578\u64da\u985e\u578b\u6703\u6d6a\u8cbb\u5b58\u5132\u7a7a\u9593\uff0c\u800c\u904e\u5c0f\u7684\u6578\u64da\u985e\u578b\u5247\u53ef\u80fd\u5c0e\u81f4\u6ea2\u51fa\u3002<\/p>\n<h3 id=\"%e6%b5%ae%e9%bb%9e%e6%95%b8%e9%a1%9e%e5%9e%8b-ilZBdpNPva\">\u6d6e\u9ede\u6578\u985e\u578b<\/h3>\n<p>\u6d6e\u9ede\u6578\u985e\u578b\u7528\u65bc\u5b58\u5132\u5e36\u5c0f\u6578\u7684\u6578\u5b57\uff0cOceanBase \u63d0\u4f9b\u4e86\u4ee5\u4e0b\u6d6e\u9ede\u6578\u985e\u578b\uff1a<\/p>\n<ul>\n<li><code>FLOAT<\/code>\uff1a\u4f54\u7528 4 \u5b57\u7bc0\uff0c\u901a\u5e38\u7528\u65bc\u5b58\u5132\u7cbe\u5ea6\u8981\u6c42\u4e0d\u9ad8\u7684\u6578\u5b57\u3002<\/li>\n<li><code>DOUBLE<\/code>\uff1a\u4f54\u7528 8 \u5b57\u7bc0\uff0c\u9069\u5408\u5b58\u5132\u9700\u8981\u8f03\u9ad8\u7cbe\u5ea6\u7684\u6578\u5b57\u3002<\/li>\n<\/ul>\n<p>\u5728\u4f7f\u7528\u6d6e\u9ede\u6578\u985e\u578b\u6642\uff0c\u958b\u767c\u8005\u9700\u8981\u6ce8\u610f\u6d6e\u9ede\u6578\u7684\u7cbe\u5ea6\u554f\u984c\uff0c\u7279\u5225\u662f\u5728\u9032\u884c\u8a08\u7b97\u6642\uff0c\u53ef\u80fd\u6703\u51fa\u73fe\u7cbe\u5ea6\u640d\u5931\u7684\u60c5\u6cc1\u3002<\/p>\n<h2 id=\"%e6%95%b8%e5%80%bc%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b%e7%9a%84%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b-ilZBdpNPva\">\u6578\u503c\u6578\u64da\u985e\u578b\u7684\u4f7f\u7528\u793a\u4f8b<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f7f\u7528 OceanBase \u6578\u503c\u6578\u64da\u985e\u578b\u7684 SQL \u793a\u4f8b\uff1a<\/p>\n<pre><code>CREATE TABLE example (\n    id INT PRIMARY KEY,\n    name VARCHAR(100),\n    age TINYINT,\n    salary FLOAT,\n    balance DOUBLE\n);\n<\/code><\/pre>\n<p>\u5728\u9019\u500b\u793a\u4f8b\u4e2d\uff0c\u6211\u5011\u5275\u5efa\u4e86\u4e00\u500b\u540d\u70ba <code>example<\/code> \u7684\u8868\uff0c\u5305\u542b\u4e86\u6574\u6578\u985e\u578b\u548c\u6d6e\u9ede\u6578\u985e\u578b\u7684\u5b57\u6bb5\u3002\u9019\u6a23\u7684\u8a2d\u8a08\u53ef\u4ee5\u6709\u6548\u5730\u5b58\u5132\u7528\u6236\u7684\u57fa\u672c\u4fe1\u606f\u53ca\u5176\u8ca1\u52d9\u6578\u64da\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-ilZBdpNPva\">\u7d50\u8ad6<\/h2>\n<p>OceanBase \u7684\u6578\u503c\u6578\u64da\u985e\u578b\u70ba\u958b\u767c\u8005\u63d0\u4f9b\u4e86\u9748\u6d3b\u7684\u9078\u64c7\uff0c\u80fd\u5920\u6eff\u8db3\u4e0d\u540c\u61c9\u7528\u5834\u666f\u7684\u9700\u6c42\u3002\u5728\u9078\u64c7\u6578\u64da\u985e\u578b\u6642\uff0c\u958b\u767c\u8005\u61c9\u6839\u64da\u5be6\u969b\u9700\u6c42\u8003\u616e\u6578\u64da\u7684\u7bc4\u570d\u548c\u7cbe\u5ea6\uff0c\u4ee5\u9054\u5230\u6700\u4f73\u7684\u6027\u80fd\u548c\u5b58\u5132\u6548\u7387\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u95dc\u65bc <a href=\"https:\/\/server.hk\">VPS<\/a> \u548c\u5176\u4ed6\u670d\u52d9\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22 OceanBase \u6578\u503c\u6578\u64da\u985e\u578b\u7684\u5168\u9762\u6982\u8ff0\uff0c\u4e86\u89e3\u5176\u7279\u6027\u3001\u7528\u6cd5\u53ca\u6700\u4f73\u5be6\u8e10\uff0c\u52a9\u60a8\u9ad8\u6548\u7ba1\u7406\u6578\u64da\u5eab\u3002<\/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-160579","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160579","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=160579"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160579\/revisions"}],"predecessor-version":[{"id":160580,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160579\/revisions\/160580"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=160579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=160579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=160579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}