Several attention points to create a physicalized view

xiaoxiao2021-03-06  103

1. If you want to create a base table is a physical view of other user tables, you need to give the following privileges to the Owner of the physicalized view: Grant Create Any Materialized View To UseAme; GRANT SELECT Any Table To UserName; If you want to create a view of Refresh On Commit, Then you need this permissions: Grant On Commit Refresh to UserName; 2. Creating the syntax of the refresh on commit as follows, such a physicalized view After the transaction Commit of the base Table, refresh the Create Materialized View MV_T1REFRESH FAST ON COMMIT with PRIMARY Key as Select * from kamus.t1; 3. If you do not specify on commits, then the default is on Demand, only the refresh process in the DBMS_MVIEW package is manually called, the physicalized view will be refreshed 4. After specifying the start with ... next ... option, the first creation will have a complete refresh, and then refreshed after the specified time interval, this example is 1 minute. The syntax is as follows: CREATE MATERIALIZED View MV_T1REFRESH FAST START WITH SYSDATE NEXT SYSDATE 1/24/60 with primary key as select * from kamus.t1; check User_refresh view and user_jobs view, we can find Start With ... Next ... syntax That is, Oracle automatically creates a refresh group, the name of this refresh group is the same as the physicalized view name, and the Implicit_DESTROY property is Y, indicating that the group is automatically deleted as long as the entity view in the group is also automatically deleted. At the same time, a Job, the WAHT attribute in JOB is dbms_refresh.refresh ('"scott". "Mv_t1"); natural, because the automatic refresh is done with Job, then initialization parameters Job_Queue_Processes must be greater than 0, so JOB Will run normally. 5. You can create a refresh group to get refreshed, I have created a refreshing group in this article: http://blog.9cbs.net/kamus/archive/2004/09/18/108496.aspx

转载请注明原文地址:https://www.9cbs.com/read-100550.html

New Post(0)