Materialized view does not refresh [message #347617] |
Fri, 12 September 2008 06:38 |
sokstan
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
Hello
I have attempted to set up the materialized view below to refresh complete at the time specified below. The problem is that it does not refresh and pick up the changes to one of the base tables.
When I issue the command:
exec DBMS_REFRESH.REFRESH('TEAMSITE3.FIRMSEARCH_COWS_MV ');
the refresh works..
Any reason why this view is not refreshing at the time stated??
Is it a question of privileges for this user?
Thanks
CREATE MATERIALIZED VIEW FIRMSEARCH_COWS_MV
REFRESH COMPLETE START WITH to_date('11-09-2008 10:00:00','dd-MM-yyyy hh24:mi:ss') NEXT (SYSDATE+1)
AS SELECT distinct spar.COW_REF
FROM LV_RECOGNISED_ATTAINMENTS lra,
LV_POSITION_IN_ORGANISATIONS rio,
SOL_PANELS_AOL_REF spar,
LV_CATEGORIES_OF_WORK cow,
LV_ORGANISATIONS O
WHERE
rio.ORGA_ID = O.ID
AND rio.BODY_ID = lra.BODY_ID
AND lra.RAT_CODE = spar.RAT_CODE
AND spar.COW_REF = cow.REF;
|
|
|
|
|
|
Re: Materialized view does not refresh [message #347635 is a reply to message #347617] |
Fri, 12 September 2008 08:11 |
sokstan
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
When I first created this view I had no errors reported.
I think there may be a misunderstanding here..
Note: The materialized view I created did so without errors.
My problem is that the view does not refresh at the times I have specified ie.
REFRESH COMPLETE START WITH to_date('11-09-2008 10:00:00','dd-MM-yyyy hh24:mi:ss') NEXT (SYSDATE+1)
Is there anything wrong with this statement?
It only refreshes when I issue the command:
exec DBMS_MVIEW.REFRESH('TEAMSITE3.FIRMSEARCH_COWS_MV','C');
Is there anything more simpler I could try to check that a timed complete refresh actually works? Any SQL commands I can issue to check there is nothing wrong with the refresh job settings for this view?
Thanks
|
|
|
|
Re: Materialized view does not refresh [message #348080 is a reply to message #347617] |
Mon, 15 September 2008 10:16 |
sokstan
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
Hello
I do not understand your latest update:
No Issues.
You can continue with as per your materialized view. No need manual refresh.
What does this mean? If I try to create the materialized view
on a timed refresh, it does not refresh with the base tables!
This is my issue. Any ideas or can you provide me with some
examples I could try just paste to get the view to refresh on a timed basis just to see if it works at least!!
I re-interate, calling the command line refresh statement works.
Thanks
|
|
|
|
Re: Materialized view does not refresh [message #349605 is a reply to message #347617] |
Mon, 22 September 2008 06:11 |
sokstan
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
Only had a chance to look at your reply recently. Thanks.
I replicating your example to my particular materialized view which joins across several base tables:
CREATE MATERIALIZED VIEW FIRMSEARCH_COWS_MV
REFRESH COMPLETE START WITH (SYSDATE) NEXT (SYSDATE+1/1440) WITH ROWID
ENABLE QUERY REWRITE
AS SELECT distinct spar.COW_REF
FROM LV_RECOGNISED_ATTAINMENTS lra,
LV_POSITION_IN_ORGANISATIONS rio,
SOL_PANELS_AOL_REF spar,
LV_CATEGORIES_OF_WORK cow,
LV_ORGANISATIONS O
WHERE
rio.ORGA_ID = O.ID
AND rio.BODY_ID = lra.BODY_ID
AND lra.RAT_CODE = spar.RAT_CODE
AND spar.COW_REF = cow.REF;
When I type:
select * from FIRMSEARCH_COWS_MV;
I get 8 rows returned.
And when I run the main part of query which makes up the mat view :
SELECT distinct spar.COW_REF
FROM LV_RECOGNISED_ATTAINMENTS lra,
LV_POSITION_IN_ORGANISATIONS rio,
SOL_PANELS_AOL_REF spar,
LV_CATEGORIES_OF_WORK cow,
LV_ORGANISATIONS O
WHERE
rio.ORGA_ID = O.ID
AND rio.BODY_ID = lra.BODY_ID
AND lra.RAT_CODE = spar.RAT_CODE
AND spar.COW_REF = cow.REF;
I get 8 rows also.
Now when I update a value in one of these base tables:SOL_PANELS_AOL_REF , and then run:
SELECT distinct spar.COW_REF
FROM LV_RECOGNISED_ATTAINMENTS lra,
LV_POSITION_IN_ORGANISATIONS rio,
SOL_PANELS_AOL_REF spar,
LV_CATEGORIES_OF_WORK cow,
LV_ORGANISATIONS O
WHERE
rio.ORGA_ID = O.ID
AND rio.BODY_ID = lra.BODY_ID
AND lra.RAT_CODE = spar.RAT_CODE
AND spar.COW_REF = cow.REF;
I now get 7 rows returned.
But now when I run the the materialized view query again:
select * from FIRMSEARCH_COWS_MV;
I still get 8 rows returned. When it should have refreshed to 7 rows after one minute! Is this not correct??
What am I doing wrong?
Is there an Oracle setting I have missed which needs to be set to enable materialized view refresh?
|
|
|
Re: Materialized view does not refresh [message #349615 is a reply to message #349605] |
Mon, 22 September 2008 06:35 |
babuknb
Messages: 1736 Registered: December 2005 Location: NJ
|
Senior Member |
|
|
Thanks.
I want to know two things..
1.
>>Now when I update a value in one of these base tables:SOL_PANELS_AOL_REF , and then run:
>>I now get 7 rows returned.
You done UPDATE or DELETE ?
2.
REFRESH COMPLETE START WITH (SYSDATE) NEXT (SYSDATE+1/1440)
Materialized view refresh every one min only. Once again confirm me have you checked after one minute?
3.
Try this.
1. insert some few values in base table.
2. Create Materialized view.
3. Execute below query in base table & materialized view confirm me total number of records.
SELECT distinct spar.COW_REF
FROM LV_RECOGNISED_ATTAINMENTS lra,
LV_POSITION_IN_ORGANISATIONS rio,
SOL_PANELS_AOL_REF spar,
LV_CATEGORIES_OF_WORK cow,
LV_ORGANISATIONS O
WHERE
rio.ORGA_ID = O.ID
AND rio.BODY_ID = lra.BODY_ID
AND lra.RAT_CODE = spar.RAT_CODE
AND spar.COW_REF = cow.REF;
4. Now try to insert/delete some records in base table.
5. From Base table. Using below query send me total number of records.
SELECT distinct spar.COW_REF
FROM LV_RECOGNISED_ATTAINMENTS lra,
LV_POSITION_IN_ORGANISATIONS rio,
SOL_PANELS_AOL_REF spar,
LV_CATEGORIES_OF_WORK cow,
LV_ORGANISATIONS O
WHERE
rio.ORGA_ID = O.ID
AND rio.BODY_ID = lra.BODY_ID
AND lra.RAT_CODE = spar.RAT_CODE
AND spar.COW_REF = cow.REF;
6. After 1 minute try this & let me know.
SELECT distinct spar.COW_REF
FROM LV_RECOGNISED_ATTAINMENTS lra,
LV_POSITION_IN_ORGANISATIONS rio,
SOL_PANELS_AOL_REF spar,
LV_CATEGORIES_OF_WORK cow,
LV_ORGANISATIONS O
WHERE
rio.ORGA_ID = O.ID
AND rio.BODY_ID = lra.BODY_ID
AND lra.RAT_CODE = spar.RAT_CODE
AND spar.COW_REF = cow.REF;
select count(*) from FIRMSEARCH_COW;
|
|
|
Re: Materialized view does not refresh [message #350173 is a reply to message #347617] |
Wed, 24 September 2008 05:13 |
sokstan
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
Hello
Thanks for the reply. I have responded in line to your request:
I want to know two things..
1.
>>Now when I update a value in one of these base tables:SOL_PANELS_AOL_REF , and then run:
>>I now get 7 rows returned.
You done UPDATE or DELETE ? This was an update of a row on the base table SOL_PANELS_AOL_REF. Should this make a difference?
2.
REFRESH COMPLETE START WITH (SYSDATE) NEXT (SYSDATE+1/1440)
Materialized view refresh every one min only. Once again confirm me have you checked after one minute?
Yes, I can confirm I checked after one minute, then 5 mins etc etc.
I will now try to action the rest of your post. And get back to you. But can you please respond to my replies above. Thanks.
|
|
|
|
|
Re: Materialized view does not refresh [message #350650 is a reply to message #350476] |
Thu, 25 September 2008 16:12 |
babuknb
Messages: 1736 Registered: December 2005 Location: NJ
|
Senior Member |
|
|
Hello,
Quote: | You done UPDATE or DELETE ? This was an update of a row on the base table SOL_PANELS_AOL_REF. Should this make a difference?
|
Quote: | Yes, I can confirm I checked after one minute, then 5 mins etc etc.
|
I agree your both statement. There is NO Issues.
Quote: | what about this point???
Quote: | I will now try to action the rest of your post. And get back to you.
|
|
Babu
[Updated on: Thu, 25 September 2008 16:26] Report message to a moderator
|
|
|
Re: Materialized view does not refresh [message #352107 is a reply to message #350650] |
Mon, 06 October 2008 03:45 |
sokstan
Messages: 8 Registered: September 2008
|
Junior Member |
|
|
I just picked up your latest update and I am again confused by your statements!
What do you mean by:
I agree your both statement. There is NO Issues
There are issues - my questions where:
1 - Should an update statement run against the base table
SOL_PANELS_AOL_REF make any difference to the refresh on the materialised view? Should it refresh?
2 - Checking the materialised view table after one, two and three
minutes did not make a difference! The view did not refresh!!
Do you know why???
Please respond to these specific points please
Thanks
|
|
|
|