Refreshing Materialized View In Oracle SQL Developer?

Apr 6, 2010

I have a database schema with a Materialized View (MV) that updates a products table shown on a website. This schema was recently imported to an 11g database from 8i, but since this import I have been unable to refresh my schema's Materialized View.

The MV_PRODUCT_MASTER Materialized View attaches price data to product data that is stored in a normal WEB_PRODUCT table, and create an MV table as a result. The output MV table is what the website pulls data from to display to the site users. Since it is an MV table, this table cannot be edited directly. In order to change, say, a product description, I need to alter the description field in WEB_PRODUCT and manually refresh the MV_PRODUCT_MASTER table. Only through the refresh will the upstream edits appear in the MV_PRODUCT_MASTER table and be visible on the website.

In my old 7.6.0.11 copy of TOAD, I could manually refresh these MVs easily, by opening the "Snapshots" tab, right clicking on the MV I wanted to refresh and selecting the "Refresh" option. Since the schema was imported to 11g, I have been using the Oracle SQLDeveloper tool to manage the schema. SQLDeveloper doesn't have a clear method for manually refreshing an MV, or else the method I am using isn't working.

If I right click on the MV_PRODUCT_MASTER Materialized View object, and choose "Other Actions", I see the following choices:

Shrink Materialized View
Compile Materialized View
Force Materialized View Refresh
Rebuild Materialized View

I assumed that -Force Materialized View Refresh- was the right choice, and chose that. This option displays the SQL:

alter materialized view "WEBADMIN"."MV_PRODUCT_MASTER" consider fresh

When I apply this, I get the message: Materialized view - MV_PRODUCT_MASTER - has been set torefreshed. However, no changes appear in the MV output table. i.e. if I make a specific change to a row in the WEB_PRODUCT table, the change is not being carried into the MV_PRODUCT_MASTER table, so that indicated that the refresh is not actually happening. The MV table appears to believe it is being refreshed:

REWRITE_CAPABILITY GENERAL
REFRESH_MODE DEMAND
REFRESH_METHOD COMPLETE
BUILD_MODE IMMEDIATE
FAST_REFRESHABLE NO
LAST_REFRESH_TYPE COMPLETE
LAST_REFRESH_DATE 06-APR-10
STALENESS UNKNOWN

But it isn't showing any changes.What am I doing wrong? Is there a plain SQL statement I can run in order to run these refreshes, instead of using the SQLDeveloper GUI?

View 4 Replies


ADVERTISEMENT

Replication :: Materialized View Not Refreshing Automatically

Jan 25, 2011

I am confused to see one materialized view is not refreshing automatically, whereas the same thing I can do manually.

View 2 Replies View Related

SQL & PL/SQL :: Error While Refreshing A Writable Materialized View?

May 3, 2010

Am getting an error while trying to refresh a Writeable Materialized view using the following statement -

exec dbms_mview.refresh('schema_name.MV_name','C')

Error:-
ORA-02448: constraint does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2254
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2460
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2429
ORA-06512: at line 1

The Primary Key Constraint on the base table/MV is deferrable, the base table and the MV are in different schemas and the user trying to refresh the MV has an explicit grant on "ALTER ANY MATERILIZED VIEW" and "SELECT ANY TABLE" through a role.

Its refreshing successfully when I make the PK constraint (Base Table, MV) NOT DEFERRABLE (or) when I explicitly grant "SELECT ANY TABLE" to the user trying to refresh the MV.

View 5 Replies View Related

SQL & PL/SQL :: Creating And Refreshing Materialized View Group From Another Schema?

Nov 27, 2012

I have a list of materialized views in schema A. I want to create a refresh group and then refresh it from Schema B (Dynamically-run time based on some criteria). What Grants are necessary on schema B in order for it to be able to create and refresh the groups on Materialized views in Schema A.

I know that one of the Options is to, GRANT ALTER ANY MATERIALIZED VIEW as a SYS user. But I do not have any SYS privileges.

View 3 Replies View Related

Replication :: Materialized View Is Not Refreshing Data Automatically

Feb 14, 2012

I have created a MV on Oracle 10gR2 using dblink. Source database is AS400 DB2.MV script:

CREATE MATERIALIZED VIEW MV_BU
TABLESPACE TB_XXX
PCTUSED 0
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
[code]...

Above query should be refreshing the data every minute but I realized that its not doing it.

View 1 Replies View Related

Replication :: Pausing And Resuming Of Refreshing Materialized Views

Oct 15, 2011

