Materialized views in oracle.

We have Materialized views. There is data different (count ) from original table  and views.
SO I want to know,
  how to find details about views (query etc to generate view ) in oracle.
why it is different? how to find that? Is it possible that views refresh late from original table?

Thanks for reply.
LVL 11
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Swadhin Ray Commented:
>>> how to find details about views (query etc to generate view ) in oracle.

Try to query for the view code:

select dbms_metadata.get_ddl('VIEW','YOURVIEWNAME') VIEWCODE FROM DUAL;

Then check if your query for the view is really pulling the data or what logic is been used to pull the data from the source tables.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Swadhin Ray Commented:
Materialized views in oracle update periodically base upon the query definition, for more information you can check from the below link:
Wasim Akram ShaikCommented:
Materialized views are views of the object located in remote database, unlike normal views, materialized view will have a base table in your local database which should get refreshed accordingly as per ur need.

If this doesnot get refreshed, then you will find the difference in the local replica and the actual base table located in the remote database.

There are various methods of refresh
1. Fast(loads the delta between the local and remote db from the last refreshed time at local)
2. Complete(Truncates the table in local db and reloads it again from remote db)

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Swadhin Ray Commented:
@wasimibm : can't we create a Materialized view within the database?
Wasim Akram ShaikCommented:
@slobaray: yes you can ofcourse create a materialized view in the same database, again. the concept of materialized view remains the same.

If you create the materialzed view in the same database then you will create a self db link(db link pointing to the same database) so that concept of source db(local db) and target db(remote db) remains there..
ManishLeadAuthor Commented:
Are there sql to refresh mat. view.?

Wasim Akram ShaikCommented:
syntax can be found here;

sample syntax found here:

   { list                 IN     VARCHAR2,
   | tab                  IN OUT DBMS_UTILITY.UNCL_ARRAY,}
   method                 IN     VARCHAR2       := NULL,
   rollback_seg           IN     VARCHAR2       := NULL,
   push_deferred_rpc      IN     BOOLEAN        := true,
   refresh_after_errors   IN     BOOLEAN        := false,
   purge_option           IN     BINARY_INTEGER := 1,
   parallelism            IN     BINARY_INTEGER := 0,
   heap_size              IN     BINARY_INTEGER := 0,
   atomic_refresh         IN     BOOLEAN        := true);


MVIEW_NAME--> Name of Materialized View
C--->Type of Refresh, Complete(C) or Fast(F)
ManishLeadAuthor Commented:
Thanks. Will check.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.