Job for refreshing materialized view will be failed by manually is ok
Hello to all
I have created a read only materialized view and i have created a
stored procedure tha calls DBMS_MVIEW.REFRESH for refreshing the
materialized view by this script
CREATE MATERIALIZED VIEW "REZA"."T1_MV2"
REFRESH FAST WITH PRIMARY KEY
AS SELECT "T1"."ID" "ID","T1"."NAME" "NAME" FROM "REZA"."T1"@TEHRAN.COM "T1";
create or replace procedure refresh_mv
as
begin
DBMS_MVIEW.REFRESH (list=>'reza.t1_mv2',push_deferred_rpc=>false,method=>'f');
end;
and i have created a job for calling refresh_mv frequently by this script
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'MV_JOB',
job_type => 'STORED_PROCEDURE',
job_action => 'reza.refresh_mv',
start_date => SYSTIMESTAMP,
repeat_interval => 'FREQ=SECONDLY;INTERVAL=90',
end_date => null
when i run this job by DBMS_SCHEDULER.RUN_JOB all thing is right and the materialized view will be update
and STATUS filed in ALL_SCHEDULER_JOB_LOG is SUCCEEDED for that execution
and it's completion duration is very short (+000000000 00:00:00.141000)
but when the job execute in its time (my mean is every 90 second) that will be failed and materialized view don't update
and STATUS filed in ALL_SCHEDULER_JOB_LOG is FAILED for this job
do you know what is wrong?
thanks
thank all of you i myself found the problem that was because of DATABASE LINK i used fixed user database link
and then the problem refined
Similar Messages
-
Error for Refresh Materialized View
Hi, All
I get a error when I refresh the Materialized View, But I can't solve this error.
ORA-12008: error in materialized view refresh path
ORA-04045: errors during recompilation/revalidation of MV_NAME
ORA-00600: internal error code, arguments: [qsmqSetupTableMetadata-2], [], [], [], [], [], [], []
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2255
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2461
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2430
ORA-06512: at line 1
Do you know how I can solve this problem?
Please let me know that.
JWShi,
can u give some info... like whether the MVs are and from where you are trying to refresh...... we also had similiar prob when we tried to refresh the MV in Schema A from Schema B
rgds
Mahesh -
Alternative for OUTER Join for use in fast refresh materialized view
Hi ,
I have two tables as :
CREATE TABLE TEST_SANDY1
COL1 NUMBER
CREATE TABLE TEST_SANDY2
COL1 NUMBER,
COL2 VARCHAR2(10 BYTE)
Data for the tables are :
INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
1);
INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
2);
INSERT INTO TEST_SANDY1 ( COL1 ) VALUES (
3);
COMMIT;
INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
1, 'a');
INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
2, 'b');
INSERT INTO TEST_SANDY2 ( COL1, COL2 ) VALUES (
4, 'd');
COMMIT;
Now when I run the following select statement :
select
b.col1
from
test_sandy1 a,
test_sandy2 b
where
b.COL1 = a.COL1(+)
I get :
COL1
1
2
4
I want to build a materialized view to generate the same values but it has to be fast refresh. But since I am using outer join I am unable to create a fast refresh one.
Can someone suggest an alternate select to create fast refresh materialized view.
Thanks,
SandipanThe select statement was not fitting my problem , so I'll change it as :
select
a.col1, nvl(b.col2, 'DEFAULT')
from
test_sandy1 a,
test_sandy2 b
where
b.COL1(+) = a.COL1
I get :
COL1 VAL
1 a
2 b
3 DEFAULT
How do I this ? -
Unable to refresh Materialized view group when an Mview is added
Hi,
I have 8 MVs present in my DB and added them to a MV refresh group. But I am getting the error below when I try to refresh the group.
SQL> exec DBMS_REFRESH.refresh('MVRFRSHGRP_EAIGHD');
begin DBMS_REFRESH.refresh('MVRFRSHGRP_EAIGHD'); end;
ORA-12048: error encountered while refreshing materialized view "MYUAT"."MV_EAI_PJRM_EMP_ALLOC_DTLS"
ORA-12018: following error encountered during code generation for "MYUAT"."MV_EAI_PJRM_EMP_ALLOC_DTLS"
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2563
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2776
ORA-06512: at "SYS.DBMS_IREFRESH", line 685
ORA-06512: at "SYS.DBMS_REFRESH", line 195
ORA-06512: at line 1
SQL> Actually the view MV_EAI_PJRM_EMP_ALLOC_DTLS exists and MVlog$ are present at source site.
When I remove this view from the group, I am able to refresh it successfully.
I destroyed the group, recreated and added all the views and tried. But no luck.
Can some one suggest what could be the problem?
Regards
DeepHi,
You didn't leave a version (Again), so I can only guess.
You may be suffering from
Bug 10096159 ORA-12048 error message raised by DBMS_REFRESH.REFRESH is not corrrect
Meaning it could be a different MV that fails to refresh.
Regards
Peter
Edit:
Versions confirmed as being affected (There could be others, mind)
11.2.0.1
11.1.0.7
10.2.0.5
10.2.0.3
Edited by: Peter on Sep 4, 2012 8:45 AM -
ORA-12015: cannot create a fast refresh materialized view from a complex qu
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - ProductionI'm trying to create a fast refresh materialized view that uses a column of xmltype. The problem is I cannot create an MV log that accounts for the xmltype column. I tried excluding it and got the above error. Is there another way I can incrementally update a materialized view where I don't have to do a COMPLETE refresh or use FAST refresh?
CREATE TABLE "DAS_DESC"."AUTHORITY_TEST"
"NAID" NUMBER(20,0) NOT NULL ENABLE,
"AUTH_TYPE" VARCHAR2(40 BYTE),
"XML_DATA" "SYS"."XMLTYPE" ,
"TERM_NAME" VARCHAR2(4000 BYTE)
CREATE TABLE "DAS_DESC"."AUTH_ASSC_TEST"
"NAID" NUMBER(20,0),
"P_NAID" NUMBER(20,0),
"REL_TYPE" VARCHAR2(25 BYTE),
"XML_DATA" "SYS"."XMLTYPE"
CREATE
MATERIALIZED VIEW person_mv
AS
SELECT p.naid
, p.auth_type
, INSERTCHILDXML
p.xml_data -- Parent XML Column
, '//*[contains(local-name(), ''person'')]' --XPATH to Person
, 'nonPreferredHeadingArray' -- Value for new child element
( -- Sub query for injecting new variant person array
SELECT XMLELEMENT
"nonPreferredHeadingArray"
, XMLAGG -- Aggregator for Variant Persons Array
XMLELEMENT
"variantPersonName" -- Wrapper for each entry in array
, extract(a.xml_data,'*/*')
FROM auth_assc_table -- Link table
WHERE a.p_naid = p.naid
) AS XML_DATA
FROM authority p -- Parent table
WHERE p.auth_type = 'Person';The views are created fine and they work perfectly for what we need. The problem is the refresh when we edit the base tables. Ideally, it should take a couple seconds. Right now, it takes a couple minutes. XMLTYPE is one problem and the Complex Query exception is the other. If there is a work-around for fast refresh, please let me know. Greatly appreciated.jjmdb wrote:
I'm trying to create a fast refresh materialized view that uses a column of xmltype. The problem is I cannot create an MV log that accounts for the xmltype column. I tried excluding it and got the above error. Is there another way I can incrementally update a materialized view where I don't have to do a COMPLETE refresh or use FAST refresh? Besides XMLTYPE column, your MV definition has a subquery which prevents it from being fast refreshable.
I could not find any specific reference in documentation about restriction on XMLTYPE (or CLOB) columns but it seems logical that oracle will not be able to keep track of changes to binary data. What does DBMS_MVIEW.EXPLAIN_MVIEW generate for your MV definition? That should tell you which all conditions (for FAST REFRESH) your MV violates. Since you can not create a MV LOG to include XMLTYPE column, it will not be possible to create a FAST REFRESHABLE MV that includes the XMLTYPE column.
I am afraid there is not much you can do here unless you are prepared to change the way data is stored in your base tables. If you can store data in base tables using standard data types instead of binary/XML storage, you might be able to create a FAST REFRESHABLE MV. -
Refresh materialized view on fast refresh
Hi,
I want to create a fast refresh on a materialized view but i kept getting ORA-12015: cannot create a fast refresh materialized view from a complex query. When I did a complete refresh on the materialzed view, it completed. I have create a materialized view log for the table. In my materialized view script, I have included a user defined function. Does db version 10g have the capability to do a fast refresh?
ThanksWhat is the query you are using for the MV?
The error message says it all... "cannot create a fast refresh materialized view from a complex query"
If your query is complex then you will have to perform complete refreshes.
One way around can be to fast refresh all tables in the query then create a view on them based on the 'complex' query. Admittedly this is only a workaround in certain scenarios.
Check out the documentation...
http://68.142.116.70/docs/cd/B19306_01/server.102/b14226/repmview.htm#sthref422 -
Hi
Im trying out to use some MV so im very new in this. My question is, now have a Select statement with object, so I cant use refresh on commit right?
When I use refresh on demand, how or when does my MV refreshes ?
Hope someone have a Hint or maybe a link where I can read about this.When I use refresh on demand, how or when does my MV
refreshes ?http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6002.htm#SQLRF01302
ON DEMAND Clause
Specify ON DEMAND to indicate that the materialized view will be refreshed on demand by calling one of the three DBMS_MVIEW refresh procedures. If you omit both ON COMMIT and ON DEMAND, ON DEMAND is the default.
See Also:
PL/SQL Packages and Types Reference for information on these procedures -
Reg:package code to refresh materialized views
i am new to pl/sql packages and procedures.i want it to execute for running mappings in informatica which takes 0 and gives 1 when executed successfully
create or replace PACKAGE BODY pkg_refresh_mv as
procedure prc_mv (p_mv_name varchar2) is
begin
dbms_mview.refresh (p_mv_name);
end prc_mv;
procedure refresh_all_mv (proc_response IN OUT number) is
begin
dbms_mview.refresh('materialized view','C');
dbms_mview.refresh('materialized view','C');
proc_response := 1;
exception
when others then
proc_response := 0;
end refresh_all_mv ;
end pkg_refresh_mv;
when i execute this code i get the following errors
PLS-00201: identifier 'PKG_REFRESH_MV' must be declared
PLS-00304: cannot compile body of 'PKG_REFRESH_MV' without its specification
what needs to be changed
thankstry this one :
CREATE OR REPLACE PACKAGE pkg_refresh_mv
AS
PROCEDURE prc_mv (p_mv_name VARCHAR2);
PROCEDURE refresh_all_mv (proc_response IN OUT NUMBER);
END pkg_refresh_mv;
CREATE OR REPLACE PACKAGE BODY pkg_refresh_mv
AS
PROCEDURE prc_mv (p_mv_name VARCHAR2)
IS
BEGIN
dbms_mview.refresh (p_mv_name);
END prc_mv;
PROCEDURE refresh_all_mv (proc_response IN OUT NUMBER)
IS
BEGIN
dbms_mview.refresh ('materialized view', 'C');
dbms_mview.refresh ('materialized view', 'C');
proc_response := 1;
EXCEPTION
WHEN OTHERS
THEN
proc_response := 0;
END refresh_all_mv;
END pkg_refresh_mv;
/ -
How to Refresh materialized view
Hi,
I am using 11G owb. I would like to know if any one can help me know if there is any easy to Refresh materialized view . I will be using this materialized view to source data from my maps. this map will be part of a process flow. i would like to refresh the materialized view before every run of the map in process flow.
Thanks,
Ash.
Edited by: user591315 on Aug 6, 2009 1:26 PMA couple of approaches;
* refresh the MV from a procedure in a pre map process operator (its an operator in a mapping), or
* call the procedure from a process flow activity before the map
Cheers
David -
Refresh Materialized View in a package
Refresh Materialized View in a process.
I have a USER2.Materialized view and when I want to refresh it I execute:
execute dbms_mview.refresh('MV_FACT_SALES','C');
But I have the ETL process in a USER1.package
The User1 needs any Materialized View Grant or any privilegie?
How can I refresh the Materialized View in a procedure in the USER1.package?I 'm sorry, but I want to create a procedure under USER2 and when I execute the script to create it I receive the error:
ORA-06550: line 4, column 12:
PLS-00103: Encountered the symbol "DBMS_MVIEW" when expecting one of the following:
:= . ( @ % ; immediate
The symbol ":=" was substituted for "DBMS_MVIEW" to continue.
Te script procedure is:
PROCEDURE REFRESH_MV IS
BEGIN
execute dbms_mview.refresh('MV_FACT_SALES','C');
END;
How can I refresh a Materialized view in a procedure?
Thanks! -
Error While Creating Fast Refresh Materialized view.
Table Scripts:
CREATE TABLE CONTRACT_MASTER
CONTRACT_SEQ NUMBER(10) NOT NULL,
PDN CHAR(5) NOT NULL,
APPID NUMBER(10) NOT NULL,
CONTRACT_LOB_DESC VARCHAR2(20) NOT NULL,
CUSTOMER_NAME VARCHAR2(57) NOT NULL,
CONTRACT_DT DATE NOT NULL,
CONTRACT_RECD_DT DATE NOT NULL,
HELD_OFFERING_DT DATE NOT NULL,
DRAFT_AMT NUMBER(15,2) NOT NULL,
STATUS_DESC VARCHAR2(20) NOT NULL,
GIF_UPLOAD_TM TIMESTAMP NOT NULL
CREATE table CONTRACT_COMMENTS
CONTRACT_COMMENTS_SEQ NUMBER(10) NOT NULL,
APPID NUMBER(10) NOT NULL,
COMMENTS VARCHAR2(1000) NOT NULL,
GIF_UPLOAD_TM TIMESTAMP NOT NULL
Constraints on tables
ALTER TABLE CONTRACT_MASTER ADD
CONSTRAINT XPKCONTRACT_MASTER PRIMARY KEY (CONTRACT_SEQ) USING INDEX ;
ALTER TABLE CONTRACT_COMMENTS ADD
CONSTRAINT XPKCONTRACT_COMMENTS PRIMARY KEY (CONTRACT_COMMENTS_SEQ) USING INDEX ;
alter table CONTRACT_MASTER add CONSTRAINT XUIAPPCONTRACT_MASTER UNIQUE (APPID) USING INDEX;
CREATE INDEX XUIAPPCONTRACT_COMMENTS ON
CONTRACT_COMMENTS(APPID) ;
Materialized View Creation:
CREATE MATERIALIZED VIEW LOG ON CONTRACT_MASTER WITH PRIMARY KEY,ROWID;
CREATE MATERIALIZED VIEW LOG ON CONTRACT_COMMENTS WITH PRIMARY KEY, ROWID;
CREATE MATERIALIZED VIEW MV_CONTRACT_COMMENTS_HELDOFFERING
REFRESH FAST
ENABLE QUERY REWRITE AS
SELECT APPID,COMMENTS FROM CONTRACT_COMMENTS WHERE APPID IN (
SELECT APPID FROM CONTRACT_MASTER WHERE STATUS_DESC = 'Held Offering' )
Errors generated:
ERROR at line 4:
ORA-12015: cannot create a fast refresh materialized view from a complex query
_*Afer That I have changed the query but still it was not created like:*_
CREATE MATERIALIZED VIEW MV_CONT_COMMNTS_HELDOFFERNG
REFRESH FAST
ENABLE QUERY REWRITE AS
SELECT CONTRACT_COMMENTS_SEQ,c.APPID,COMMENTS
FROM CONTRACT_COMMENTS c,CONTRACT_MASTER m
WHERE m.APPID = c.APPID and m.STATUS_DESC = 'Held Offering'
*even though error displayed:
SQL> CREATE MATERIALIZED VIEW MV_CONT_COMMNTS_HELDOFFERNG*
2 REFRESH FAST
3 ENABLE QUERY REWRITE AS
4 SELECT CONTRACT_COMMENTS_SEQ,c.APPID,COMMENTS
5 FROM CONTRACT_COMMENTS c,CONTRACT_MASTER m
6 WHERE m.APPID = c.APPID and m.STATUS_DESC = 'Held Offering';
FROM CONTRACT_COMMENTS c,CONTRACT_MASTER m
ERROR at line 5:
ORA-12052: cannot fast refresh materialized view GSSIO.MV_CONT_COMMNTS_HELDOFFERNG
*Again I have done "Analyzing Materialized Views for Fast Refresh" as follows:*
1: exec dbms_mview.explain_mview('MV_CONT_COMMNTS_HELDOFFERNG');
2: SELECT capability_name, possible, SUBSTR(msgtxt,1,60) AS msgtxt
FROM mv_capabilities_table
WHERE capability_name like '%FAST%';
Output is :
CAPABILITY_NAME P MSGTXT
REFRESH_FAST N
REFRESH_FAST_AFTER_INSERT N the SELECT list does not have the rowids of all the detail t
REFRESH_FAST_AFTER_ONETAB_DML N see the reason why REFRESH_FAST_AFTER_INSERT is disabled
REFRESH_FAST_AFTER_ANY_DML N see the reason why REFRESH_FAST_AFTER_ONETAB_DML is disabled
REFRESH_FAST_PCT N PCT is not possible on any of the detail tables in the mater
Please suggest what to do to implement fast refresh materialized view for same.Edited by: dba on Sep 20, 2010 12:00 AMIf the two MVs have to be consistent with each other as of a specific time, put them into a Refresh Group and refresh them with DBMS_MVIEW.REFRESH
If an MV is dependent on another, use DBMS_MVIEW.REFRESH_DEPENDENT
See the "Oracle® Database PL/SQL Packages and Types Reference" documentation pages for DBMS_MVIEW.
Hemant K Chitale
http://hemantoracledba.blogspot.com --- this is NOT a documentation site.
Edited by: Hemant K Chitale on Sep 20, 2010 5:19 PM -
Creation of fast refresh materialized view
Hi,
I am creating fast refreshable materialized view.At that time i am getting error message
ORA-12052: cannot fast refresh materialized view OPS$QDW.EMP_DEPT_MV
I created log's also on that tables(emp,dept)
Please Help me any body.
I am using oracle 8.1.7.4.0
below the scripts i created
CREATE MATERIALIZED VIEW LOG ON emp
tablesspace vijay_test
WITH ROWID
INCLUDING NEW VALUES
CREATE MATERIALIZED VIEW LOG ON DEPT
tablesspace vijay_test
WITH ROWID
INCLUDING NEW VALUES
CREATE MATERIALIZED VIEW emp_dept_mv
TABLESPACE vijay_test
BUILD IMMEDIATE
REFRESH FAST
ENABLE QUERY REWRITE
as
select e.ename,e.empno,e.deptno,d.loc from emp e, dept d
where e.deptno=d.deptnoIt will be possible to create a Materialised view with up to 20 tables, but you have to understand the restrictions on complex Materialised views with regards to fast refresh.
To help your understanding, refer to Materialized View Concepts and Architecture
<br>
Oracle Database FAQs
</br> -
ORA-12015: cannot create a fast refresh materialized view from a complex q
Hi,
I'm facing very strange problem. Please help me why this error is coming
I'm creating a simple materialized view, but it is giving below error since this is simple select * from.
CREATE MATERIALIZED VIEW EFMS.MS_TASK
BUILD IMMEDIATE
REFRESH FAST
START WITH SYSDATE
NEXT (SYSDATE + 1/24)
WITH ROWID
AS
SELECT * FROM MS_TASK@efms_link;
SELECT * FROM MS_TASK@efms_link
ERROR at line 8:
ORA-12015: cannot create a fast refresh materialized view from a complex query
CREATE MATERIALIZED VIEW LOG ON MSDBO.MS_TASK
TABLESPACE DBOR_MVLOG
PCTUSED 0
PCTFREE 60
INITRANS 20
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
NOCACHE
NOLOGGING
PARALLEL ( DEGREE 2 INSTANCES 1 )
WITH ROWID, PRIMARY KEY
EXCLUDING NEW VALUES;1º
Not is a best practice to use 'select *'
2º
ORA-12015: cannot create a fast refresh materialized view from a complex query
Cause: Neither ROWIDs and nor primary key constraints are supported for complex queries.
Action: Reissue the command with the REFRESH FORCE or REFRESH COMPLETE option or create a simple materialized view.
Then you have to change REFRESH FAST or create a primary key in MS_TASK@efms_link to avility fast refresh.
. :-) any help with my english is wellcome :-) . -
Fast Refresh Materialized view on a 'View'
Hi,
I am trying to create a materialized view with Refresh FAST option. This is based on a view. I am getting an error that there is no materialized view log on the table. But we cannot create a materialized view log on a view. Can you please let me know how to create a FAST REFRESH materialized view on a view.
Thanks!Thanks Justin! Actually, I have a remote database on which I want the copy of one of our tables. We have a view on this table on the source database with meaningful names. I have created materialized view logs on the underlying table. If I am able to create a MV on the view, then I need not write that extra step to code for meaningful names. I wanted to know if a fast refresh is possible on a view (There are materialized view logs on the underlying table)?
Thanks! -
Fast-Refresh Materialized Views
hi
How to auto Refresh Materialized Views. Mean when ever a new row inserted into a table ; It must show automatically..
Or Tells is that , Is it a good decision use Materialized Views for reporting purpose.
Thanks
ManiSmall example for you:
[email protected]> create table dept2 as select * from scott.dept;
Table created.
[email protected]> alter table dept2 add constraint dept2_pk primary key(deptno);
Table altered.
[email protected]> create materialized view log on dept2;
Materialized view log created.
[email protected]> create materialized view dept2_mv
2 refresh fast on commit as
3 select * from dept2 ;
Materialized view created.
[email protected]> select * from dept2_mv;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
[email protected]> insert into dept2 values(50,'HR','WARSAW');
1 row created.
[email protected]> commit;
Commit complete.
[email protected]> select * from dept2_mv;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 HR WARSAW
Best Regards
Krystian Zieja / mob
Maybe you are looking for
-
Solution Directory -- Create System for Solution Monitoring
Hi Experts, I created an ERP solution in SolMan but I don´t know how to create systems DEV, QAS and PRD as graphics for process monitoring. I allready configured in SMSY the systems, RFCs and logical component. Regards.
-
Hi Experts, If I have to create a FICO user, what roles (or profiles) should I attach to the user? Or, i other words, what are the standard roles (or profile) for FICO? Same questions for other modules also (SD,MM,PP..) I checked in transaction PFCG
-
I can't open a read a PDF file I copied to my curve8250 from my laptop so I emailed it to my phone as an attachment and my phone has a little question mark in the little box in my email header when it arrives and if I try to open it I get then messa
-
How can convert HTML file into xml file?
Hi, I am receving one HTML file as an input and i want to convert that receiving(html file) into .xml file.Is there any converter (tools)to do this.Pls if any give me the details with regard. Regards, mahesh.
-
Spatial 11gR2 doc references the now-obsolete OC4J
The Oracle® Spatial Developer's Guide 11g Release 2 (11.2) Part Number E11830-10 at http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_migrat.htm#CHDBCHBG it describes, in painstaking detail, how to ensure the Spatial Web Services must be conf