{"id":1356,"date":"2021-01-12T16:47:38","date_gmt":"2021-01-12T08:47:38","guid":{"rendered":"http:\/\/www.821121.com\/?p=1356"},"modified":"2021-01-12T16:47:38","modified_gmt":"2021-01-12T08:47:38","slug":"12c%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9ain-memory%e5%ae%9e%e6%88%98%ef%bc%887%ef%bc%89%e5%a6%82%e4%bd%95%e5%b0%86%e6%95%b0%e6%8d%ae%e5%a1%ab%e5%85%85%e5%88%b0inmemory%e4%b8%ad","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=1356","title":{"rendered":"12C\u65b0\u7279\u6027\uff1aIN-MEMORY\u5b9e\u6218\uff087\uff09\u5982\u4f55\u5c06\u6570\u636e\u586b\u5145\u5230inmemory\u4e2d"},"content":{"rendered":"<p>\u5c06\u6570\u636e\u586b\u5145\u5230inmemory\u4e2d\u6709\u4ee5\u4e0b\u51e0\u79cd\u529e\u6cd5<\/p>\n<h2>1\u3001\u4f7f\u7528count\u8bed\u53e5\u586b\u5145<\/h2>\n<p>\u8fd9\u4e2a\u4e4b\u524d\u7684\u5b9e\u9a8c\u4e2d\u6709\u63d0\u53ca\uff0c\u4fdd\u9669\u8d77\u89c1\u9700\u8981\u52a0\u4e0afull hint\u4fdd\u8bc1\u5168\u8868\u67e5\u8be2\u3002\u5b9e\u9a8c\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-sql\">SQL&gt;  ALTER table  test1 no inmemory;\n\nTable altered.\n\nSQL&gt;  ALTER table  test1 INMEMORY;\n\nTable altered.\n\nSQL&gt;  select INST_ID,SEGMENT_NAME,INMEMORY_SIZE\/1024\/1024,BYTES\/1024\/1024,BYTES_NOT_POPULATED\/1024\/1024,INMEMORY_DISTRIBUTE,INMEMORY_DUPLICATE,POPULATE_STATUS from gv$im_segments;\n\nno rows selected\n\nSQL&gt; SELECT \/*+ FULL(test1) NO_PARALLEL(test1) *\/ 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_DISTRIBUTE,INMEMORY_DUPLICATE,POPULATE_STATUS from gv$im_segments;\n\n   INST_ID SEGME INMEMORY_SIZE\/1024\/1024 BYTES\/1024\/1024 BYTES_NOT_POPULATED\/1024\/1024 INMEMORY_D INMEMORY_DUPLICATE   POPULATE_S\n---------- ----- ----------------------- --------------- ----------------------------- ---------- -------------------- ----------\n         1 TEST1                    4.25       11.015625                             0 AUTO       NO DUPLICATE         COMPLETED<\/code><\/pre>\n<h2>2\u3001PRIORITY HIGH\u8fdb\u884c\u586b\u5145<\/h2>\n<pre><code class=\"language-sql\">SQL&gt;  ALTER table  test1 no inmemory;\n\nTable altered.\n\nSQL&gt;  ALTER table  test1 INMEMORY;\n\nTable altered.\n\nSQL&gt;  select INST_ID,SEGMENT_NAME,INMEMORY_SIZE\/1024\/1024,BYTES\/1024\/1024,BYTES_NOT_POPULATED\/1024\/1024,INMEMORY_DISTRIBUTE,INMEMORY_DUPLICATE,POPULATE_STATUS from gv$im_segments;\n\nno rows selected\n\nSQL&gt; ALTER table  test1 no inmemory;\n\nTable altered.\n\nSQL&gt; ALTER table  test1 INMEMORY PRIORITY HIGH;\n\nTable altered.\n\nSQL&gt; select INST_ID,SEGMENT_NAME,INMEMORY_SIZE\/1024\/1024,BYTES\/1024\/1024,BYTES_NOT_POPULATED\/1024\/1024,INMEMORY_DISTRIBUTE,INMEMORY_DUPLICATE,POPULATE_STATUS from gv$im_segments;\n\n   INST_ID SEGME INMEMORY_SIZE\/1024\/1024 BYTES\/1024\/1024 BYTES_NOT_POPULATED\/1024\/1024 INMEMORY_D INMEMORY_DUPLICATE   POPULATE_S\n---------- ----- ----------------------- --------------- ----------------------------- ---------- -------------------- ----------\n         1 TEST1                    4.25       11.015625                             0 AUTO       NO DUPLICATE         COMPLETED<\/code><\/pre>\n<h2>3\u3001\u4f7f\u7528DBMS_INMEMORY.POPULATE\u586b\u5145<\/h2>\n<pre><code class=\"language-sql\">SQL&gt; ALTER table  test1 no inmemory;\n\nTable altered.\n\nSQL&gt; ALTER table  test1 INMEMORY;\n\nTable altered.\n\nSQL&gt; select INST_ID,SEGMENT_NAME,INMEMORY_SIZE\/1024\/1024,BYTES\/1024\/1024,BYTES_NOT_POPULATED\/1024\/1024,INMEMORY_DISTRIBUTE,INMEMORY_DUPLICATE,POPULATE_STATUS from gv$im_segments;\n\nno rows selected\n\nSQL&gt; BEGIN\n  2    DBMS_INMEMORY.POPULATE( schema_name =&gt; &#039;TEST&#039;, table_name =&gt; &#039;TEST1&#039;);\n  3  END;\n  4  \/\n\nPL\/SQL procedure successfully completed.\n\nSQL&gt; select INST_ID,SEGMENT_NAME,INMEMORY_SIZE\/1024\/1024,BYTES\/1024\/1024,BYTES_NOT_POPULATED\/1024\/1024,INMEMORY_DISTRIBUTE,INMEMORY_DUPLICATE,POPULATE_STATUS from gv$im_segments;\n\n   INST_ID SEGME INMEMORY_SIZE\/1024\/1024 BYTES\/1024\/1024 BYTES_NOT_POPULATED\/1024\/1024 INMEMORY_D INMEMORY_DUPLICATE   POPULATE_S\n---------- ----- ----------------------- --------------- ----------------------------- ---------- -------------------- ----------\n         1 TEST1                    4.25       11.015625                             0 AUTO       NO DUPLICATE         COMPLETED<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5c06\u6570\u636e\u586b\u5145\u5230inmemory\u4e2d\u6709\u4ee5\u4e0b\u51e0\u79cd\u529e\u6cd5 1\u3001<\/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-1356","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\/1356","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=1356"}],"version-history":[{"count":1,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1356\/revisions"}],"predecessor-version":[{"id":1357,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/1356\/revisions\/1357"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1356"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}