Friday, August 14, 2009

ORA-12008: error in materialized view refresh path

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

You may incur in this exception when attempting to refresh a materialized view using procedure DBMS_VIEW.REFRESH, but i guess that also autorefreshing snapshots may suffer the same problem, although i could not verify this. ORA-12008 is a catch-all exception that is followed in the error stack by the real error message that was raised during the execution of the underlying query, in the following example ORA-01476.

begin
dbms_mview.refresh('VIEW_NAME','C');
end;

ORA-12008: error in materialized view refresh path
ORA-01476: divisor is equal to zero

Typically materialized views are not trivial queries so, in order to find out the exact spot that is giving troubles, you might have to run the query interactively. In my case the problem must be caused by a division expression, so i identified all the expressions containing a division and then i selectively commented them out, until i found the "culprit".
Thereafter i had to understand why an expression that is never zero became zero, but this was an entirely different exercise.

See message translations for ORA-12008 and search additional resources.

No comments:

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles