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


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

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 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

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

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

Replication :: Materialized View - Refresh Group

Jan 6, 2010

I am working on materialized view replication but i have an crucial issue. I have a refresh group which contain many MVs some are Read only and some are update but all are in Fast refresh mode (logs are created on both replication and MV sites on these objects) and are referentially integrated to each other i.e they have parent child relationship with each other as at replication site on base tables.

When refresh group job runs to refresh these MVs i got the errors

ORA-02292: integrity constraint (string.string) violated - child record found

After that job status has changed to break,but in the same time all the pending transactions at the MVs sites are pushed to Replication site i e ( Base tables at replication site and MVs of these tables are synchronized).In order to change the status of job to Normal, i have to disable some constraints(not all) on the MVs and manually run the job .After that job status will become Normal even i enable these constraints with validation.

What will be the reason ? Are there some MVs trying to complete refresh instead of Fast or increment refresh in this refresh group?If yes how i can trace out MVs and solve this problem?

Some other information ,
Replication site running with 10gR2 Enterprise Edition.
Materialized View site running with 10gR2 Slandered Edition.

View 1 Replies View Related

SQL & PL/SQL :: Creating Materialized View For Getting Hierarchy?

Oct 3, 2013

I want to create a materialized view for the with same logic as below view

CREATE OR REPLACE FORCE VIEW GFL_MCP_CORE.VW_CLIENT_HIERARCHY
(KEY_INDENTED, CLIENT_LEVEL, ID, NAME, CLIENT_TYPE_CODE,
L2_CLIENT_ID, L2_CLIENT_NAME, TOP_CLIENT_ID, TOP_CLIENT_NAME, CLIENT_MCP_FLAG,
CLIENT_GROUP_NAME, ORG_REGION_NAME, COUNTRY_NAME, PROCESSOR_CLIENT_CODE)

[code]....

Here is the sample data for the client table and other tables are generic.

Row#IDNAMECOUNTRY_CODECLIENT_TYPE_CODECLIENT_GROUP_IDPARENT_CLIENT_IDSTATUS_FLAG
134801ZhuanshenguangchangCNBR10048232909A
212515229ConsolidatedFCUUSCL54812515A
314821286 Golden Mile BranchCABR53112712A
42050014513Bay CityUSBR56612009A
53864712-44-125 LeicesterGBBR56038630A
63869114736 Freestar BrickyardUSBR10020238686A
731141Walsall StoreGBL254631103A

View 1 Replies View Related

SQL & PL/SQL :: Error In Creating Materialized View

Oct 1, 2012

Am trying to create a materialized view as below

SQL> CREATE MATERIALIZED VIEW emp_view_73 BUILD IMMEDIATE REFRESH COMPLETE ON COMMIT
2 AS
3 SELECT em.employee_id,
4 em.employee_fname
5 ||' '
6 ||em.employee_lname employee_name,
[code]....

ERROR at line 12: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view

View 37 Replies View Related

Error In Creating Materialized View With DB Link?

Aug 7, 2013

we have the following requirement for creating materialized view.

In database "DB1", a table "abc" is there in "user1" schema.
In database "DB2", in "user2", we are accessing the "abc" through DB link "DBL1" to DB1:
select * from user1.abc@DBL1;
we have created a public synonym for "user1.abc@DBL1" as "sabc".

In database "DB3", we need to create the materialized view to access "abc" in DB1 through DB2. we are not allowed to access "DB1" directly from "DB3". so we create a db link as "DBL2" in "DB3" to "DB2".

when i try to create a materialized view as below:
create materialized view abc_mv
as
select * from sabc@DBL2;

But got the error as "synonym translation invalid". When i access the SQL statement separately as below
select * from sabc@DBL2, its working but in Materialized view, it shown that error. Even i tried with schema name as well like "user2.sabc@DBL2" , but that also thrown same error.

Is there any option available for this type of creating materialized view?

View 1 Replies View Related

PL/SQL :: Creating Materialized View Utilizing Tables And A Job

Dec 5, 2012

This is just for learning purposes. What if I would like to create my own materialized view utilizing only tables and a job.

View 28 Replies View Related

PL/SQL :: Creating A Refresh On Commit Materialized View?

Jul 18, 2013

I am trying to create a commit on refresh materialized view so that whenever I perform DML followed by commit on Master table it should get quickly reflect on my Materialized view. I have given SELECT on table privilege to user where this view will be created On Master:

GRANT SELECT ON HR.EMPLOYEES TO SCOTT. From Scott:CREATE MATERIALIZED VIEW  scott.hremp  REFRESH FAST ON COMMITAS SELECT * FROM HR.EMPLOYEES; ERROR at line 4:ORA-01031: insufficient privileges Then I Grant all on EMPLOYEES table to SCOTT. GRANT ALL ON hr.EMPLOYEES TO SCOTT; Then got following error while creating materilized view:SQL> CREATE MATERIALIZED VIEW  scott.hremp  2 REFRESH FAST ON COMMIT  3  AS  4  SELECT * FROM HR.EMPLOYEES;SELECT * FROM HR.EMPLOYEES  *ERROR at line 4:ORA-23413: table "HR"."EMPLOYEES" does not have a materialized view log I create materialized view log on Master:SQL> CREATE MATERIALIZED VIEW LOG on HR.EMPLOYEES;Materialized view log created.