We have some materialized views in our environment which refreshes after every 1 hour. In the same environment, we have some big processes and we do not want the performance of these big processes to get affected because of refreshing these materialized views.

if there is a way to pause the refreshing of materialized views before running the big processes and later after the big processes are completed, then resume the refreshing of the materialized views?

One way I can think of is to drop the materialized views and create the materialized views back.

View 1 Replies View Related

SQL & PL/SQL :: ORA-01410 - Invalid Rowid While Selecting / Refreshing Materialized Views

Dec 17, 2012

I have a Multi layer Mviews and Views which i use to load a table. There are three base level Mview which is accessed by 4 views ... which are in turn accessed by a view which is used to load a table.

Before the insert called for the table .. the base mviews are refreshed.

I get the "ORA-01410 Invalid Rowid" error while inserting in to the table and while refreshing the mviews. They don't occur every time and not together as well.

The Mviews contains table joins and the top level views which accessing these mviews does aggregation. Below is the mview query for one of the mview.

SELECT DISTINCT c.fiscal_time_id,
a.product_group_id,
a.allocation_driver_id,
a.hyp_entity_id,
d.business_division_alt_id
[code].....

The Refresh method for the mview is Force.

View 3 Replies View Related

SQL & PL/SQL :: Oracle Materialized View

Jul 5, 2011

I have created a Materialized View (MV) and within the MV DDL have included a statement as per below. However, the MV does not seem to be refreshing on a daily basis. I can see the job in dba_jobs table. So the question, is there some system setting i need to execute or create in order for Oracle to know that it needs to run the Job defined in the dba_jobs table on a daily Basis?

View 8 Replies View Related

Replication :: Oracle 10g - Create Materialized View

Jun 16, 2008

We are using Oracle 10g rel 2. The replication is setup on 1 server which is in City A, and the snapshot server is in City B.

City A .
Create materialized view log on table-a
with primary key
including new values.

City B database.
Create user test_rep identified by test
grant connect, resource, create any materialized view , table, view , procedure to test_rep.

Create materialized view city-A_db_MV
refresh fast
select * from cityA.Tablea@city-Adb

When i select from city-A_db_MV, it showed the complete table-A of city-A database.

Now if we make any changes to City-A table at the Master site, will it be propagated automatically to the MV site.

I guess we need to create jobs to push / or refresh fast .. isnt it. But exactly how to do it is a question.

Secondly if we make a replication group at Master site at city-A db, how do we refresh that Group and how to monitor whether it is refreshing on time or not? do we need to see the jobs every now and then.

but still a lot of questions unanswered, even though i had read the documents earlier.

1-The MView was created without identifying that after what interval it will be fast refreshed.
2- How to Manually refresh it. Does it support On Commit, I think it is not.
3- Where should be we make a group and then add the table to that group and refresh that group.

Should this group belongs to the Master Site or to MV site?

View 1 Replies View Related

SQL & PL/SQL :: Oracle Materialized View Does Not Refresh In Package

Sep 10, 2013

My materialized view has to get refreshed as part of a scheduled package. When I refresh the materialized view manually using the following statement,

DBMS_MVIEW.REFRESH('info.sales_fact_load_mv', 'C');

it is working fine. However, when I use the same statement in the package which is scheduled to run every morning, it is not working. What could be the reason?

View 6 Replies View Related

Replication :: Creation Of Materialized View From Oracle 10g - 8i

Apr 5, 2012

We have the task to create to Materialized view from oracle 10g to 8i. - Will we face any kind of issue after creation of Materialized view. check what the prerequisite need to be verified is.

View 7 Replies View Related

Replication :: Oracle Materialized View / Deletion Of Records

Nov 13, 2009

One question reg Materialized views.

If as part of housekeeping of the Source database we delete some records (older records), will the materialized view also be updated with the deletion? I believe the answer is yes. In that case can we ensure that this delete does not happen?

Is there anyway we can prevent MView refresh from deleting the records that is once inserted even if we delete the same records in source DB?

View 3 Replies View Related

Heterogeneous Connectivity :: Oracle Gateway Plus Materialized View?

Sep 4, 2012

we have microsoft sql server, oracle gateway server (11G) and database server (10.2.0.5) we already make the full setup, and it's working.

we create materialized view into oracle server to read a data from sql server, but the refresh of MV take long time so we are planing to create the materialized view into oracle gateway server.

create MV into oracle gateway server?i mean i don't want to download oracle database instance for only one MV.

View 5 Replies View Related

