{"id":624,"date":"2015-04-16T09:08:05","date_gmt":"2015-04-16T07:08:05","guid":{"rendered":"http:\/\/www.rocworks.at\/wordpress\/?p=624"},"modified":"2015-04-16T09:08:05","modified_gmt":"2015-04-16T07:08:05","slug":"oracle-inmemory-database-and-materialized-view","status":"publish","type":"post","link":"https:\/\/www.rocworks.at\/wordpress\/?p=624","title":{"rendered":"Oracle Inmemory Database (and materialized view)&#8230;"},"content":{"rendered":"<p># turn on the inmemory option (it&#8217;s part of the SGA, so get sure that the SGA is big enought)<\/p>\n<p>alter system set inmemory_size=1G scope=spfile;<\/p>\n<p>One gigabyte seems to be less, but inmemory tables are stored column oriented. so, Oracle uses also compression .. for example i loaded a table with 1.2 Mio Rows (but only 5 columns) and i just needed ~30MB (in)memory.<\/p>\n<p># create a materialized view which is refreshd every 5 minutes<\/p>\n<p>create materialized view sma_ext_5min_snp<br \/>\nrefresh complete start with (sysdate) next (sysdate+5\/24\/60) with rowid<br \/>\nas select * from sma_ext_5min;<\/p>\n<p># put the materialized view table into memory<br \/>\nalter table sma_ext_5min_snp inmemory;<\/p>\n<p># check the inmemory state of the materialized view (table)<\/p>\n<p>SELECT table_name, inmemory, inmemory_priority, inmemory_distribute, inmemory_compression, inmemory_duplicate FROM user_tables WHERE table_name = &#8216;SMA_EXT_5MIN_SNP&#8217;<\/p>\n<p># access the view so that it will be loaded into memory (default is load on use)<\/p>\n<p>select count(*) from sma_ext_5min_snp;<\/p>\n<p># check if it is loaded into memory:<\/p>\n<p>select * from v$im_segments<\/p>\n","protected":false},"excerpt":{"rendered":"<p># turn on the inmemory option (it&#8217;s part of the SGA, so get sure that the SGA is big enought) alter system set inmemory_size=1G scope=spfile; One gigabyte seems to be less, but inmemory tables are stored column oriented. so, Oracle &hellip; <a href=\"https:\/\/www.rocworks.at\/wordpress\/?p=624\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-624","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=624"}],"version-history":[{"count":1,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/624\/revisions"}],"predecessor-version":[{"id":625,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/624\/revisions\/625"}],"wp:attachment":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}