{"id":160167,"date":"2024-11-03T20:50:24","date_gmt":"2024-11-03T12:50:24","guid":{"rendered":"https:\/\/server.hk\/cnblog\/160167\/"},"modified":"2024-11-03T20:50:26","modified_gmt":"2024-11-03T12:50:26","slug":"oceanbase-%e6%95%99%e7%a8%8b%ef%bc%9aoceanbase-lob-locator-%e6%8e%a5%e5%8f%a3","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/160167\/","title":{"rendered":"OceanBase \u6559\u7a0b\uff1aOceanBase LOB Locator \u63a5\u53e3"},"content":{"rendered":"<h1 id=\"oceanbase-%e6%95%99%e7%a8%8b%ef%bc%9aoceanbase-lob-locator-%e6%8e%a5%e5%8f%a3-IfdkTXbPGl\">OceanBase \u6559\u7a0b\uff1aOceanBase LOB Locator \u63a5\u53e3<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6578\u64da\u9a45\u52d5\u6642\u4ee3\uff0c\u9078\u64c7\u5408\u9069\u7684\u6578\u64da\u5eab\u7cfb\u7d71\u5c0d\u65bc\u4f01\u696d\u7684\u6210\u529f\u81f3\u95dc\u91cd\u8981\u3002OceanBase \u4f5c\u70ba\u4e00\u6b3e\u9ad8\u6027\u80fd\u7684\u5206\u4f48\u5f0f\u6578\u64da\u5eab\uff0c\u5df2\u7d93\u5728\u591a\u500b\u884c\u696d\u4e2d\u5f97\u5230\u4e86\u5ee3\u6cdb\u61c9\u7528\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e OceanBase \u7684 LOB Locator \u63a5\u53e3\uff0c\u5e6b\u52a9\u958b\u767c\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528\u9019\u4e00\u529f\u80fd\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-lob-locator%ef%bc%9f-IfdkTXbPGl\">\u4ec0\u9ebc\u662f LOB Locator\uff1f<\/h2>\n<p>LOB\uff08Large Object\uff09\u662f\u6307\u5927\u578b\u5c0d\u8c61\uff0c\u901a\u5e38\u7528\u65bc\u5b58\u5132\u5927\u91cf\u6578\u64da\uff0c\u5982\u5716\u7247\u3001\u97f3\u983b\u3001\u8996\u983b\u7b49\u3002\u5728 OceanBase \u4e2d\uff0cLOB Locator \u63a5\u53e3\u63d0\u4f9b\u4e86\u4e00\u7a2e\u9ad8\u6548\u7684\u65b9\u5f0f\u4f86\u7ba1\u7406\u548c\u64cd\u4f5c\u9019\u4e9b\u5927\u578b\u5c0d\u8c61\u3002\u901a\u904e LOB Locator\uff0c\u958b\u767c\u8005\u53ef\u4ee5\u65b9\u4fbf\u5730\u5c0d LOB \u6578\u64da\u9032\u884c\u8b80\u53d6\u3001\u5beb\u5165\u548c\u522a\u9664\u7b49\u64cd\u4f5c\u3002<\/p>\n<h2 id=\"lob-locator-%e6%8e%a5%e5%8f%a3%e7%9a%84%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c-IfdkTXbPGl\">LOB Locator \u63a5\u53e3\u7684\u57fa\u672c\u64cd\u4f5c<\/h2>\n<p>OceanBase \u7684 LOB Locator \u63a5\u53e3\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u5e7e\u500b\u57fa\u672c\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li><strong>\u5275\u5efa LOB\uff1a<\/strong>\u4f7f\u7528 LOB Locator \u63a5\u53e3\u53ef\u4ee5\u5275\u5efa\u4e00\u500b\u65b0\u7684 LOB \u5c0d\u8c61\u3002<\/li>\n<li><strong>\u8b80\u53d6 LOB\uff1a<\/strong>\u53ef\u4ee5\u901a\u904e LOB Locator \u8b80\u53d6\u5df2\u5b58\u5728\u7684 LOB \u5c0d\u8c61\u3002<\/li>\n<li><strong>\u5beb\u5165 LOB\uff1a<\/strong>\u652f\u6301\u5c07\u6578\u64da\u5beb\u5165\u5230 LOB \u5c0d\u8c61\u4e2d\u3002<\/li>\n<li><strong>\u522a\u9664 LOB\uff1a<\/strong>\u53ef\u4ee5\u522a\u9664\u4e0d\u518d\u9700\u8981\u7684 LOB \u5c0d\u8c61\u3002<\/li>\n<\/ul>\n<h3 id=\"%e5%89%b5%e5%bb%ba-lob-%e7%9a%84%e7%a4%ba%e4%be%8b-IfdkTXbPGl\">\u5275\u5efa LOB \u7684\u793a\u4f8b<\/h3>\n<pre><code>-- \u5275\u5efa\u4e00\u500b\u65b0\u7684 LOB \u5c0d\u8c61\nDECLARE lob_locator BLOB;\nBEGIN\n    DBMS_LOB.CREATETEMPORARY(lob_locator, TRUE);\n    -- \u5728\u9019\u88e1\u53ef\u4ee5\u9032\u884c\u5176\u4ed6\u64cd\u4f5c\uff0c\u4f8b\u5982\u5beb\u5165\u6578\u64da\nEND;\n<\/code><\/pre>\n<h3 id=\"%e8%ae%80%e5%8f%96-lob-%e7%9a%84%e7%a4%ba%e4%be%8b-IfdkTXbPGl\">\u8b80\u53d6 LOB \u7684\u793a\u4f8b<\/h3>\n<pre><code>-- \u8b80\u53d6 LOB \u5c0d\u8c61\nDECLARE lob_locator BLOB;\nDECLARE buffer RAW(32767);\nDECLARE amount BINARY_INTEGER := 32767;\nDECLARE offset INTEGER := 1;\nBEGIN\n    -- \u5047\u8a2d lob_locator \u5df2\u7d93\u6307\u5411\u4e00\u500b\u6709\u6548\u7684 LOB \u5c0d\u8c61\n    DBMS_LOB.READ(lob_locator, amount, offset, buffer);\n    -- \u5728\u9019\u88e1\u53ef\u4ee5\u8655\u7406\u8b80\u53d6\u5230\u7684\u6578\u64da\nEND;\n<\/code><\/pre>\n<h3 id=\"%e5%af%ab%e5%85%a5-lob-%e7%9a%84%e7%a4%ba%e4%be%8b-IfdkTXbPGl\">\u5beb\u5165 LOB \u7684\u793a\u4f8b<\/h3>\n<pre><code>-- \u5beb\u5165\u6578\u64da\u5230 LOB \u5c0d\u8c61\nDECLARE lob_locator BLOB;\nDECLARE data RAW(32767) := UTL_RAW.CAST_TO_RAW('Hello, OceanBase!');\nBEGIN\n    DBMS_LOB.WRITEAPPEND(lob_locator, LENGTH(data), data);\nEND;\n<\/code><\/pre>\n<h3 id=\"%e5%88%aa%e9%99%a4-lob-%e7%9a%84%e7%a4%ba%e4%be%8b-IfdkTXbPGl\">\u522a\u9664 LOB \u7684\u793a\u4f8b<\/h3>\n<pre><code>-- \u522a\u9664 LOB \u5c0d\u8c61\nDECLARE lob_locator BLOB;\nBEGIN\n    DBMS_LOB.FREETEMPORARY(lob_locator);\nEND;\n<\/code><\/pre>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-IfdkTXbPGl\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<p>\u5728\u4f7f\u7528 LOB Locator \u63a5\u53e3\u6642\uff0c\u6709\u5e7e\u9ede\u9700\u8981\u7279\u5225\u6ce8\u610f\uff1a<\/p>\n<ul>\n<li>\u78ba\u4fdd\u5728\u64cd\u4f5c LOB \u5c0d\u8c61\u4e4b\u524d\uff0c\u5df2\u7d93\u6b63\u78ba\u5275\u5efa\u4e26\u521d\u59cb\u5316\u4e86 LOB Locator\u3002<\/li>\n<li>\u5728\u8b80\u53d6\u548c\u5beb\u5165 LOB \u6578\u64da\u6642\uff0c\u9700\u6ce8\u610f\u6578\u64da\u7684\u5927\u5c0f\u9650\u5236\uff0c\u907f\u514d\u51fa\u73fe\u6ea2\u51fa\u3002<\/li>\n<li>\u5728\u5b8c\u6210 LOB \u64cd\u4f5c\u5f8c\uff0c\u53ca\u6642\u91cb\u653e\u8cc7\u6e90\uff0c\u4ee5\u907f\u514d\u5167\u5b58\u6cc4\u6f0f\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-IfdkTXbPGl\">\u7e3d\u7d50<\/h2>\n<p>OceanBase \u7684 LOB Locator \u63a5\u53e3\u70ba\u958b\u767c\u8005\u63d0\u4f9b\u4e86\u4e00\u7a2e\u9ad8\u6548\u7684\u65b9\u5f0f\u4f86\u7ba1\u7406\u5927\u578b\u5c0d\u8c61\u6578\u64da\u3002\u901a\u904e\u672c\u6587\u7684\u4ecb\u7d39\uff0c\u76f8\u4fe1\u8b80\u8005\u5c0d\u65bc\u5982\u4f55\u4f7f\u7528 LOB Locator \u63a5\u53e3\u6709\u4e86\u66f4\u6df1\u5165\u7684\u4e86\u89e3\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u7a69\u5b9a\u4e14\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0cServer.HK \u63d0\u4f9b\u7684\u670d\u52d9\u5c07\u662f\u60a8\u7684\u4e0d\u4e8c\u4e4b\u9078\u3002\u7121\u8ad6\u662f\u6578\u64da\u5eab\u7ba1\u7406\u9084\u662f\u5176\u4ed6\u61c9\u7528\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u96f2\u4f3a\u670d\u5668<\/a> \u5c07\u6709\u52a9\u65bc\u63d0\u5347\u60a8\u7684\u696d\u52d9\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b66\u4e60\u5982\u4f55\u4f7f\u7528 OceanBase LOB Locator \u63a5\u53e3\uff0c\u638c\u63e1\u5927\u5bf9\u8c61\u5b58\u50a8\u4e0e\u7ba1\u7406\u7684\u6280\u5de7\uff0c\u63d0\u5347\u6570\u636e\u5e93\u64cd\u4f5c\u6548\u7387\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-160167","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160167","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=160167"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160167\/revisions"}],"predecessor-version":[{"id":160168,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/160167\/revisions\/160168"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=160167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=160167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=160167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}