Solved

How to View Errors for Materialized Views in Oracle SQL Developer

Posted on 2016-08-09
2
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
Abhimanyu Suri earned 250 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 250 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

726 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