Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to View Errors for Materialized Views in Oracle SQL Developer

Posted on 2016-08-09
2
Medium Priority
?
367 Views
Last Modified: 2016-08-15
Dear Sir / Madam

How to View Errors for Materialized Views in Oracle SQL Developer? I have some Materialized Views in an invalid state and I find not the reason.

Oracle Version: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production


Sincerely

Ivo Raemy
0
Comment
Question by:ivoraemy
2 Comments
 
LVL 5

Accepted Solution

by:
Abhimanyu Suri earned 1000 total points
ID: 41748915
@?/rdbms/admin/utlxmv.sql -- Will create default MVIEW capability table

EXEC dbms_mview.explain_mview('SCHEMA.MVIEW'); -- Explain mview
There are other arguments to it as well

 select * from sys.mv_capabilities_table; -- see the report post explanation


Reference : https://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_mview.htm#CEGGEHHC

Some other SQLs that may help

On Source

SELECT b.master,
       a.owner,
       a.name,
       A.SNAPSHOT_SITE,
       to_char(B.CURRENT_SNAPSHOTS,'yyyymmdd hh24miss')
  FROM DBA_REGISTERED_SNAPSHOTS a, DBA_SNAPSHOT_LOGS b
 WHERE A.SNAPSHOT_ID = B.SNAPSHOT_ID;


On target

SELECT owner,
       mview_name,
       master_link,
       refresh_mode,
       refresh_method,
       last_refresh_date
  FROM DBA_MVIEWS
0
 
LVL 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 1000 total points
ID: 41752988
Often a status of "Invalid" for materialized views simply means that a base table the view is built on has been updated and the view has not been refreshed.  In my opinion, Oracle should not report these views as "Invalid" but rather something like "Stale" or "Needs Refresh".

So no, you may not be able to easily find a reason for why these views are "Invalid" other than the fact that some data has changed in the underlying table(s) for the materialized view.
1

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question