How to ADD Materialized Views to Refresh Group
Hi,
My requirement is, i want to refresh MVs(fast refresh only) by using DBMS_SCHEDULER. For this i have created one DBMS_SCHEDULER job like below.
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
JOB_NAME => 'REFRESH_MV_UPLOAD',
JOB_TYPE => 'PLSQL_BLOCK',
JOB_ACTION => 'DBMS_REFRESH.REFRESH('MV_UPLOAD_GRP');',
REPEAT_INTERVAL => 'FREQ=MINUTELY; INTERVAL=30',
ENABLED => TRUE
END;
In the above script, i created one refresh group 'MV_UPLOAD_GRP'. So what my requirement is i want to ADD my MVs refresh scripts to this group. Scripts as below...
Refresh MV Scripts:
1) Exec dbms_mview.refresh('emp.entity', 'f');
2) Exec dbms_mview.refresh('emp.identifier', 'f');
3) Exec dbms_mview.refresh('emp.rating_hist', 'f');
. so on.
Can anyboy help me how to add these scripts to refresh group 'MV_UPLOAD_GRP'.
Regards
Raj
ALL_REFRESH and ALL_REFRESH_CHILDREN
http://download.oracle.com/docs/cd/B19306_01/server.102/b14227/rarsnapviews.htm#REPMA027
Nicolas.
Similar Messages
-
How to make materialized view fast refresh parallel
We have Oracle 11.2.0.1 on Redhat 5.2. We use a dozen of fast refresh materialized views in our application.
From time to time MV refresh takes longer time than the refresh interval.
One of way to improve performance of MV refresh is to make the refresh parallel, e.g. http://www.dba-oracle.com/t_materialized_views_refreshing_performance.htm
- Use parallel DML - Oracle author Michael Armstrong Smith notes "I've done parallel materialized view refreshing
on tables recently and improved the load times considerably. Rather than having one load which took 2 hours,
I run 4 parallel loads, one for each partition. The length of time for the whole process is now determined by
how long the biggest partition takes to load. In my case, this is 40 minutes, with two 30 minute loads and one
20 minute load. Overall I am saving 1 hour 20 minutes. I can now add further partitions and do the same thing.
My only limitation is the parallel loads because I don't have unlimited processing power.
{code} My master tables are not partitioned, but think parallel will still better than non-parallel.
Now the question, how to make refresh parallel. According to the paragraph cited above, Use parallel DML appears doing the job. Can someone confirm that.
We use {code}
alter materialied view MV_OFFENSE parallel REFRESH FAST start with sysdate next sysdate+ 1/24;
{code}to schedule refresh. Does the parallel clause here parallels query the MV or refresh the MV?
Any other way to make MV refresh parallel?
ThanksDoc http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/refresh.htm#i1006319 says:
>
In a data warehousing environment, assuming that the materialized view has a parallel clause, the following sequence of steps is recommended:
1.
Bulk load into the fact table
2.
Enable parallel DML
3.
An ALTER SESSION ENABLE PARALLEL DML statement
4.
Refresh the materialized view -
How to prevent materialized views from refreshing if source table is zero
any ideas?
Probably not what you were hoping for but here are a couple of ideas.
Your account shows - 113 (85 unresolved)
1. How about helping to keep the forum clean by reviewing your 85 unresolved previous questions and giving HELPFUL or ANSWERED credit to those that helped you in the past.
2. Read the FAQ at the top right of the page and post the information about your system and software so that we know what you are working with.
3. Ask your question in the body of the thread. Don't just say 'Any ideas'.
What exactly is your question? Is this an academic question or do you have an actual problem that needs to be addressed?
If you have an actual problem produce the DDL for the materialized view and information about the type of refresh that has been set up for it. Is there a materialized view log on the base table(s)?
The simple answer to your quest is to use REFRESH ON DEMAND and check the base table(s) before you do a manual
refresh. The best answer depends on what version of Oracle you are using and what your actual setup is. Are your
MVs in REFRESH GROUPS?. That can make a difference in the answer.
How can anyone help with this question if you won't provide the information needed(FAQ)? Why SHOULD anyone help if you show you don't appreciate the help by marking questions answered once you have been helped. -
How to add material group in rvinvoice standard script?
how to add material group in rvinvoice standard script?
regardsHi
You have to copy the standard script first .
you need to write External subroutine in layout.
This is just for basic info..you can search in sdn external subroutines in script..you get so many inputs.
Thanks -
How to CREATE MATERIALIZED VIEW LOG (MV fast refresh) with some JOINS
Hi @ all,
i'm trying to create a MATERIALIZED VIEW LOG for a fast refresh of a MATERIALIZED VIEW.
It works fine with a simple Request in the MATERIALIZED VIEW:
CREATE MATERIALIZED VIEW MV_ZOTD43_P
TABLESPACE GDII
BUILD IMMEDIATE
REFRESH FORCE AS
SELECT * FROM ZOTD43_P;
COMMIT;
CREATE MATERIALIZED VIEW LOG ON ZOTD43_P
TABLESPACE "GDII"
WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
call DBMS_MVIEW.REFRESH('MV_ZOTD43_P', 'f');
But when I use a complex SQL-Request with some JOINS (one of the Table with spatial Data) in the MATERIALIZED VIEW, I get an error:
CREATE MATERIALIZED VIEW MV_TEST
TABLESPACE GDII
BUILD IMMEDIATE
REFRESH FORCE AS
SELECT lptd04_p.sst_nr AS sst_nr,
lptd03_p.aaaa AS aaaa,
lptd04_geom.geom as geom
FROM lptd04_p lptd04_p
JOIN lptd01_p lptd01_p ON lptd01_p.cre_nr = lptd04_p.sst_nr
JOIN lptd04_geom ON lptd04_geom.sst_nr = lptd04_p.sst_nr
JOIN lptd03_p lptd03_p ON lptd03_p.lief_nr = lptd04_p.lief_nr;
COMMIT;
CREATE MATERIALIZED VIEW LOG ON LPTD04_P
TABLESPACE "GDII"
WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
call DBMS_MVIEW.REFRESH('MV_TEST', 'f');
Error report:
SQL Error: ORA-12004: REFRESH FAST kann für Materialized View "GDI"."MV_GDI_SST_STAMM" nicht benutzt werden
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2255
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2461
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2430
ORA-06512: in Zeile 1
12004. 00000 - "REFRESH FAST cannot be used for materialized view \"%s\".\"%s\""
*Cause: The materialized view log does not exist or cannot be used. PCT
refresh is also not enabled on the materialized view
*Action: Use just REFRESH, which will reinstantiate the entire table.
If a materialized view log exists and the form of the materialized
view allows the use of a materialized view log or PCT refresh is
possible after a given set of changes, REFRESH FAST will
be available starting the next time the materialized view is
refreshed.
Am I doing something wrong or is it not possible CREATE MATERIALIZED VIEW LOG when the MATERIALIZED VIEW got some JOINS?
Regards,
GreqThanks for the link Alessandro ,
the error seems something to do with the Column-Type SDO_GEOMETRY, so
i create a new thread in the Spatial Discussion forum:
FAST REFRESHing of Oracle Materialized Views containing SDO_GEOMETRY column
Regards,
Greq -
How to add classification view using BAPI_MATERIAL_SAVEDATA
Hi,
Please any one let me know how to add classification view using BAPI_MATERIAL_SAVEDATA to the material master.
Thanks,
shekarWe use this bapi on a regular basis as well as classification of materials. We have success doing this in 2 steps. First step is to save the material using BAPI_MATERIAL_SAVEDATA, second step is to save classification using BAPI_OBJCL_CHANGE (this can be used for both create and change) Also look at Function Group CLBPA . there are several bapi's in that group dealing with object classification, including the one I mentioned..
-
Materialized View Not Refreshing
Hello,
I have a materialized view that is not refreshing. I tried to set it to refresh it every 24 hours by specifying the following:
REFRESH COMPLETE START WITH sysdate+0 NEXT sysdate+1
The database modified it to be:
REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT sysdate+1
I'm not sure why this materialized view is not being refreshed. Here is the full DDL for the view:
CREATE MATERIALIZED VIEW "MBMMASTER"."CLINIDXINVTRANSDATA"
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "FAC_DATA"
BUILD IMMEDIATE
USING INDEX
REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT sysdate+1
USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS SELECT
IIT.Group_ZZ as IDXGroupKey
, IIT.Prov as IDXProviderKey
, IIT.U_Second_Phys as IDXSecondaryProviderKey
, IIT.Div as IDXDivisionKey
, IIT.Loc as IDXLocationKey
, IIT.Billing_Area as IDXBillingAreaKey
, IIT.Proc as IDXProcedureKey
, IIT.Post_pd as IDXPostPeriod
, Max(CASE
WHEN SIBP.FacultyPK is Null Then PIBP.FacultyPK
WHEN EXISTS (
SELECT *
FROM FacultyAdmin.FacAdmAppointment APP
WHERE SIBP.FacultyPK = APP.FacultyPK
AND APP.AdmApptTypePK = 'APT0001021' /* MidLevel Track */
AND APP.AdmRankListPK = 'RKL0001141' /* MidLevel Rank */
AND IIT.SER_DT BETWEEN APP.AdmApptStartDate AND NVL(APP.AdmApptEndDate,IIT.SER_DT)
) THEN SIBP.FacultyPK
ELSE PIBP.FacultyPK
END) AS FacultyPK
, SUM(IIT.RVU
) as IDXRVU
, SUM(
CASE
WHEN Sign(IIT.RVU) = Sign(IIT.RVU_WORK_COMP) THEN IIT.RVU_WORK_COMP
ELSE IIT.RVU_WORK_COMP * -1
END
) as IDXWorkRVU
, SUM(
CASE
WHEN Sign(IIT.RVU) = Sign(IIT.RVU_EXPENSE_COMP) THEN IIT.RVU_EXPENSE_COMP
ELSE IIT.RVU_EXPENSE_COMP * -1
END
) as IDXExpenseRVU
, SUM(
CASE
WHEN Sign(IIT.RVU) = Sign(IIT.RVU_MALPRATICE_COMP) THEN IIT.RVU_MALPRATICE_COMP
ELSE IIT.RVU_MALPRATICE_COMP * -1
END
) as IDXMalpracticeRVU
FROM IDXInvTrans@DW IIT
, FacultyMaster.FacIDXBARProvider PIBP
, FacultyMaster.FacIDXBARProvider SIBP
where IIT.Prov = PIBP.IDXBARProviderKey
AND IIT.U_Second_Phys = SIBP.IDXBARProviderKey(+)
AND IIT.pay_code_num = 99
AND IIT.Post_Pd >= 10101
GROUP BY
IIT.Group_ZZ
, IIT.Prov
, IIT.U_Second_Phys
, IIT.Div
, IIT.Loc
, IIT.Billing_Area
, IIT.Proc
, IIT.Post_pd;
Thanks in advance,
ChrisI had quite similar problem/question. And un/fortunately answered it by myself, nobody was interested in help :)
For the first sight: two "concurrent" statements have been used: ON DEMAND and START WITH. I wonder why database changed good code.
Look into my topic: How to recreate materialized view and maintain priviledges?
Look also here: Re: error on "CREATE MATERIALIZED VIEW" for more details.
HTH, Rev -
How to add Material photo in SAP
Hi folks,
Does anybody know how to add material photo to material No?
As now, when our old spare parts are bad, maintanance user have to find a new one to replace, so they need to provide the material No to warehouse user or purchase dept.
But now as there are a lot of spare parts in SAP, iIt's difficult for them to appoint SAP material No from layout, so we want to add photo to material No.
Great thanks!
Li Jing
Edited by: Li Jing on Apr 2, 2010 12:14 PMWhen viewing material, from main menu select System > Services for Object.
You may get a choose object type option, if you do, choose a std way to work e.g. always use Object = Material.
You'll then get a mini free floating toolbar. Select the far left Icon and Create an attachment. Navigate to your picture and upload.
To view the picture, select the Icon second left (this is greyed out if there are no attachments).
You can attach any number of pictures or Word documents etc.
Regards,
Nick -
Materialized View fast refresh problems
I have two databases (A and B).
In database A, user NICK has a table called COLOUR_MASTER.
Also in that database, NICK issues the command create materialized view log on colour_master with primary key including new values (and yes, there is a primary key defined for this table)
In database B, there is a database link called A_LINK, connect to nick identified by password using 'dbA';
Also in database B, user IAN creates a materialized view CM_MV refresh fast as select * from colour_master@A_LINK
That statement completes successfully, and there are several million rows in CM_MV when it's done.
Immediately, IAN issues this command:
begin
dbms_mview.refresh('CM_MV');
end;
...and after a slight pause, he gets the error
ORA-12008: error in materialized view refresh path
ORA-02068: following sever error from A_LINK
ORA-03113: end-of-file on communication channel
Yet a +'select count(*) from colour_master@A_LINK'+ submitted immediately manages to return the correct number of records in database A -so that 3113 is a bit misleading, I think, in that instance A did not crash, the database remains accessible at all times, there are no networking issues (database A and B are both located in the same server room, so this isn't like I'm trying to connect half way round the globe).
The only thing I can think of is that there's a permissions problem causing this error. That because the MV creation is done via a link, there's no problem in IAN seeing the appropriate objects, but that once refreshes come into play, maybe there is.
Can anyone shed any light on why I can't do the fast refresh of the view I can happily create, please?I'm surprised that no-one has asked you to do the obvious: try doing a select * from colour_master@A_LINK, without that being wrapped up in a create materialized view statment. Just do a plain select * from...
My bet is that you'll get an ORA_22992 cannot use LOB locators selected from remote tables error. And if you can't do a simple select * from a remote table, I suspect that you can reasonably expect fireworks when you try to create or refresh a materialized view on such a thing!
Here's a quick test:
In Database 1:
=========
SQL> create table A (col1 varchar2(2), col2 clob);
Table created.
SQL> alter table A add constraint A1 primary key (col1);
Table altered.
SQL> insert into A values ('AA','This is an entry into a clob column');
1 row created.
SQL> commit;
Commit complete.
SQL> create materialized view log on A with primary key including new values;
Materialized view log created.In Database 2
=========
SQL> connect ims_global/v0yager1@ussd
Connected.
SQL> create materialized view B refresh fast as
2 select * from A@remotedb_link;
Materialized view created.
SQL> exec dbms_mview.refresh('B');
BEGIN dbms_mview.refresh('B'); END;
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-02068: following severe error from REMOTEDB_LINK
ORA-03113: end-of-file on communication channel
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2251
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2457
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2426
ORA-06512: at line 1
SQL> drop materialized view B;
Materialized view dropped.
SQL> create materialized view B refresh fast as
2 select col1 from A@ims_link;
Materialized view created.
SQL> exec dbms_mview.refresh('B');
PL/SQL procedure successfully completed.Which seems to replicate your problem rather well, I think.
I don't know if there are any workarounds for this. I mean, obviously you can miss out the CLOB column in your 'create MV' statement as I just did, but I don't know whether you are even allowed or supposed to be able to create an MV on lob columns and that patch such-and-such will let you do it. Maybe someone else can provide that information.
But at least you won't have to play Russian roulette with your init.ora parameters! -
How to get Materialized View to ignore unused columns in source table
When updating a column in a source table, records are generated in the corresponding materialized view log table. This happens even if the column being updated is not used in any MV that references the source table. That could be OK, so long as those updates are ignored. However they are not ignored, so when the MV is fast refreshed, I find it can take over a minute, even though no changes are required or made. Is there some way of configuring the materialized view log such that the materialized view refresh ignores these updates ?
So for examle if I have table TEST:
CREATE table test (
d_id NUMBER(10) PRIMARY KEY,
d_name VARCHAR2(100),
d_desc VARCHAR2(256)
This has an MV log MLOG$_TEST:
CREATE MATERIALIZED VIEW LOG ON TEST with rowid, sequence, primary key;
CREATE MATERIALIZED VIEW test_mv
refresh fast on demand
as
select d_id, d_name
from test;
INSERT 200,000 records
exec dbms_mview.refresh('TEST_MV','f');
update test set d_desc = upper(d_desc) ;
exec dbms_mview.refresh('TEST_MV','f'); -- This takes 37 seconds, yet no changes are required.
Oracle 10g/11gI would love to hear a positive answer to this question - I have the exact same issue :-)
In the "old" days (version 8 I think it was) populating the materialized view logs was done by Oracle auto-creating triggers on the base table. A "trick" could then make that trigger become "FOR UPDATE OF <used_column_list>". Now-a-days it has been internalized so such "triggers" are not visible and modifiable by us mere mortals.
I have not found a way to explicitly tell Oracle "only populate MV log for updates of these columns." I think the underlying reason is that the MV log potentially could be used for several different materialized views at possibly several different target databases. So to be safe that the MV log can be used for any MV created in the future - Oracle always populates MV log at any update (I think.)
One way around the problem is to migrate to STREAMS replication rather than materialized views - but it seems to me like swatting a fly with a bowling ball...
One thing to be aware of: Once the MV log has been "bloated" with a lot of unneccessary logging, you may perhaps see that all your FAST REFRESHes afterwards becomes slow - even after the one that checked all the 200000 unneccessary updates. We have seen that it can happen that Oracle decides on full table scanning the MV log when it does a fast refresh - which usually makes sense. But after a "bloat" has happened, the high water mark of the MV log is now unnaturally high, which can make the full table scan slow by scanning a lot of empty blocks.
We have a nightly job that checks each MV log if it is empty. If it is empty, it locks the MV log and locks the base table, checks for emptiness again, and truncates the MV log if it is still empty, before finally unlocking the tables. That way if an update during the day has happened to bloat the MV log, all the empty space in the MV log will be reclaimed at night.
But I hope someone can answer both you and me with a better solution ;-) -
How to Add multiple entry to the group policy security filtering
How to Add multiple entry to the group policy security filtering
Is there any way we can add multiple entry to the Domain group policy Security filtering tab.Currently its not allowing to add more then one entry at a time.
Getting Error like "only one name can be entered,and the name cannot contain a semicolon.Enter a valid name"Hi
Are you trying to add more users or groups through Group Policy Management Security Filtering tab?
Try right clicking on the policy and then edit
Then in Editor Right click on the name of the policy and Properties
Security tab and add user or group from this tab. Just make sure if you are adding user or groups "Select this object type" has
the correct option also "From this Location" is set to your entire directory not the local server.
Update us with the above.
Thanks -
How to add a button to the grouped data in an AdvancedDataGrid?
Hi,
Can anyone please suggest how to add a button to the grouped data in the AdvancedDataGrid?
I have tried extending the AdvancedDataGridGroupItemRenderer and using it as the groupItemRenderer but its not reflecting.
For the leaf node the itemRenderer property works just fine.
Please help!HI ,
I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list but still I am unable to get any additional button on the output ALV popup.
Please help.
Regards,
Kavya. -
Regarding : How to add a user to portal group with the help of webdynpro .
Hii ,
I am working on an application in which with the help of an action( Button) we r adding a user in Ztable in R/3 , as well as group in portal.
The user r successfully creating in Ztable but from portal side No user is assigned to Portal group.
I need coding solution for " How to add a user to portal group with help of webdynpro"
Any usefull link will also do.
Pls anyone have any solution ??
Thnks in advance.
Rewards r waiting for u .Hi,
Use UME api to add user to portal group.
Using UME API:
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40d562b7-1405-2a10-dfa3-b03148a9bd19
Regards,
Naga -
Materialized view with refresh frequency of once every day
DB Version:11g
If i want to create a Materialized view which should get refreshed once every day, the below code should be fine. Right
create materialized view mv_empname refresh complete
start with sysdate
next sysdate + 1
as select empname from emp Should i be using TRUNC
like
next trunc(sysdate) + 1 for any reason?If you dont use TRUNC i guess it will be refreshed every day at the time when it was first refreshed. That is If first time it was refreshed on 3pm then ever day it will be refreshed at 3pm.
But when you user TRUNC you are removing the time part and it will be set to 00:00:00 meaning 12AM. so the refresh will happen at 12AM ever day. -
Materialized view - fast refresh not working on joins
Hello,
Is it true that fast refresh for materialized view is not possible when I do a union of 2 tables, although both tables have materialized view logs ?there are a number of restrictions with fast refresh, read Materialized View Fast Refresh Restrictions and ORA-12052 [ID 222843.1]
edit: his royal kyteness has posted on this before
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6506967884606
Edited by: deebee_eh on Apr 25, 2012 3:13 PM
Maybe you are looking for
-
How to get the item name from a column in an interactive report?
I created an interactive report. Then on the same page I added a tabular form region. What I want to implement is that, when I click a column link button on a specific row, the name of the row will be passed to the tabular region, so that the tabular
-
Merging PDFs and then saving them as one file in Leopard
Would someone please tell me how I can merge PDF files into one PDF file. I have been able to drag and drop them together in Preview. I would love to be able to save the merged files into one file. Any ideas. I have read a lot online about this possi
-
Hi , I'm creating a dbadapter for a custom API written in APPS schema - TYPE MISIPM_LOB IS RECORD ( FILE_ID IPM_LOBS.FILE_ID%TYPE, FILE_NAME IPM_LOBS.LOB_NAME%TYPE ); TYPE MISIPM_LOB_LIST IS TABLE OF MISIPM_LOB; PROCEDURE GET_FILE_ID_DETAILS( P_SOURC
-
Firefox Crashes when opening PDF file with Acrobat 9.4 installed.
Everytime I attempt to open a PDF file, Firefox will crash. I have Adobe Reader 9.4 installled. This has been happening since 7/9/2010
-
J2ME Wireless Toolkit 2.5
Hi all, I would like to ask if this new veresion (J2ME Wireless toolkit 2.5) supports ArrayList. I have developed a program with ArrayList , is it possible to run it in this new version without problems. Thanks