Even after this I am not able to create materialized view and now getting Table not Exist error:

SQL> CREATE MATERIALIZED VIEW  scott.hremp 2 REFRESH FAST ON COMMIT  3  AS  4  SELECT * FROM HR.EMPLOYEES;SELECT * FROM HR.EMPLOYEES *ERROR at line 4:ORA-12018: following error encountered during code generation for "SCOTT"."HREMP"ORA-00942: table or view does not exist. Also I want to know why I needed to GRANT ALL to HR for creating this materialized View.

View 6 Replies View Related

Error In Creating Update Table Materialized View

Aug 28, 2013

we are trying to create a materialized view (MV) which would access the remote database through db link. Now we need to do update on the local MV so that it should be reflected on the master table.

There is no primary key on this table and we are using "complete refresh" option. since we dont have control over remote database, we are not allowed to create MV log over there.

in this scenario, if i try to create updatetable MV with complete refresh, we are getting below error:

SQL Error: ORA-12013: updatable materialized views must be simple enough to do fast refresh

how to create such MV on this scenario?

our environment is:

Oracle 11.2.0.3

View 1 Replies View Related

REFRESH GROUP Is Automatically Created When A Materialized View Is Created?

Aug 17, 2012

tell me if a REFRESH GROUP is automatically created when a materialized view is created?

View 3 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 :: Refreshing Schema From One Database To Another

Jul 10, 2012

I am often tasked with refreshing schema's from one DB to another.The first thing I need to check is the space the objects take up in the source DB. SQL statement that prints the size of the following objects

('SEQUENCE','SYNONYM','TABLE','INDEX','PACKAGE','PACKAGE BODY','DATABASE LINK','VIEW','PROCEDURE')

which is totaled by owner, TS.. Or the SQL can just take in an owner. I am looking for an output similiar to this:

TS name, owner, object_name, object_type MB SIZE
users xxx t1 table 100
users xxx t2 table 200

sum of tables 300
[code]....

View 3 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

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

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 :: Create Primary Key On View And Use This View For Creating Foreign Key?

Oct 8, 2010

is it possible to create primary key on view and use this view for creating foreign key .

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

Replication :: Materialized Views Refresh In Snapshot-group?

Mar 24, 2010

How to refresh the dependent materialized views in a snapshot group. It refreshes in the order we add the materialized views to snapshot group?

Here below is the scenario.

MATVW_A
CREATE MATERIALIZED VIEW MATVW_A BUILD IMMEDIATE
REFRESH FAST ON COMMIT
AS SELECT * FROM EMP;

MATVW_B
CREATE MATERIALIZED VIEW MATVW_B BUILD IMMEDIATE
REFRESH FAST ON COMMIT
AS SELECT * FROM MATVW_A;

MATVW_C
CREATE MATERIALIZED VIEW MATVW_C BUILD IMMEDIATE
REFRESH FAST ON COMMIT
AS SELECT * FROM MATVW_B;

I created a snapshotgroup SNGRP with all the above materialized views.

DBMS_REFRESH.MAKE(name => 'SNGRP',
tab => 'MATVW_A,MATVW_B,MATVW_C',
next_date => TRUNC(sysdate) + 1,
interval => 'SYSDATE + 1');

The order of refreshing the materialized views would be like first materialized view MATVW_A should get refresh then after MATVW_B,MATVW_C.

As they are dependent views.Is there anyway where we can mention the order of refreshing materialized views in snapshot group.

View 2 Replies View Related

Replication :: Setup A Refresh Group For Nested Materialized Views

Mar 25, 2009

Suppose I have materialized view A,B,C. Now I have a new materialized view D which is created from A,B,C. Can I put D into same refresh group?

I am not sure whether D will be refreshed first before A,B,C, resulting that D do not get any update If that is the case, the result will be wrong

If we cannot use refresh group to update nested materialized view, what should we do?

View 13 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 A Null Schema?

Mar 20, 2013

We have a vendor-supplied 11g database where records are split between two schemas -- an ACTIVE schema and an ARCHIVE schema. Each object has both a corresponding object in both of the ACTIVE and ARCHIVE schemas.

The vendor also has a third schema where each object is merely a UNION ALL of the associated ACTIVE and ARCHIVE schema objects. For the sake of example, I'll call that schema COMBO.Over the years, we've created queries and reports that reference both the COMBO and ARCHIVE schemas and that has worked just fine.

The vendor has now set up a secondary database for us that we can use when the primary database is offline for patching/upgrades/etc. The trouble is, this secondary database only has the ACTIVE schema and records. The vendor will not be writing any ARCHIVE records to it.

Primary DB: ACTIVE, ARCHIVE, and COMBO schemas
Secondary DB: only the ACTIVE schema.

is there a way to set up the missing ARCHIVE and COMBO schemas on the secondary DB such that we won't have to rewrite our SQL to accomodate the lack of an ARCHIVE schema when we move reports over to the backup database?

Of course, no records would need to be returned from the virtual ARCHIVE schema, but I'd love for the untouched SQL to run without error.

View 7 Replies View Related

Reports & Discoverer :: Creating Data Link Using A Column Only Selected In One Group

Dec 14, 2010

I have a report with 2 groups Gheader and Glines.The report looks at PO headers and lines. I want to create a data link from the the 2 queries based on the line id in po_lines_all.However I only want to select this in the lines query so I do not get repeating records at the header query.

View 11 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







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