Replication :: Oracle Materialized View - High Redo Generation

Nov 15, 2007

I have created 5 materialize view with REFRESH FORCE option.

REFRESH is done with every 10 min.
My destination database is MySQL.
DBlink is created in ORACLE 10g
Materialize view is created using DBLINK.

Since refresh materialize view done with every 15 min, my Redo generate gone on toss.System is generating 1 redo file for 1 min. The size for redo log is 500MB.Since materialize views are created base on mysql table, system is doing complete refresh every time which causing to generate more and more redo.

Is there any setting/option/or solution to reduce high redo generation.

View 2 Replies View Related

Server Administration :: How To Change Existing Materialized View To Normal View

Jan 17, 2013

can we change the existing materialized view to normal view? if yes how?

View 2 Replies View Related

Creating Materialized View On Remote Simple View

Dec 11, 2012

I'm trying to create a Materialized View on a remote database from a simple view. The reason is, the data owners don't want to grant explicit tables privileges to external subscribers.

A new schema is created to publish data in the form of a view. I've created mlogs on the master tables, and granted them to the subscriber, but it's still complaining about a missing primary key on the view. A primary key does exist in the master table.

Is there another work around for this situation without having to work inside the data sources' environment?

View 5 Replies View Related

SQL & PL/SQL :: Materialized View - Table Or View Does Not Exist

May 2, 2012

I have a materialized view "pro_mview",I am trying to refresh the MVIEW by using the following statement.

EXEC DBMS_MVIEW.REFRESH('pro_mview','C');

But I am getting the below error.

*
Error at line 1:
ORA-12008: error in materialized view refresh path
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2256
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2462
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2431
ORA-06512: at line 1

I am able to fetch the data from that materialized view(pro_mview).

View 3 Replies View Related

SQL & PL/SQL :: Difference Between View And Materialized View

Apr 26, 2011

difference between view and materialized view?

View 1 Replies View Related

SQL & PL/SQL :: Difference Between View And Materialized View?

Aug 12, 2013

what would be the difference between a view and a materialized view? whether DML possible on a view? i think error occurs if DML tried on a view which is a combination of two or more tables, whether DML possible on a materialized view?

View 7 Replies View Related

SQL & PL/SQL :: Creating A View In Developer SUM

Oct 26, 2011

I am having trouble with creating a view based on the following: -

Total hours flown EVER, for each crew of the FBN001 on 20th October 2011.

Here is what i got so far (only works for each members flown on a particular flight, NOT on their whole hours flown in a period of a lifetime) : -

SELECT e.Employee_Number, e.FirstName, e.LastName,
SUM( ( (s.ESTIMATED_ARRIVAL) - (s.ESTIMATED_DEPARTURE) )*24)AS
TOTAL_HOURS_FLOWN
FROM SCHEDULE s, CREW_ASSIGNMENT ca, EMPLOYEE e
WHERE
s.Flight_Number = ca.Flight_Number
AND
s.Serial_Number = ca.Serial_Number
[code]...

View 20 Replies View Related

SQL & PL/SQL :: Materialized View

Jul 7, 2010

I have requirement to create materialized views. The design states to use Complete refresh. Now I am using WITH ROW_ID clause.

1. Question - what are the criteria to decide between WITH PRIMARY KEY & WITH ROW_ID clauses? I referred oracle doc, but couldn't exactly get this.

2. Background - The oracle doc mentions that - Primary key materialized views are the default type of materialized view. The master table must contain an enabled primary key constraint, and the defining query of the materialized view must specify all of the primary key columns directly.

Question - I saw some existing materialized views in my project using WITH PRIMARY KEY clause, but all of the primary key columns are not part of the Select query, but still these views are working fine, how is this possible?

3. Background - The oracle doc mentions that - Rowid materialized views must be based on a single table and cannot contain any of the following:

■Distinct or aggregate functions
■GROUP BY or CONNECT BY clauses
■Subqueries
■Joins
■Set operations

Question - But I have created a Rowid materialized view selecting data from more than one table & defining query involving outer joins. This materialized view got created & getting refreshed (complete refresh). But again this is contradicting with Oracle' statement.

View 1 Replies View Related

Creating Materialized View Log

Feb 7, 2013

There are 2 databases, database A and database B. Database A is Oracle 11.2.0.2 which runs on linux and Database B is Oracle 11.2.0.2 which runs on windows xp machine. In database A, there are 100's of tables which are being updated every 10 minutes or 15 minutes. For reporting purpose, the developer wants to run report for the tables. But since database A is being updated every now and then, generating reports takes almost 15 to 20 minutes. So the reports can be generated in Database B. Once in a day the database B should have the updated data from database A so that the reports can be generated in database B with less time. What could be the best solution for the database B to have the updated data on daily basis from database A in oracle?

