Oracle materialized View Fast update

Source: Internet
Author: User
Tags oracle materialized view

Build a Test table

CREATE TABLE T_table nologging as SELECT * from Dba_objects;create table T_table_1 nologging as SELECT * from Dba_tables;

--Create a log record

Create materialized view Log on t_table with ROWID, sequence (Object_name,object_type,owner) including new Values;create MA terialized View Log on T_table_1 with rowid,sequence (table_name) including new values;

--Creating materialized views

Create materialized view mv_t_table nologging refresh fast on Demand with rowID START with To_date (' 21-08-2017 10:09:08 ', ' dd-mm-yyyy HH24:MI:SS ') NEXT Sysdate + 1/(24*60) as SELECT COUNT (*), a.object_type,a.owner from t_table a,t_table_1 b whe Re A.object_name=b.table_name GROUP by A.object_type,a.owner


--Test

SELECT * from mv_t_table where owner= ' system ';d elete from t_table where owner= ' SYSTEM '; insert to t_table select * from D ba_objects where owner= ' SYSTEM ';


--View Log generation amount

Select A.name, B.value from V$statname A, v$mystat b where a.statistic# = b.statistic# and A.name = ' redo size ';


--View Refresh Log

SELECT owner,mview_name,last_refresh_scn,last_refresh_date,query,revision from dba_mview_analysis WHERE owner= ' UTF32 ';

--View the Log record table, mlog$ is the log record table, once the update is complete, the contents of this table will be cleared out;

SELECT * FROM Mlog$_t_tableselect * from Mlog$_t_table_1;

Official note See: http://docs.oracle.com/cd/E11882_01/server.112/e10706/repmview.htm#REPLN265

This article is from the "Snowhill" blog, make sure to keep this source http://snowhill.blog.51cto.com/339421/1958119

Oracle materialized View Fast update

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.