{"id":1224,"date":"2020-12-04T08:56:26","date_gmt":"2020-12-04T00:56:26","guid":{"rendered":"http:\/\/www.821121.com\/?p=1224"},"modified":"2020-12-29T09:19:36","modified_gmt":"2020-12-29T01:19:36","slug":"12c%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9ainmemory%e5%ae%9e%e6%88%98%ef%bc%883%ef%bc%89im%e5%88%97%e5%ad%98%e5%82%a8%e5%8e%8b%e7%bc%a9%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=1224","title":{"rendered":"12C\u65b0\u7279\u6027\uff1aINMEMORY\u5b9e\u6218\uff083\uff09IM\u5217\u5b58\u50a8\u538b\u7f29\u65b9\u6cd5"},"content":{"rendered":"<h2>IM\u5217\u5b58\u50a8\u538b\u7f29\u6709\u591a\u79cd\u9009\u62e9\uff0c\u5982\u4e0b\uff1a<\/h2>\n<p>\uff081\uff09NO MEMCOMPRESS\uff1a\u6570\u636e\u672a\u538b\u7f29\u3002<br \/>\n\uff082\uff09MEMCOMPRESS FOR DML\uff1a\u6b64\u65b9\u6cd5\u53ef\u5b9e\u73b0\u6700\u4f73DML\u6027\u80fd\u3002\u6b64\u65b9\u6cd5\u5bf9IM\u5217\u5b58\u50a8\u6570\u636e\u7684\u538b\u7f29\u6700\u5c11\uff0c\u4f46\u9664\u5916NO MEMCOMPRESS\u3002<br \/>\n\u6ce8\u610f\uff1aCELLMEMORYExadata\u95ea\u5b58\u7f13\u5b58\u4e0a\u7684\u5b58\u50a8\u4e0d\u652f\u6301\u6b64\u538b\u7f29\u65b9\u6cd5\u3002<br \/>\n\uff083\uff09MEMCOMPRESS FOR QUERY LOW\uff1a\u6b64\u65b9\u6cd5\u53ef\u83b7\u5f97\u6700\u4f73\u67e5\u8be2\u6027\u80fd\u3002<br \/>\n\u6b64\u65b9\u6cd5\u5c06IM\u5217\u5b58\u50a8\u6570\u636e\u538b\u7f29\u5927\u4e8eMEMCOMPRESS FOR DML\u5c0f\u4e8e\u538b\u7f29MEMCOMPRESS FOR QUERY HIGH\u3002<br \/>\n\u5f53INMEMORY\u5728CREATE\u6216ALTERSQL\u8bed\u53e5\u4e2d\u6ca1\u6709\u6307\u5b9a\u538b\u7f29\u65b9\u6cd5\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u5b50\u53e5\u65f6\uff0c\u6216\u8005\u5728MEMCOMPRESS FOR QUERY\u6ca1\u6709\u5305\u62ecLOW\u6216\u7684\u60c5\u51b5\u4e0b\u6307\u5b9a\u4e86\u5b50\u53e5\u65f6\uff0c\u6b64\u65b9\u6cd5\u4e3a\u9ed8\u8ba4\u65b9\u6cd5HIGH\u3002<br \/>\n\u6ce8\u610f\uff1a?\u5982\u679cINMEMORY_FORCE\u521d\u59cb\u5316\u53c2\u6570\u8bbe\u7f6e\u4e3aBASE_LEVEL\uff0c\u5219INMEMORY\u5bf9\u8c61\u548c\u5217\u5c06\u81ea\u52a8\u4f7f\u7528QUERY LOW\u538b\u7f29\u3002\u6570\u636e\u5b57\u5178\u89c6\u56fe\u53ef\u80fd\u4f1a\u7ee7\u7eed\u663e\u793a\u9884\u5148\u5b58\u5728\u7684\u538b\u7f29\u8bbe\u7f6e\uff0c\u4f46\u662f\u57fa\u672c\u7ea7\u522b\u59cb\u7ec8\u900f\u660e\u5730\u538b\u7f29\u8be5QUERY LOW\u7ea7\u522b\u7684\u5bf9\u8c61\u548c\u5217\u3002<br \/>\n\uff084\uff09MEMCOMPRESS FOR QUERY HIGH\uff1a\u6b64\u65b9\u6cd5\u53ef\u5b9e\u73b0\u826f\u597d\u7684\u67e5\u8be2\u6027\u80fd\uff0c\u5e76\u8282\u7701\u7a7a\u95f4\u3002<br \/>\n\u6b64\u65b9\u6cd5\u5c06IM\u5217\u5b58\u50a8\u6570\u636e\u538b\u7f29\u5927\u4e8eMEMCOMPRESS FOR QUERY LOW\u5c0f\u4e8e\u538b\u7f29MEMCOMPRESS FOR CAPACITY LOW\u3002<br \/>\n\uff085\uff09MEMCOMPRESS FOR CAPACITY LOW\uff1a\u6b64\u65b9\u6cd5\u5728\u8282\u7701\u7a7a\u95f4\u548c\u67e5\u8be2\u6027\u80fd\u4e4b\u95f4\u53d6\u5f97\u4e86\u5e73\u8861\uff0c\u5e76\u503e\u5411\u4e8e\u8282\u7701\u7a7a\u95f4\u3002<br \/>\n\u6b64\u65b9\u6cd5\u5c06IM\u5217\u5b58\u50a8\u6570\u636e\u538b\u7f29\u5927\u4e8eMEMCOMPRESS FOR QUERY HIGH\u5c0f\u4e8e\u538b\u7f29MEMCOMPRESS FOR CAPACITY HIGH\u3002\u6b64\u65b9\u6cd5\u5e94\u7528\u4e86\u4e00\u79cd\u79f0\u4e3aOracle Zip\uff08OZIP\uff09\u7684\u4e13\u6709\u538b\u7f29\u6280\u672f\uff0c\u8be5\u6280\u672f\u63d0\u4f9b\u4e86\u4e13\u95e8\u9488\u5bf9Oracle Database\u8fdb\u884c\u4e86\u7279\u522b\u8c03\u4f18\u7684\u8d85\u5feb\u901f\u89e3\u538b\u7f29\u3002\u5fc5\u987b\u5148\u89e3\u538b\u7f29\u8be5\u6570\u636e\uff0c\u7136\u540e\u624d\u80fd\u5bf9\u5176\u8fdb\u884c\u626b\u63cf\u3002<br \/>\n\u5f53MEMCOMPRESS FOR CAPACITY\u6307\u5b9a\u65f6\u4e0d\u5305\u542bLOW\u6216\u65f6\uff0c\u6b64\u65b9\u6cd5\u662f\u9ed8\u8ba4\u65b9\u6cd5HIGH\u3002<br \/>\n\uff086\uff09MEMCOMPRESS FOR CAPACITY HIGH\uff1a\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u6700\u5927\u7a0b\u5ea6\u5730\u8282\u7701\u7a7a\u95f4\u3002<br \/>\n\u6b64\u65b9\u6cd5\u6700\u5927\u7a0b\u5ea6\u5730\u538b\u7f29IM\u5217\u5b58\u50a8\u6570\u636e\u3002<\/p>\n<h2>\u5b9e\u4f8b\u9a8c\u8bc1<\/h2>\n<p>\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-sql\">SQL&gt; alter table test1 inmemory  NO MEMCOMPRESS;\n\nTable altered.\n\nSQL&gt; alter table test1 inmemory MEMCOMPRESS FOR QUERY LOW;\n\nTable altered.\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u901a\u8fc7user_tables\u7684INMEMORY_COMPRESSION\u67e5\u770b\u538b\u7f29\u7ea7\u522b<\/p>\n<pre><code class=\"language-sql\">SQL&gt;  alter table test1 inmemory  NO MEMCOMPRESS;\n\nTable altered.\n\nSQL&gt; select INMEMORY_COMPRESSION from user_tables where table_name=&#039;TEST1&#039;;\n\nINMEMORY_COMPRESSION\n---------------------------------------------------\nNO MEMCOMPRESS\n\nSQL&gt; alter table test1 inmemory MEMCOMPRESS FOR QUERY LOW;\n\nTable altered.\n\nSQL&gt; select INMEMORY_COMPRESSION from user_tables where table_name=&#039;TEST1&#039;;\n\nINMEMORY_COMPRESSION\n---------------------------------------------------\nFOR QUERY LOW\n<\/code><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u901a\u8fc7v$im_segments\u67e5\u538b\u7f29\u7ea7\u522b\u4ee5\u53ca\u4f7f\u7528\u7684\u5185\u5b58\u5927\u5c0f<\/p>\n<pre><code class=\"language-sql\">SQL&gt; col SEGMENT_NAME for a5\nSQL&gt; col INMEMORY_COMPRESSION for a20\nSQL&gt; set linesize 200\nSQL&gt; select INST_ID,SEGMENT_NAME,INMEMORY_SIZE\/1024\/1024,BYTES\/1024\/1024,BYTES_NOT_POPULATED\/1024\/1024,INMEMORY_COMPRESSION from gv$im_segments;\n\nno rows selected\n\nSQL&gt; select count(*) from test1;\n\n  COUNT(*)\n----------\n     72573\n\nSQL&gt;  select INST_ID,SEGMENT_NAME,INMEMORY_SIZE\/1024\/1024,BYTES\/1024\/1024,BYTES_NOT_POPULATED\/1024\/1024,INMEMORY_COMPRESSION from gv$im_segments;\n\n   INST_ID SEGME INMEMORY_SIZE\/1024\/1024 BYTES\/1024\/1024 BYTES_NOT_POPULATED\/1024\/1024 INMEMORY_COMPRESSION\n---------- ----- ----------------------- --------------- ----------------------------- --------------------\n         1 TEST1                    4.25       11.015625                             0 FOR QUERY LOW\n\nSQL&gt; alter table test1 inmemory  NO MEMCOMPRESS;\n\nTable altered.\n\nSQL&gt; select count(*) from test1;\n\n  COUNT(*)\n----------\n     72573\n\nSQL&gt; select INST_ID,SEGMENT_NAME,INMEMORY_SIZE\/1024\/1024,BYTES\/1024\/1024,BYTES_NOT_POPULATED\/1024\/1024,INMEMORY_COMPRESSION from gv$im_segments;\n\n   INST_ID SEGME INMEMORY_SIZE\/1024\/1024 BYTES\/1024\/1024 BYTES_NOT_POPULATED\/1024\/1024 INMEMORY_COMPRESSION\n---------- ----- ----------------------- --------------- ----------------------------- --------------------\n         1 TEST1                   10.25       11.015625                             0 NO MEMCOMPRESS\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230FOR QUERY LOW\u662f4.25MB\uff0cNO MEMCOMPRESS\u662f10.25MB\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IM\u5217\u5b58\u50a8\u538b\u7f29\u6709\u591a\u79cd\u9009\u62e9\uff0c\u5982\u4e0b\uff1a \uff081\uff09NO ME<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47,19],"tags":[],"class_list":["post-1224","post","type-post","status-publish","format-standard","hentry","category-in-memory","category-oracle-12c"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1224"}],"version-history":[{"count":2,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1224\/revisions"}],"predecessor-version":[{"id":1226,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1224\/revisions\/1226"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1224"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}