View 3 Replies View Related

STALE Materialized View?

Jul 14, 2011

i have created FAST refresh materialized view.it is eligible for FAST refresh because when i executed SELECT * FROM USER_MVIEWS i could see FAST_REFRESHABLE=DIRLOAD_DML and STALENESS=STALE and it is not getting refreshed(through DBA_JOBS). Why it is in STALE status and how to resolve it. and one of my materialized views is in NEEDS_COMPILE status

View 3 Replies View Related

Materialized View Refresh?

Sep 10, 2010

A scheduler job is there to refresh some materialized views. All the views are run under single job name. Some mviews are not refreshing and those are not refreshing in the next run too.if we run those mviews manually then they are working fine from then . after some days those views which i told before are not refreshing and this happens frequently and i check the job_run_details views also and i am not seeing any errors in that.

View 6 Replies View Related

SQL & PL/SQL :: Materialized View Redefinition

Dec 11, 2008

I need redefine a Materialized View (add some columns). I try it with:

drop materialized view TCPIP preserve table;

ALTER TABLE TCPIP ADD (SUM_IP_OUT_OF_SEQ NUMBER)
/
ALTER TABLE TCPIP ADD (SUM_IP_OUT_OF_SEQ NUMBER)
/

and than create a new MV:

CREATE MATERIALIZED VIEW TCPIP
ON PREBUILT TABLE USING NO INDEX NEVER REFRESH ENABLE QUERY REWRITE as
SELECT ...

But with Oracle error: ORA-12060: shape of prebuilt table does not match definition query

I check the new MV definition, it is contain the 2 added columns.

View 6 Replies View Related

SQL & PL/SQL :: Indexes On Materialized View

Mar 16, 2011

Why we can create indexes only on materialized view and not on normal views?

View 8 Replies View Related

SQL & PL/SQL :: Syntax Of Materialized View?

Sep 9, 2010

Can u explain the syntax of materialized view??????

View 1 Replies View Related

SQL & PL/SQL :: How Much Space Is Used By The Materialized View

Oct 20, 2010

How can we find how much space is used by the materialized view.

View 1 Replies View Related

Analyzing Materialized View

Oct 26, 2012

I have created materialized view which hold few million records.Should i have to analyze the view and compute the statistics after i create the materialized view?

Also, just in case i need further indexing, should i have to take the statistics for the table again?

View 4 Replies View Related

PL/SQL :: Materialized View Creation?

Jun 15, 2013

I am running into an issue and trying to ascertain issue.  Scenario:I have 2 MV creation scripts. The MV is supposed to get populated by connection from schema to another schema USING DB Links.Basically, SAME HOST, SAME RAC DATABASE, just separate schemas.  The MV creations are just hanging. I see NO alert log mentions. I ran  a SQL trace and yes,

I see:  call count       cpu elapsed       disk query    current        rows------- ------  -------- ---------- ---------- ---------- ----------  ----------Parse 0      0.00 0.00 0          0 0           0Execute   1011 1.40 73.80 0 0 0           0Fetch 1010      1.08 317.57 0 0 0        1010------- ------  -------- ---------- ---------- ---------- ----------  ----------total 2021      2.49 391.38 0 0 0        1010 Misses in library cache during parse: 0Optimizer mode: ALL_ROWSParsing user id: 109     (recursive depth: 2) Elapsed times include waiting on following events:  Event waited on Times Max. Wait  Total Waited  ---------------------------------------- Waited  ----------  ------------  SQL*Net message to dblink 2022 0.00          0.00  SQL*Net message from dblink 2021 0.46        242.58    

Understandable, but when I do a selective query, the results come back pretty much within 5 seconds.DB version is 11.2.0.3.   Is there a BUG that I should know about?

 Here is a snippet:  

CREATE MATERIALIZED VIEW "SCHEMA"."MV_NAME_MV" USING INDEX REFRESH COMPLETE ON DEMAND AS (SELECT distinct mapguide_persons(pl.location_code) "FULL_NAME_COSTCENTER",mapguide_jobemp(pl.location_code) "TRUNCNAME_JOB",mapguide_empnum(pl.location_code) "FULLNAME_EMPNUMBER_PHONE",mapguide_english(pl.location_code)

[code]....

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved