{"id":238,"date":"2011-12-17T01:51:16","date_gmt":"2011-12-16T22:51:16","guid":{"rendered":"http:\/\/fatihacar.com\/blog\/?p=238"},"modified":"2012-04-27T11:52:51","modified_gmt":"2012-04-27T08:52:51","slug":"create-fast-refresh-for-materialized-views-in-oracle","status":"publish","type":"post","link":"https:\/\/www.fatihacar.com\/blog\/create-fast-refresh-for-materialized-views-in-oracle\/","title":{"rendered":"Create Fast Refresh for Materialized Views in Oracle"},"content":{"rendered":"<p>You can demand fast refresh for materialized views. Because refresh of tables which have large data are hard. The refresh time is long. Thus, you have to use fast refresh statement for this object. <\/p>\n<p>Firstly, You have to create materialized view log for table. If change a data, this changes will write this log. You have to determine which table to perform log. <\/p>\n<p><strong>Create Log Table<\/strong><\/p>\n<blockquote><p>\nSQL> create materialized view log on tablename with sequence,rowid<br \/>\n(column1, column2, column3)<br \/>\nincluding new values;\n<\/p><\/blockquote>\n<p><strong>Create Materialized View With Fast Refresh Option<\/strong><\/p>\n<blockquote><p>\nSQL> create materialized view mviewname<br \/>\nparallel<br \/>\nbuild immediate<br \/>\nrefresh fast with rowid on demand as<br \/>\n(select column1,column2,column3 from tablename);\n<\/p><\/blockquote>\n<p>First refresh have to be conflict refresh. After you can use fast refresh.<\/p>\n<p><strong>Execute Refresh<\/strong><\/p>\n<blockquote>\n<p>SQL> exec dbms_mview.refresh(&#8216;mviewname&#8217;,&#8217;C&#8217;);<br \/>\nSQL> exec dbms_mview.refresh(&#8216;mviewname&#8217;,&#8217;FAST&#8217;);\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>You can demand fast refresh for materialized views. Because refresh of tables which have large data are hard. The refresh time is long. Thus, you have to use fast refresh statement for this object. Firstly, You have to create materialized view log for table. If change a data, this changes will write this log. You&#8230;<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9,6],"tags":[14,90,91],"class_list":["post-238","post","type-post","status-publish","format-standard","hentry","category-administration","category-oracle-sql","tag-database-administration","tag-oracle","tag-oracle-sql"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p39NFI-3Q","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":7,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":271,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/238\/revisions\/271"}],"wp:attachment":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}