Terminator missing in materialized view diff script
Is this a known issue? I'm on Version 4.1.0.18:
When a difference in a materialized view is found, the generated script does not include a semicolon between the CREATE MATERIALIZED VIEW and the COMMENT ON statements. Is has to be manually added to the script.
The export DDL works fine.
Thank you for the reply.
So, once the materialized view is refreshed, the previous data will be cleared, right? I wanted to store old data and add new data at the same time, but it seems to be impossible.
In our environment, table Log1 and Log2 are used alternately. So, once 14 days data are stored in Log1, new log data will be written into Log2 table and after another 14 days, the new log data will be written in Log1 Table. So, Maximum 28 days data can be stored.
Similar Messages
-
Oracle Materialized view with xmltype data type
this the table having in db1 i need to create materialized view db2 for this table i have followed below steps..
create table WORKSHEETMASTER
METHODID NUMBER(10),
WORKSHEETCODE VARCHAR2(50 BYTE) not null,
WORKSHEET SYS.XMLTYPE);
create materialized view log on db1.WORKSHEETMASTER;
db2
CREATE MATERIALIZED VIEW WORKSHEETMASTER
REFRESH FAST ON DEMAND
AS
SELECT METHODID,
WORKSHEETCODE,
worksheet FROM db1.WORKSHEETMASTER@DBLINK;
when i was create materialized view above script in db2 iam getting error
ORA-22992:cannot use LOB locators selected from remote tables
like this when remove the worksheet column created succesfully may know how achieve this problem
my database version 11g iam searched some sceniour not full filled
need for help
thanksthis the table having with in DB1
create table WORKSHEETMASTER
METHODID NUMBER(10),
WORKSHEETCODE VARCHAR2(50 BYTE) not null,
WORKSHEET SYS.XMLTYPE,
WORKSHEETID NUMBER primary key,
CREATEDDATE DATE,
CREATEDBY VARCHAR2(50 BYTE),
WORKSHEETNAME VARCHAR2(50 BYTE),
UPDATEDDATE DATE,
UPDATEDBY VARCHAR2(50 BYTE),
NOOFROWS NUMBER(3),
NOOFCOLUMNS NUMBER(3),
WORKSHEETTYPE CHAR(1 BYTE),
SUBSTRATEUSED VARCHAR2(50 BYTE),
STATUS NUMBER(1),
APPROVEDBY VARCHAR2(50 BYTE),
APPROVED CHAR(1 BYTE) default 'N',
APPROVALREMARKS VARCHAR2(100 BYTE),
LNG_WORKSHEETNAME VARCHAR2(50)
iam trying to create materailzed view in db2
create materialized view WORKSHEETMASTER
refresh fast on demand
as
SELECT METHODID,
WORKSHEETCODE,
WORKSHEETID,
worksheet,
CREATEDDATE,
CREATEDBY,
WORKSHEETNAME,
UPDATEDDATE,
UPDATEDBY,
NOOFROWS,
NOOFCOLUMNS ,
WORKSHEETTYPE,
SUBSTRATEUSED,
STATUS,
APPROVEDBY,
APPROVED,
APPROVALREMARKS,
LNG_WORKSHEETNAME FROM db1.WORKSHEETMASTER@DBLINK; --remote database
iam creating above scriprt in db2 getting error this my total script -
Triggers on Materialized View Fast Refresh
Hello all!
I have a Materialized View defined as below:
CREATE MATERIALIZED VIEW mxsvativi
BUILD IMMEDIATE
REFRESH FAST ON COMMIT
WITH PRIMARY KEY
AS
SELECT codativ, TRIM (ramo) AS ramo, percdesc FROM tbativi;And, on this MV, I have a trigger declared as:
CREATE OR REPLACE TRIGGER TK_SYNC_FV_MXSATIVI
BEFORE DELETE OR INSERT OR UPDATE
OF CODATIV
,RAMO
,PERCDESC
ON MXSVATIVI
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
voper NUMBER; --Operation
BEGIN
IF INSERTING
THEN
voper := 0;
ELSIF UPDATING
THEN
voper := 1;
ELSIF DELETING
THEN
voper := 2;
END IF;
--Save voper to a tblOperLog
END;This trigger should save some data on a table called tblOperLog, based on the operation that is being performed on the MV (Insert, Delete or Update).
I´ve tested this on Oracle 10G and also on Oracle 11G (11.1). On these, when we perform a Update on the parent table (on this eg, TBATIVI) the trigger TK_SYNC_FV_MXSATIVI records an Update Operation on the table tblOperLog. But, on a Oracle 11G 11.2.0.2.0 is logging a Delete and a Insert for each update that is done.
Does anybody know how could I force the proccess that updates the MV to emits an update instead of a delete/insert?
Thanks a lot!Are you doing an incremental refresh of the materialized view? Or are you doing a full refresh?
Is the materialized view in 11.2 fast refreshable? Perhaps you're missing a materialized view log or missing some data from the materialized view log.
In general, I'd be wary of trying to use a trigger on a materialized view to log changes to a table since there are no guarantees that the materialized view is always going to be incrementally refreshed nor that the refresh is always going to happen in exactly the same way.
Justin -
ORA-00905: missing keyword error while creating a materialized view
Hi Gurus,
I am trying to create a materialized view as :
1 CREATE MATERIALIZED VIEW AMREG.ClientData
2 TABLESPACE AMREG_DATA
3 COMPRESS
4 PARALLEL
5 NOLOGGING
6 BUILD IMMEDIATE
7 REFRESH COMPLETE
8 ON DEMAND
9 DISABLE QUERY REWRITE
10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
11 AS
12 SELECT
13 CHILD.CLIENT_SGK "Child SGK",
14 CHILD.CLIENT_NAME "Child Name",
15 CHILD.ARC_ACCT_CD "Child ARC Acct Code",
16 ULTIMATE.CLIENT_SGK "Ultimate Parent SGK",
17 ULTIMATE.CLIENT_NAME "Ultimate Parent Name",
18 ULTIMATE.ARC_ACCT_CD "Ultimate ARC Acct Code",
19 HIER.LVL_FROM_ANCESTOR ,
20 FROM [email protected] CHILD,
21 [email protected] HIER,
22 [email protected] ULTIMATE
23 WHERE HIER.DESCENDANT_CLIENT_SGK = CHILD.CLIENT_SGK
24* AND ULTIMATE.CLIENT_SGK = HIER.ANCESTOR_CLIENT_SGK;
SQL> /
REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
ERROR at line 10:
ORA-00905: missing keyword
DBLink name is : DNYCPH60.WORLD
Please guide me on this and help to resolve the issue.Ummm how about not posting the same question 4 times in 3 different forums?
Gints Plivna
http://www.gplivna.eu -
Material Group field is Missing in Material Master - Purchasing view ?
Hai Experts,
I want to configure to bring back Material Group field is Missing in Material Master - Purchasing view. It is mandatory to Create & save a master. I cant save a master in sandbox. Need Help..I make all field as Optional & Create master successfully.. Thanks.. I even verfied in J1ID Master for assesable value & Chapter ID Combination.. But in Cenvat Determination Field, How i can set Default Indicator for Modvat "tick" & how can i set Excise Intimation Date also.
I checked Material Master in mm03 [ Display].
I clicked More & Pre Vals. option in Foreign Trade Import.
For More, It shows this error.
Record 21 MORE does not exist in table T133E
Message no. M3748
For Pre vals., It shows this error.
Record 21 J1PR does not exist in table T133E
Message no. M3748
Kindly guide me..
Thanks & Regards
Swetha -
Diff materialized view and view
what is diff materialized view and view
Check these documents please
[Overview of Materialized Views|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#CNCPT411]
[Overview of Views|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#i20690]
Kamran Agayev A. (10g OCP)
http://kamranagayev.wordpress.com -
Error: ORA-00905:Missing keyword while creating Materialized view
Hi Gurus,
I am trying to create a materialized view as :
1 CREATE MATERIALIZED VIEW AMREG.ClientData
2 TABLESPACE AMREG_DATA
3 COMPRESS
4 PARALLEL
5 NOLOGGING
6 BUILD IMMEDIATE
7 REFRESH COMPLETE
8 ON DEMAND
9 DISABLE QUERY REWRITE
10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
11 AS
12 SELECT
13 CHILD.CLIENT_SGK "Child SGK",
14 CHILD.CLIENT_NAME "Child Name",
15 CHILD.ARC_ACCT_CD "Child ARC Acct Code",
16 ULTIMATE.CLIENT_SGK "Ultimate Parent SGK",
17 ULTIMATE.CLIENT_NAME "Ultimate Parent Name",
18 ULTIMATE.ARC_ACCT_CD "Ultimate ARC Acct Code",
19 HIER.LVL_FROM_ANCESTOR ,
20 FROM [email protected] CHILD,
21 [email protected] HIER,
22 [email protected] ULTIMATE
23 WHERE HIER.DESCENDANT_CLIENT_SGK = CHILD.CLIENT_SGK
24* AND ULTIMATE.CLIENT_SGK = HIER.ANCESTOR_CLIENT_SGK;
SQL> /
REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
ERROR at line 10:
ORA-00905: missing keyword
DBLink name is : DNYCPH60.WORLD
Please guide me on this and help to resolve the issue.I provided the answer over at the duplicate post ...
ORA-00905: missing keyword error while creating a materialised view
Please, please, please ... please do not duplicate posts. Pick one. If you don't get an answer in a reasonable time - close it (edit the title) and THEN open in a different forum. -
Storing missing data in Materialized View
There is 1 View which contains all the web activities on each day and I am extracting summary data as follows.
1. Date
2. User Access counts on the date
But the base table of this view consists of 2 table, log1 and log2, and each
table is switched each 14 days. So, this view can reference the data until
maximum 28 days.
In this environment, I am planning to store the summary data which is made
before 28 days, using Materialized View. But can Materialized View store the
data which is gone in the base table or View? I want to refresh only recent data
and keep past data as it is in the Materialized View.Thank you for the reply.
So, once the materialized view is refreshed, the previous data will be cleared, right? I wanted to store old data and add new data at the same time, but it seems to be impossible.
In our environment, table Log1 and Log2 are used alternately. So, once 14 days data are stored in Log1, new log data will be written into Log2 table and after another 14 days, the new log data will be written in Log1 Table. So, Maximum 28 days data can be stored. -
A bug when refreshing a materialized view?
I am getting "ORA-00603: ORACLE server session terminated by fatal error" upon refresh of a materialized view. I've put together a test case to demonstrate the problem. Is it a bug?
SQL*Plus: Release 10.1.0.3.0 - Production on Fri Jul 29 13:43:45 2005
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
[email protected]> create table t (
2 id int primary key,
3 t_name varchar2(10),
4 t_date date
5 );
Table created.
[email protected]> create materialized view log on t
2 with rowid (t_name, id, t_date) including new values;
Materialized view log created.
[email protected]> create materialized view t_mv
2 build immediate
3 refresh fast
4 on commit
5 as
6 select t_name, max(id) id, max(t_date) t_date, count(*)
7 from t
8 GROUP BY t_name;
Materialized view created.
[email protected]> create materialized view log on t_mv
2 with rowid (id) including new values;
Materialized view log created.
[email protected]> create table v (
2 id int primary key,
3 t_id int references t(id) on delete cascade,
4 v_name varchar2(10)
5 );
Table created.
[email protected]> create materialized view log on v
2 with rowid (v_name, t_id) including new values;
Materialized view log created.
[email protected]> create materialized view v_mv
2 build immediate
3 refresh fast
4 on commit
5 as
6 select v.rowid rowid1, t_mv.rowid rowid2, v.v_name, v.t_id
7 from v, t_mv
8 where v.t_id = t_mv.id;
Materialized view created.
[email protected]> alter table v_mv
2 add constraint v_mv_uk1 unique
3 (
4 v_name
5 )
6 enable
7 ;
Table altered.
[email protected]> insert into t (id, t_name, t_date) values (1, 'A', sysdate);
1 row created.
[email protected]> insert into t (id, t_name, t_date) values (2, 'B', sysdate);
1 row created.
[email protected]> insert into t (id, t_name, t_date) values (3, 'A', sysdate);
1 row created.
[email protected]> insert into t (id, t_name, t_date) values (4, 'A', sysdate);
1 row created.
[email protected]> insert into t (id, t_name, t_date) values (5, 'B', sysdate);
1 row created.
[email protected]> insert into v (id, t_id, v_name) values (1, 1, 'V_A_1');
1 row created.
[email protected]> insert into v (id, t_id, v_name) values (2, 2, 'V_B_1');
1 row created.
[email protected]> insert into v (id, t_id, v_name) values (3, 3, 'V_A_2');
1 row created.
[email protected]> insert into v (id, t_id, v_name) values (4, 4, 'V_A_3');
1 row created.
[email protected]> insert into v (id, t_id, v_name) values (5, 5, 'V_B_2');
1 row created.
[email protected]> commit;
Commit complete.
[email protected]> insert into t (id, t_name, t_date) values (6, 'A', sysdate);
1 row created.
[email protected]> insert into v (id, t_id, v_name) values (6, 6, 'V_B_2');
1 row created.
[email protected]> commit;
commit
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (FESA.V_MV_UK1) violated
[email protected]> -- ORA-12008 is fine here: that's what was expected
[email protected]> delete from t where id = 5;
1 row deleted.
[email protected]> commit;
ERROR:
ORA-03114: not connected to ORACLE
commit
ERROR at line 1:
ORA-00603: ORACLE server session terminated by fatal errorWhy ORA-00603?
Best regards,
MaciejIt may be a bug, or it may be a result of the dependencies between the materialized views. I don't have a 9.2.0.6 instance that I'm willing to trash to test this, but this is what I get on 9.2.0.1.
If it is a bug they at least changed the behaviour of the bug in 9.2.0.6.
I ran your script up to the first commit then did:
SQL> SELECT * FROM t;
ID T_NAME T_DATE
1 A 29-JUL-05
2 B 29-JUL-05
3 A 29-JUL-05
4 A 29-JUL-05
5 B 29-JUL-05
SQL> SELECT * FROM t_mv;
T_NAME ID T_DATE COUNT(*)
A 4 29-JUL-05 3
B 5 29-JUL-05 2
SQL> SELECT * FROM v;
ID T_ID V_NAME
1 1 V_A_1
2 2 V_B_1
3 3 V_A_2
4 4 V_A_3
5 5 V_B_2
SQL> SELECT * FROM v_mv;
no rows selectedHUH?? But:
SQL> SELECT v.rowid rowid1, t_mv.rowid rowid2, v.v_name, v.t_id
2 FROM v, t_mv
3 WHERE v.t_id = t_mv.id;
ROWID1 ROWID2 V_NAME T_ID
AAAH4QAAIAAAAl1AAD AAAH4MAAIAAAAlFAAA V_A_3 4
AAAH4QAAIAAAAl1AAE AAAH4MAAIAAAAlFAAB V_B_2 5So, I tried:
SQL> EXEC DBMS_MVIEW.REFRESH('V_MV');
PL/SQL procedure successfully completed.
SQL> SELECT * FROM v_mv;
no rows selectedNow, this is confusing, so:
SQL> EXEC DBMS_MVIEW.REFRESH('V_MV', 'COMPLETE');
PL/SQL procedure successfully completed.
SQL> SELECT * FROM v_mv;
ROWID1 ROWID2 V_NAME T_ID
AAAH4dAAIAAAAl1AAD AAAH4ZAAIAAAAlFAAA V_A_3 4
AAAH4dAAIAAAAl1AAE AAAH4ZAAIAAAAlFAAB V_B_2 5So at least I've got something in the MV. Now, to continue your test:
SQL> insert into t (id, t_name, t_date) values (6, 'A', sysdate);
1 row created.
SQL> insert into v (id, t_id, v_name) values (6, 6, 'V_B_2');
1 row created.
SQL> COMMIT;
Commit complete.I also expected the error but no joy, and look at this:
SQL> SELECT * FROM v_mv;
ROWID1 ROWID2 V_NAME T_ID
AAAH4dAAIAAAAl1AAE AAAH4ZAAIAAAAlFAAB V_B_2 5Forcing the refresh on v_mv gets:
SQL> EXEC DBMS_MVIEW.REFRESH('V_MV', 'COMPLETE');
BEGIN DBMS_MVIEW.REFRESH('V_MV', 'COMPLETE'); END;
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (OPS$ORACLE.V_MV_UK1) violatedVery strange! It gets better:
SQL> DELETE FROM t WHERE id = 5;
1 row deleted.
SQL> commit;
Commit complete.
SQL> EXEC DBMS_MVIEW.REFRESH('V_MV', 'COMPLETE');
PL/SQL procedure successfully completed.
SQL> select * from v_mv;
ROWID1 ROWID2 V_NAME T_ID
AAAH4dAAIAAAAl1AAF AAAH4ZAAIAAAAlFAAA V_B_2 6 But:
SQL> SELECT * FROM t_mv;
T_NAME ID T_DATE COUNT(*)
A 6 29-JUL-05 4
B 5 29-JUL-05 2
SQL> SELECT * FROM t;
ID T_NAME T_DATE
1 A 29-JUL-05
2 B 29-JUL-05
3 A 29-JUL-05
4 A 29-JUL-05
6 A 29-JUL-05Obvioulsy, something is not fast refreshing. So lets force it:
SQL> EXEC DBMS_MVIEW.Refresh('T_MV', 'COMPLETE');
PL/SQL procedure successfully completed.
SQL> SELECT * FROM t_mv;
T_NAME ID T_DATE COUNT(*)
A 6 29-JUL-05 4
B 2 29-JUL-05 1
SQL> SELECT * FROM v_mv;
ROWID1 ROWID2 V_NAME T_ID
AAAH4dAAIAAAAl1AAB AAAH4qAAIAAAAlEAAB V_B_1 2
AAAH4dAAIAAAAl1AAF AAAH4qAAIAAAAlEAAA V_B_2 6Which looks right to me.
Then, I blew everything away and did it allagain up to an including the inserts into t, then I inserted into v and commited. Now, both MV's were correct, so I did:
SQL> insert into t (id, t_name, t_date) values (6, 'A', sysdate);
1 row created.
SQL> insert into v (id, t_id, v_name) values (6, 6, 'V_B_2');
1 row created.
SQL> commit;
Commit complete.
SQL> SELECT * FROM t_mv;
T_NAME ID T_DATE COUNT(*)
A 6 29-JUL-05 4
B 5 29-JUL-05 2Still strange, so blow it all away again insert into t commit, insert into v commit, then:
SQL> insert into t (id, t_name, t_date) values (6, 'A', sysdate);
1 row created.
SQL> commit;
Commit complete.
SQL> insert into v (id, t_id, v_name) values (6, 6, 'V_B_2');
1 row created.
SQL> commit;
commit
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (OPS$ORACLE.V_MV_UK1) violatedAt least now it sees the error at commit time for v so lets try the delete:
SQL> delete from t where id = 5;
1 row deleted.
SQL> commit;
Commit complete.
SQL> SELECT * FROM t_mv;
T_NAME ID T_DATE COUNT(*)
A 6 29-JUL-05 4
B 5 29-JUL-05 2
SQL> SELECT * FROM t;
ID T_NAME T_DATE
1 A 29-JUL-05
2 B 29-JUL-05
3 A 29-JUL-05
4 A 29-JUL-05
6 A 29-JUL-05Still not actually refreshing somehow.
I may play with this some more, it seems truly strange to me.
John -
Nested Materialized View in 8.1.7
Hi, I am attempting to create a nested materialized view as per metalink doc id 212533 and I am hitting ORA-12015: cannot create a fast refresh snapshot from a complex query.
Please see my test script below:
Any help would be greatly appreciated
Thanks,
Brad
** Filename: test_mv.SQL
** Author: Brad Scrivens
** Creation: January 2006
** Purpose:Test example of nested materialized view
** CHANGE History
** List environment details
DATABASE_NAME
FVOL1
1 row selected.
Elapsed: 00:00:00.03
USER
OPUS_CORE
1 row selected.
Elapsed: 00:00:00.02
RUNDATE
07-FEB-2006 16:16:56
1 row selected.
Elapsed: 00:00:00.03
1* SELECT * FROM v$version
BANNER
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0 Production
TNS for VMS: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
5 rows selected.
Elapsed: 00:00:00.04
1* ALTER SESSION ENABLE PARALLEL DML
Session altered.
Elapsed: 00:00:00.01
1* ALTER SESSION SET SORT_AREA_SIZE = 209715200
Session altered.
Elapsed: 00:00:00.01
1* DROP TABLE emp
DROP TABLE emp
ERROR at line 1:
ORA-00942: table or view does not exist
1* DROP TABLE dept
DROP TABLE dept
ERROR at line 1:
ORA-00942: table or view does not exist
1 CREATE TABLE emp
2 (EMPNO NUMBER(4) NOT NULL
3 , ENAME VARCHAR2(10)
4 , JOB VARCHAR2(9)
5 , MGR NUMBER(4)
6 , HIREDATE DATE
7 , SAL NUMBER(7,2)
8 , COMM NUMBER(7,2)
9* , DEPTNO NUMBER(2))
Table created.
1 alter table emp
2 add constraint emp_pk
3 primary key (EMPNO)
4* novalidate
Table altered.
1 CREATE TABLE dept(
2 DEPTNO NUMBER(2) NOT NULL
3 , DNAME VARCHAR2(14)
4 , LOC VARCHAR2(13)
5* )
Table created.
1 alter table dept
2 add constraint dept_pk
3 primary key (DEPTNO)
4* novalidate
Table altered.
1* create materialized view log on emp with primary key,rowid
Materialized view log created.
1* create materialized view log on dept with primary key,rowid
Materialized view log created.
1 create materialized view empmv1
2 refresh fast on demand
3 with primary key
4 as select e.empno,d.deptno,e.ename,d.dname, e.rowid erowid,d.rowid drowid
5 from emp e, dept d
6* where e.deptno=d.deptno
from emp e, dept d
ERROR at line 5:
ORA-12015: cannot create a fast refresh snapshot from a complex query
1* alter table empmv1 add primary key(empno)
alter table empmv1 add primary key(empno)
ERROR at line 1:
ORA-00942: table or view does not exist
1 create materialized view log on empmv1 with primary key,rowid(deptno)
2* including new values
create materialized view log on empmv1 with primary key,rowid(deptno)
ERROR at line 1:
ORA-00942: table or view does not exist
1 create materialized view empmv2
2 refresh fast on demand
3 with primary key
4 as select empno,deptno , count(*)
5 from empmv1
6* group by empno,deptno
from empmv1
ERROR at line 5:
ORA-00942: table or view does not exist
END OF @test_mv.SQL
*****************************************************************************************I have managed to execute my test script successfully in a different schema in the same database I was working with. Am I missing a grant?
I have been working as the schema owner in each of these schemas.
thanks,
Brad -
Sample SQL Query for Creating View
CREATE MATERIALIZED VIEW TRIAL2
PARALLEL 4
BUILD IMMEDIATE
REFRESH COMPLETE
ENABLE QUERY REWRITE
AS */
select maa.INVENTORY_ITEM_ID,maa.ORGANIZATION_ID,maa.SR_INSTANCE_ID from msc_atp_rules ma,
msc_atp_assignments maa
where maa.assignment_type = 3
AND maa.ATP_RULE_ID = ma.RULE_ID
UNION ALL
select maa.INVENTORY_ITEM_ID,maa.ORGANIZATION_ID,maa.SR_INSTANCE_ID from msc_atp_rules ma,
msc_atp_assignments maa
where maa.assignment_type =3
AND maa.ATP_RULE_ID = ma.RULE_ID
Test Syntax
The SQL syntax is valid, however the query is invalid or uses functionality that is not supported.
Declarative query support does not currently include UNION, INTERSECT or MINUS
As a workaround, I created this view in the database and imported it onto jdev. This process worked totally fine. However, the Test Syntax still gives the same error, which means no modifications can be made on Jdev.
Is my conclusion right, or am I missing some procedures that might get the UNIONs working?
Thanks
RajivHi John,
Thanks.
How shall we create xdf then for such MV? Instead of xdf can we have sql script shipped.... or is there any other way of shipping such materialized view... In R12 and 11i (after 11.5.10) we used to ship corresponding xdf but in before 11.5.10 we used to ship sql scripts. -
Materialized Views from 9i to 10g
Hi All
I have read that Materialized views in oracle 9i or 10g does not differ alot and that in 10g the query_rewrite is compulsory... With this in mind I have done an import of full database from oracle 9i 9.2.0.1 to a database in 10g, 10.2.0.3. the import as such did not throw any messages..
however, when I tried to re-import data schema wise from user1 in 9i to user1 in 10g, all the materialised views are failing to import data.. with ora-01732 error message.. where an update/insert is not allowed on views.. however, I expected tht once the import is complete, I could quickly recompile the views .. and restore the data. But when I try doing it.. .these tables in 10.2.0.3 database do not show up as snapshot tables which they are in source 9i..
I tried to avoid importing these in my next attempt.. but no luck.. I am at the moment unsure if i am missing any thing on the target database which is 10g? Please advice.
SaratIt is the same user who is doing both import as well as export... I create a full schema dmp file from the exp utility in 9i.. which is later imported as the same user into the schema in 10g for the data refresh..
my exp and imp commands are as below..
exp u1/u1 file=D:\Database\u01.dmp buffer=200000 compress=Y grants=y log=D:\Database\u01-emp.log STATISTICS=NONE
imp file=e:\u01.dmp buffer=1073741824 statistics=none ignore=y resumable=y
when prompted, supply u01 login credentials..
the target machine has more cpu and ram and so the difference in buffer values..
on source oracle is 9.2.0.1 and on target it is 10.2.0.3. I did not set any value for query rewrite or any additional parameter in the target.. as I read it is by default true.
please advice.
sarat -
Materialized view issue ORA-12052
Hi All,
I'm currently trying to create a MV using Fast refresh method.
and I'm getting the following error:
ORA-12052:
cannot fast refresh materialized view string.string
Cause: Either ROWIDs of certain tables were missing in the definition or the inner table of an outer join did not have UNIQUE constraints on join columns.
Action: Specify the FORCE or COMPLETE option. If this error is got during creation, the materialized view definition may have be changed. Refer to the documentation on materialized views.
I'm trying to create the Unique constraints required. Could anybody help me with this?. Which are the "inner tables of an outer join"?
I have also created the MVs logs with rowid, but also nothing happend.
I' ve created a Unique constraint that includes all the fields of the ourter joins. Nothing happend either.
Thi is the MV script:
'CREATE MATERIALIZED VIEW MVIEW1
USING INDEX
REFRESH ON DEMAND FAST
WITH rowid
DISABLE QUERY REWRITE AS
SELECT fp.FINAL_AMOUNTFIXED,
fp.FINAL_FPRATE,
fp.updated_rate,
fp.gsd_rate,
fp.nongsd_rate,
fp.AMT_CD,
fp.AMT_CD_ADJ1,
fp.AMT_CD_ADJ2,
fp.AMT_LC,
fp.AMT_LC_ADJ1,
fp.AMT_LC_ADJ2,
fp.ASSIGNMENT_STATUS,
fp.CURRENCY,
fp.DOLLARS,
fp.FORECAST_REVENUE_STATUS,
fp.GUID,
NVL(fp.HOURS,0) HOURS,
fp.ID,
fp.JOB_LEVEL,
fp.PJR_AMT_CD,
fp.PJR_HOURS_VALUE,
fp.PJR_LC,
fp.PJR_RATE,
fp.PJR_RATE_VALUE,
fp.PROJECT_COST_CENTER,
fp.PROJECT_COST_CENTERTXT,
NVL(cust.project_manager,fp.project_manager) project_manager,
NVL(cust.project_name,fp.project_name) project_name,
fp.PROJECT_NUMBER,
fp.PROJECT_ORGANIZATION,
NVL(cust.project_status,fp.project_status) project_status,
NVL(cust.project_type,fp.project_type) project_type,
NVL(fp.RATE,0) Rate,
fp.RATE_ADJ1,
fp.RATE_ADJ2,
fp.RATE_LEVEL,
fp.REPORT_DATE_ID,
fp.REPORT_DESCRIPTION,
fp.RESOURCE_COST_CENTER,
fp.RESOURCE_COST_CENTERTXT,
fp.RESOURCE_COUNTRY,
fp.RESOURCE_NAME,
fp.RESOURCE_ORGANIZATION,
fp.RESOURCE_TYPE,
fp.REVENUECOST_TYPE,
fp.ROLE_END_DATE,
fp.ROLE_NAME,
fp.ROLE_START_DATE,
fp.TAB,
fp.TASK_NUMBER,
fp.TPRATE_TP,
fp.WAR,
fp.WE_DATE_ID,
fp.WEEK,
fp.WORK_TYPE,
fp.PJR_FF_DIFF_MONTH,
fp.PJR_FF_DIFF_QTR,
NVL(fp.PJR_WOW,0) WOW,
fp.PJR_WOW_HRS,
fp.REMOVED_BY_ADJUSTMENT,
fp.PICK_FOR_WRITEBACK,
fp.DRAFT_REV_NUM,
fp.DRAFT_INV_NUM,
NVL(pca.country,fp.PROJECT_COUNTRY) Country,
NVL(cust.customer_id,NVL(fp.CUSTOMER_NUMBER,'TBD')) Customer_ID,
NVL(cust.CUSTOMER_NAME,NVL(fp.CUSTOMER_NAME,'TBD')) Customer_Name ,
fp.ITEM_DATE,
fp.REVENUE_CC,
fp.EXPLANATION,
fp.REPORT,
fp.REPORT_ADJUSTMENT,
fp.REPORT_ADJ1,
fp.REPORT_ADJ2,
fp.JE_DESCRIPTION,
pca.REGION_HQ_TIERLAST_CODE,
pca.MANAGER_FIELD_TIERLAST_CODE,
pca.SPECIALTY_HQ_TIERLAST_CODE,
pca.SECTOR_HQ_TIERLAST_CODE,
rca.REGION_HQ_TIERLAST_CODE,
rca.MANAGER_FIELD_TIERLAST_CODE,
rca.SPECIALTY_HQ_TIERLAST_CODE,
rca.SECTOR_HQ_TIERLAST_CODE,
pca.VERTICALS_SUB_LOB,
pca.MISC_GROUP ,
rca.VERTICALS_SUB_LOB,
rca.MISC_GROUP ,
fp.gl_date,
fp.pjr_wow_rate ,
fp.created_by,
fp.created_on,
NVL(fp.TOTAL_FUNDING,0) TOTAL_FUNDING,
NVL(fp.INCEPTION_TO_BURN,0) INCEPTION_TO_BURN,
NVL(fp.AVAILABLE_FUNDING,0) AVAILABLE_FUNDING,
NVL(fp.FORECAST_AMT,0) FORECAST_AMT,
cust.pop_date,
fp.COMMENTS_WOW_PROJ,
fp.COMMENTS_PAPER_CONFIRM,
rep.LOOKUP_CODE,
rep.NAC_SORTING1,
fp.ACTION_TO_CLOSE,
NVL(fp.NEGATIVE_BACKLOG,0) NEGATIVE_BACKLOG,
fp.SALES_REP,
fp.FORECAST_DATE,
pca.NAC_RES_TYPE_3,
rca.NAC_RES_TYPE_3
FROM FACT_PJR fp,
COSTCENTER_ATTRIBUTES pca ,
COSTCENTER_ATTRIBUTES rca,
wb_customer_lookups cust,
XXAPX_LOOKUPS rep
WHERE fp.revenue_cc = pca.LEAF_CC(+)
AND fp.RESOURCE_COST_CENTER = rca.LEAF_CC(+)
AND fp.project_number = cust.project_number(+)
AND fp.REPORT_ADJ2 = rep.VALUE(+)
AND rep.LOOKUP_TYPE = 'NAC_WB_PHASE2';'
Edited by: 859267 on May 3, 2012 11:51 AMPlease edit your post and surround the code with code tags. See 'Are there any useful formatting options not shown on the sidebar?' in the FAQ.
Also provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION). -
"Invalid Metadata Objects" when creating materialized views
Hi experts,
I have run into some trouble. I had an analytic workspace that grew too fast (see 11.2.0.2 AW size grows steadily with every cube build so I deleted it and created a new one.
It seemed to build fine using the tip that David Greenfield gave us in the mentioned forum post, but when I try to enable materialized views (which I had enabled in the previous workspace) I'm gettig the following error:
Your metadata changes have been saved, with the following errors
Invalid Metadata Objects:
Invalid Object "TABLESPACE.LECTURAS": "CREATE MATERIALIZED VIEW "TABLESPACE"."CB$LECTURAS"
ORGANIZATION CUBE ON TABLESPACE.TABLESPACE_AW(
FACT "LECTURAS_STORED"("LECTURAS_MEASURE_DIM" 'LECTURA') IS "LECTURA",
DIMENSION "TIEMPO" IS "TIEMPO" USING "TIEMPO_TIEMPO_HOUR_ID_UNIQUE_KEY" ,
DIMENSION "GEOGRAFIA" IS "GEOGRAFIA" USING "GEOGRAFIA_GEOGRAFIA_CONTADOR_ID_UNIQUE_KEY" )
BUILD DEFERRED
REFRESH ON DEMAND
FORCE
USING TRUSTED CONSTRAINTS
AS
SELECT
TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') "TIEMPO",
T1."COD_METERID" "GEOGRAFIA",
SUM(T1."VAL_AI_HOR") "LECTURA"
FROM
TABLESPACE."LECTURA_HORARIA_FINAL" T1
GROUP BY
(TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') , T1."COD_METERID")
ORA-00942: table or view does not exist
Running this same script in SQLDeveloper yields the same error at line 17, which is the FROM clause. BUT I can run the SELECT statement by itself and returns the expected result. So the table exists in the correct tablespace.
I must be missing something big...
Thanks in advance.
Joan
P.S.: In the code above I'm using "TABLESPACE" in substitution for the real username and tablespace name (which is the same) for privacy reasons.When you ran the select statement, were you connected as the same user that you used to try to enable the MVs?
Can you create a standard (non cube) MV with the same select statement? (Connected as the same user you used in AWM.)
"CREATE MATERIALIZED VIEW "TABLESPACE"."MV_TEST"
BUILD DEFERRED
REFRESH ON DEMAND
FORCE
USING TRUSTED CONSTRAINTS
AS
SELECT
TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') "TIEMPO",
T1."COD_METERID" "GEOGRAFIA",
SUM(T1."VAL_AI_HOR") "LECTURA"
FROM
TABLESPACE."LECTURA_HORARIA_FINAL" T1
GROUP BY
(TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') , T1."COD_METERID")
{code} -
Materialized view creation issue
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 0
Execute 1011 1.40 73.80 0 0 0 0
Fetch 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: 0
Optimizer mode: ALL_ROWS
Parsing 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) "ENGLISH_NAME_COSTCENTER",
pl.function_type_lookup_code "FUNCTION_TYPE_LOOKUP_CODE",
pl.location_code "LOCATION_CODE",
pl.org_id "ORG_ID"
FROM [email protected] pl
WHERE pl.function_type_lookup_code not in ('VALUE','CONSULT')
and sysdate between pl.active_start_date and active_end_date);
*Network netstat –in output **
netstat -in
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 58751025 0 0 0 27335255 0 0 0 BMRU
eth0:1 1500 0 - no statistics available - BMRU
eth0:2 1500 0 - no statistics available - BMRU
eth1 1500 0 5569305513 0 0 0 4365204661 0 0 0 BMRU
eth2 1500 0 146061981 0 0 0 270589939 0 0 0 BMRU
eth2:1 1500 0 - no statistics available - BMRU
lo 16436 0 31731571 0 0 0 31731571 0 0 0 LRU
The above just hangs and spins its wheels…
Any ideas are appreciated…
thanksJCGO wrote:
The above just hangs and spins its wheels…
And what happens when you issue just the underlying select:
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) "ENGLISH_NAME_COSTCENTER",
pl.function_type_lookup_code "FUNCTION_TYPE_LOOKUP_CODE",
pl.location_code "LOCATION_CODE",
pl.org_id "ORG_ID"
FROM [email protected] pl
WHERE pl.function_type_lookup_code not in ('VALUE','CONSULT')
and sysdate between pl.active_start_date and active_end_date
SY.
Maybe you are looking for
-
How to run a jar file in a HTML page.
Hi, i have created an applet that works with 2 or 3 classes, the i have done a Jar file and now i want to run the applet though a Html page, i have looked at many manuals and i have done the same as is said to create the Html file, but whe i want to
-
Slate 21 Pro - Obtains IP address but no Internet connectivity
Hi all, I have a Slate 21 Pro with no internet connectivity at home. The device obtains an IP address via DHCP on either wired or wireless networks, but when attempting to browse or access internet-based resources, it simply times out. I've also tri
-
How to get the next FACTORYDATE
Hello all, Can somebody show me how to get the next (FACTORYDATE) from SAP in the objective to check and validate the shipto date in the ISA b2b application. Thanks in advance.
-
I am currently using a 161 movement type to generate raw materials returns PO to vendors. Is there a way of linking the original PO to the returns PO?
-
Updated the new itunes and software versoin 4.0.1 but iphones not connectin
okay ! so itunes wanted me to update it ! so i did, after installing .. it popped up with "applemobile" thingy.. and i pressed the wrong button without reading what it was. so now i cant even connect my iphone to the comp, cos theres no connection :S