Materialized Views/Snapshots not displayed
SQL Devloper: 1.0.0.15.57 on Windows XP
Remote Oracle version: Oracle9i Enterprise Edition Release 9.2.0.5.0 on Solaris 2.6
Another department created a combined Snapshot of two tables for another department. Under previous software (TOAD), Snapshot was displayed in the Tables and Snapshots tabs. However, under SQL Developer, the Snapshot is not displayed under the Tables tree, nor is it displayed under the Materialized Views tree. A Public Synonym is found in SQL Developer for this object.
Message was edited by:
Michael Geier
It is my understanding that this is a bug. (See the discussion at Bug in "Other Users" and Materialized Views We have the same problems with materialized views. I am not aware of a workaround at this time. It is a major problem for us. It prevents our developers from even using this product.
Message was edited by:
Clharr
Similar Messages
-
Problem with MATERIALIZED VIEW (snapshot)
Hi,
I've any problem with creating MATERIALIZED VIEW (snapshot)
My table is ROOMS:
SQL> DESC ROOMS
Name Null? Type
LS_ID VARCHAR2(32)
BL_ID NOT NULL VARCHAR2(32) PRIMARY KEY1
FL_ID NOT NULL VARCHAR2(4) PRIMARY KEY2
RM_ID NOT NULL VARCHAR2(8) PRIMARY KEY3
SITE_ID VARCHAR2(32)
SQL> SELECT COUNT(*)
2 FROM ROOMS;
COUNT(*)
203973
SQL> SELECT COUNT (TOT)
2 FROM (SELECT COUNT(*) TOT, LS_ID, SITE_ID
3 FROM ROOMS
4 GROUP BY LS_ID, SITE_ID);
COUNT(TOT)
11673
I'd like to create one MATERIALIZED VIEW that refresh every 30 seconds when I insert, update or delete on ROOMS table.
I tried this:
CREATE MATERIALIZED VIEW ROOMS_SNAP
BUILD IMMEDIATE
REFRESH complete
START WITH to_date(sysdate,'dd/mm/yyyy hh24:mi:ss')
NEXT sysdate + 30/86400
disable QUERY REWRITE
AS
SELECT LS_ID, SITE_ID
FROM ROOMS
GROUP BY LS_ID, SITE_ID
but when I insert, update or delete one record on ROOMS table, ROOMS_SNAP not refresh.
What I wrong?
How Can I write MATERIALIZED VIEW to maintain synchronization
between ROOMS_SNAP AND LS_ID, SITE_ID by ROOMS?
ThanksTry this way:
SQL> SHOW PARAMETER JOB
NAME TYPE VALUE
job_queue_processes integer 0
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=20 SCOPE=MEMORY;
SQL> create materialized view log on emp tablespace jam_ts
2 with rowid, primary key;
Materialized view log created.
SQL> create materialized view emp_mat
2 tablespace jam_ts
3 refresh fast start with sysdate
4 next sysdate + interval '15' second as
5 select * from emp where deptno=30;
Materialized view created.
SQL> update emp
2 set ename=lower(ename)
3 where deptno=30;
6 rows updated.
SQL> commit;
Commit complete.
---"After 15 seconds it will be refreshed automatically...."
SQL> select * from emp_mat;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7499 allen SALESMAN 7698 20-FEB-81 1600 300 30
7521 ward SALESMAN 7698 22-FEB-81 1250 500 30
7654 martin SALESMAN 7698 28-SEP-81 1250 1400 30
7698 blake MANAGER 7839 01-MAY-81 2850 30
7844 turner SALESMAN 7698 08-SEP-81 1500 0 30
7900 james CLERK 7698 03-DEC-81 950 30
6 rows selected.Message was edited by:
Jameel -
Material Description is not displaying for few records in Report
Dear Experts,
Report Material Description is not displaying for few records in Bex Report but for records it is coming and even the heading of the material Description is also not coming for this report.
Cud u plz suggest a good solution for it.
Regards,
Sai Phani.Hi Phani,
For the text of the material in records, check if there is text maintained for that material in the master data. also try by changing the text to medium text and long text.
regarding header, you will have same heading for key and text, you may use Materail ID / Description as the heading if you want.
regards,
Rk. -
Materialized view is not taking the Index
Hi Friends,
I have a materialized View for my Sales Details. I created a view on the Materialized View and using in my report. The Performance is very slow. After little research,
I found that the indexes are not used when the MV is accessed in the SQL. I tried explain plan for a very simple query on the view to prove that.
Here is my simple query.
select month_num ,sum(qty) from v_mv_sales_table
where month_num=201301
by month_num;
When I checked for count() it is considering the index and performance is good.
select month_num ,count(*) from v_mv_sales_table
where month_num=201301
by month_num;
Then I tried using hint for forcing the index. That time also it is working only for count not for SUM.
select /* +INDEX(tr, IDX2_MV_SALES_TABLE) */ month_num,count(*)
v_mv_sales_table tr
month_num=201301
by month_num;
Is there any way , I can force my sql to use the index on the month_num column?.
I have a question about using hint to force the sql.
My Question is I have indexes on my Materialized View. But I am using the hint on my view based on the Mat View.
Will it be okay to use like that?.
You may ask why I am using View instead of using Mat View directly. At later stage we are planning to apply some user level restrictions to the data
by linking the view to some other tables/view. So I am forced to use the View instead of MV.
Any ideas or suggestions will be good
Thanks in advance,
Vimal....here's an example
SQL> set autot off
SQL>
SQL> create table t
2 (dt date)
3 /
Table created.
SQL>
SQL> insert into t
2 select trunc (sysdate) + rownum
3 from all_objects
4 /
25707 rows created.
SQL>
SQL>
SQL> create index tidx on t (trunc (dt))
2 /
Index created.
SQL>
SQL> begin
2 dbms_stats.gather_table_stats (user, 'T');
3 end;
4 /
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL> set autot trace expl
SQL> select *
2 from t
3 where dt = to_date ('24-07-2009', 'dd-mm-yyyy')
4 /
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6 Card=1 Bytes=8)
1 0 TABLE ACCESS (FULL) OF 'T' (Cost=6 Card=1 Bytes=8)
SQL>
SQL> select *
2 from t
3 where dt = trunc (sysdate)
4 /
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=6 Card=1 Bytes=8)
1 0 TABLE ACCESS (FULL) OF 'T' (Cost=6 Card=1 Bytes=8)
SQL>
SQL> select *
2 from t
3 where trunc (dt) = trunc (sysdate)
4 /
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=8)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'T' (Cost=2 Card=1 Bytes=
8)
2 1 INDEX (RANGE SCAN) OF 'TIDX' (NON-UNIQUE) (Cost=1 Card=1
SQL>
SQL>
SQL> drop table t
2 /
Table dropped.
SQL> -
Maintenance View - Fields not Displaying
Hi experts,
I created a Maintenance View for a table. But when i go and see in the Maintenance View Overview, the integer field-columns in the table are not displayed in the view.
can u ppl suggest me why this happens? whether maintenance view will not support integer fields ? And how to over come this problem.
with regards ,
James...
Valuable answers will be rewarded...the problem might be you used two screens while creating table maintaince.
so use one screen in table maintaince then you will get everything.
even now you will get all fields ,just double click on one column,it will give detailed,there you can see the all the fields.
Thanks
Seshu -
Materialized View - does not contain a primary key constraint
I am trying to create materialized view. I gone through the MV wizard creation. Added 2 columns (foo_column, foo_pk) of the table and have a simple select statement (Select foo_column from foo_dim). Also created a primary key contrainst and refencing the primary key (FOO_PK) of the dimension.
I am getting the following error:
ORA-12014: table 'FOO_DIM' does not contain a primary key constraintIt was solved. The table that I am querying has to have a primary key defined before creating a materialized view.
-
Materialized view does not exist upon refresh
Hi all,
I got the following stack trace upon executing 'DBMS_MVIEW.REFRESH('Layout_tab','C')' to refresh an materialized view upon an object table:
ORA-23401: materialized view "MINIMOL"."LAYOUT_TAB" does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 794
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 851
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 832
The view create statement is following:
CREATE MATERIALIZED VIEW PlateLayout_tab
OF PlateLayout
CACHE
REFRESH ON DEMAND
AS
SELECT
PlateLayout(l.id,VALUE(pos),l.ComputeCheckerboardPosition(VALUE(pos)))
FROM
Layout_tab l
, TABLE(mcu_enumerate.LoopFor(1,l.wells_across * l.wells_down)) pos;
now what is going wrong? I can't even create the view with the 'REFRESH ON COMMIT' option.
Thanks,
HenrikJohn,
it is only a typo in the posted message, but the executed SQL-smt of course was:
EXECUTE DBMS_MVIEW.REFRESH('PlateLayout_tab','C');
After browsing through metalink I even tried this:
EXECUTE DBMS_MVIEW.REFRES('PlateLayout_tab','C','',TRUE,FALSE,0,0,0,TRUE);
with the same stack trace.
By the way the MVIEW is accessible via:
SELECT * FROM PlateLayout_tab
Thanks,
Henrik -
Oracle Materialized view tables not getting refreshed automatically.
At Destination:--
CREATE MATERIALIZED VIEW PROG_MEDIA
TABLESPACE ONA_TS1
BUILD IMMEDIATE
REFRESH FAST with rowid
START WITH SYSDATE
NEXT SYSDATE+1/96
AS (select /*+ PARALLEL(a,6) */ * from PROG_MEDIA@onair a);
exec dbms_mview.refresh('PROG_MEDIA','C');
At Source:--
CREATE MATERIALIZED VIEW LOG ON ONAIR.PROG_MEDIA
TABLESPACE MVLOG
WITH ROWID;
Fired manually:--
13:00:43 SQL> exec dbms_mview.refresh('PROG_MEDIA','C');
PL/SQL procedure successfully completed.
At source:--
13:18:35 SQL> select PROG_MEDIA_ID,PROG_MEDIA_NAME from PROG_MEDIA where PROG_MEDIA_ID='102226';
PROG_MEDIA_ID
PROG_MEDIA_NAME
102226
test
At Destination:--
14:03:28 SQL> select PROG_MEDIA_ID,PROG_MEDIA_NAME from PROG_MEDIA where PROG_MEDIA_ID='102226';
PROG_MEDIA_ID PROG_MEDIA_NAME
102226 UTSAV-5-162077
JOB LOG_USER THIS_DATE LAST_DATE_TIME NEXT_DATE_TIME INTERVAL FAILURES WHAT
242 ONAIR 17-05-11 14:17:24 SYSDATE+1/96 7 dbms_refresh.refresh('"ONAIR"."PROG_MEDI
A"');
242 ONAIR 17-05-11 14:32:25 SYSDATE+1/96 8 dbms_refresh.refresh('"ONAIR"."PROG_MEDI
A"');
1> I have scheduled this refresh job for every 15mins, but its not getting executed. Also my job_queue_process is '20'. Whenever i execute it manually it get's refresh.
2> I can schedule a cron for the same for every 15mins but i really dont want to do it.
Kindly help me out.Hi,
I have created MV_CAPABILITIES_TABLE & executed below commands:--
17:56:54 SQL> EXECUTE DBMS_MVIEW.EXPLAIN_MVIEW ('"ONAIR"."PROG_MEDIA"');
PL/SQL procedure successfully completed.
17:57:26 SQL> SELECT capability_name, possible, SUBSTR(related_text,1,8)
17:57:27 2 AS rel_text, SUBSTR(msgtxt,1,60) AS msgtxt
17:57:27 3 FROM MV_CAPABILITIES_TABLE
17:57:27 4 ORDER BY seq;
CAPABILITY_NAME P REL_TEXT MSGTXT
PCT N
PCT N
REFRESH_COMPLETE Y
REFRESH_COMPLETE Y
REFRESH_FAST Y
REFRESH_FAST Y
REWRITE N
REWRITE N
PCT_TABLE N PROG_MED relation is not a partitioned table
PCT_TABLE N PROG_MED relation is not a partitioned table
REFRESH_FAST_AFTER_INSERT Y
REFRESH_FAST_AFTER_INSERT Y
REFRESH_FAST_AFTER_ONETAB_DML Y
REFRESH_FAST_AFTER_ONETAB_DML Y
REFRESH_FAST_AFTER_ANY_DML Y
REFRESH_FAST_AFTER_ANY_DML Y
REFRESH_FAST_PCT N PCT is not possible on any of the detail tables in the mater
REFRESH_FAST_PCT N PCT is not possible on any of the detail tables in the mater
REWRITE_FULL_TEXT_MATCH N PROG_MED mv references a remote table or view in the FROM list
REWRITE_FULL_TEXT_MATCH N PROG_MED mv references a remote table or view in the FROM list
REWRITE_FULL_TEXT_MATCH N query rewrite is disabled on the materialized view
REWRITE_FULL_TEXT_MATCH N query rewrite is disabled on the materialized view
REWRITE_PARTIAL_TEXT_MATCH N materialized view cannot support any type of query rewrite
REWRITE_PARTIAL_TEXT_MATCH N materialized view cannot support any type of query rewrite
REWRITE_PARTIAL_TEXT_MATCH N query rewrite is disabled on the materialized view
REWRITE_PARTIAL_TEXT_MATCH N query rewrite is disabled on the materialized view
REWRITE_GENERAL N materialized view cannot support any type of query rewrite
REWRITE_GENERAL N materialized view cannot support any type of query rewrite
REWRITE_GENERAL N query rewrite is disabled on the materialized view
REWRITE_GENERAL N query rewrite is disabled on the materialized view
REWRITE_PCT N general rewrite is not possible or PCT is not possible on an
REWRITE_PCT N general rewrite is not possible or PCT is not possible on an
PCT_TABLE_REWRITE N PROG_MED relation is not a partitioned table
PCT_TABLE_REWRITE N PROG_MED relation is not a partitioned table
34 rows selected.
Elapsed: 00:00:00.09
What to be done next?
Also i fired the job manually by:--
17:38:02 SQL> set serveroutput on
17:39:45 SQL> EXEC DBMS_JOB.RUN(242);
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.48 -
Overlay in Viewer will not Display
I just made a clean install of Leopard (just kept my Aperture Libary) - installed Aperture 1.5.0 and updated to 1.5.6.
Now I miss two things - the "view setups" - for keywording - viewing ect. and the overlay Infos will not display. I reinstalled Aperture - tried the SafeBoot Mode - but nothing works. Is this known?
Kind regards,
NilsVani,
Have you installed the mid-tier, with the BI & Forms option?
Have you rebooted the server since, and if so, have you started the mid-tier applications (either with the EMWebsite, or with DCMCTL)?
What is the actual URL and port number that you're trying to use? -
Webi snapshot not displaying selected drillfilters of report
I am using business objects enterprise xi 3.1 fixpack 1.5 (12.1.5.1096) on the Java Platform.
I have created a web intelligence report with drillfilters that used as a dropdown selection at the top of the report. one contains a list of countries for instance.
I have the following in a cell within the header to display the selection of the filter:
= If DrillFilters([Country Name])="" Then "All Countries" Else DrillFilters([Country Name])
If no country is selected then the header displays "All Countries" or the name of the country that was selected.
This works great except for when a user takes a "snapshot" of the report with a drillfilter selected using the camera icon at the top right corner of infoview;
the drillfilter selection data does not display in the header of teh snapshot version of the report; it defaults to all....which is very confusing to a user try to create different sceanrios to analyze with the snapshot tool.
Is there a way to correct this behaviour?
Thanks in advance.
-scott
Edited by: Scott M on Apr 19, 2010 6:09 PMScott,
One behaviour that can occur next after clicking on the camera is to next navigate to the new tab and immediately hit the "start drill mode" icon. Once the "start drill mode" icon is activated, the cell within the header to display the selection of the filter will appear.
Thanks,
John -
ORA-00957 Duplicate Column Name Materialized View ( UPDATED: Not answered)
Hello all. I am getting this error when trying to create a Materialized View. I have many other MV I created without problem, but I cannot find the catch up here, can anyone help?. I cannot find any duplicates. The only duplicate I though was the Pipeline_Code column that was entered into the function and the one being being called out as a column. To check, I renamed the latter and still am getting this issue.
Any help would be greatly appreciated.
Thanks!
The query is below:
CREATE MATERIALIZED VIEW MV_TEST_STATION
REFRESH COMPLETE
START WITH TO_DATE('20-SEP-2013 00:00:00','dd-mon-yyyy hh24:mi:ss')
NEXT (SYSDATE +12/24)
AS
SELECT T.TEST_STATION_ID,
--(SELECT TEST_STATION_TYPE.DESCRIPTION
-- FROM TEST_STATION_TYPE
-- WHERE TEST_STATION.TEST_STATION_TYPE =
-- TEST_STATION_TYPE.TEST_STATION_TYPE)
--AS TEST_STATION_TYPE,
TST.DESCRIPTION AS TEST_STATION_TYPE,
T.SURVEY,
T.STATUS,
T.STATION,
F_TRUESTATION2 (
T.STATION,
T.PIPELINE_CODE,
F_REROUTE_CODE (T.STATION,
T.PIPELINE_CODE))
AS TRUE_STATION,
T.REQUIRED,
-- (SELECT PIPELINE_CODES.PIPELINE_CODE_DESCRIPTION
-- FROM PIPELINE_CODES
-- WHERE TEST_STATION.PIPELINE_CODE = PIPELINE_CODES.PIPELINE_CODE)
-- AS PIPELINE_CODE,
PC.PIPELINE_CODE_DESCRIPTION AS PC_PIPELINE_CODE,
T.INSTALL_DATE,
T.FUNCTIONAL COMMENTS,
TSR.TEST_STATION_READING_ID,
TSR.TEST_DATE,
TSR.SURVEYOR,
TSR.ON_VOLTS,
TSR.ON_BG,
TSR.ON_AG,
TSR.METER_UTC,
TSR.METER_ID,
TSR.IO_BG,
TSR.IO_AG,
TSR.INSTANT_OFF_VOLTS,
TSR.FUNCTIONAL_DAMAGE_OUT,
TSR.FUNCTIONAL_DAMAGE_IN,
TSR.COSEMETIC_DAMAGE_OUT,
TSR.COSEMETIC_DAMAGE_IN,
TSR.COMMENTS,
TSR.CASING_ON,
TSR.CASING_OFF,
TSR.CASING,
TSR.CALIBRATION_DUE_DATE,
TSR.ANODE_AMPS_ON,
TSR.ANODE_AMPS_OFF,
TSR.ANODE
FROM TEST_STATION T
INNER JOIN TEST_STATION_TYPE TST ON T.TEST_STATION_TYPE = TST.TEST_STATION_TYPE
INNER JOIN PIPELINE_CODES PC ON T.PIPELINE_CODE = PC.PIPELINE_CODE
INNER JOIN TEST_STATION_READING TSR ON T.TEST_STATION_ID = TSR.TEST_STATION_ID
WHERE T.TEST_STATION_ID = TSR.TEST_STATION_IDsince we don't have your tables or data, we can not run, test, fix or improve posted code
How do I ask a question on the forums?
https://forums.oracle.com/message/9362002#9362002 -
SharePoint 2010 Datasheet View - Filter not displaying correctly on list
Hi,
I have a list where I want to filter in datasheet view. The filter will work correctly when I first open Internet Explorer:
However, if I open the list again and go into datasheet view I get the following filter which does not display correctly:
Has anyone else come across this?
MarkHi Mark,
please have a try on this kb too:
http://support.microsoft.com/kb/2760758/en-us
Regards,
Aries
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
RH8 - HTML Design view is not displaying what the HTML specifies.
I recently edited a template (Master page) that includes tables. Now the design view of the master page does not correctly display the HTML for that page
and the design view of each page that uses that Master Page displays blank tables. The HTML view includes the content, but the design view does not.I understand the use of Master Pages. The topics were already associated with the Master page that included tables and the
Design view displayed the content perfectly. It wasn't until I edited the color of the cell borders in the Master page that everything went haywire.
As it is now, the design view is completely unusable for me. This adds a layer of inconvenience that is time consuming. I'm just trying to get the design view back to what it was earlier today. -
On commit fast refreshable materialized view does not update
... but instead it deletes and inserts. And I would like it to perform an update, so we can add a database trigger to call a webservice. But it's crucial that we call the "update webservice" when it updates.
This is an Oracle 10.2.0.4 database.
Output of my problem-reproducing-case:
First creation of a small instrumentation setup:
SQL> create table logtable
2 ( id number
3 , time timestamp
4 , text varchar2(100)
5 )
6 /
Tabel is aangemaakt.
SQL> create sequence log_seq cache 100
2 /
Reeks is aangemaakt.
SQL> create procedure add_log_message (p_text in varchar2)
2 is
3 pragma autonomous_transaction;
4 begin
5 insert into logtable
6 values (log_seq.nextval,systimestamp,p_text);
7 commit;
8 end;
9 /
Procedure is aangemaakt.Two tables with full blown materialized view logs defined on them:
SQL> create table t1 (id,ean)
2 as
3 select level
4 , to_char(trunc(dbms_random.value(0,999999999999999999)))
5 from dual
6 connect by level <= 10
7 /
Tabel is aangemaakt.
SQL> alter table t1 add primary key (id)
2 /
Tabel is gewijzigd.
SQL> create materialized view log on t1 with sequence, rowid (id,ean) including new values
2 /
Gematerialiseerde viewlog is aangemaakt.
SQL> create table t2 (id,t1_id,value)
2 as
3 select level
4 , level * 2
5 , trunc(dbms_random.value(1,100))
6 from dual
7 connect by level <= 5
8 /
Tabel is aangemaakt.
SQL> alter table t2 add primary key (id)
2 /
Tabel is gewijzigd.
SQL> alter table t2 add foreign key (t1_id) references t1(id)
2 /
Tabel is gewijzigd.
SQL> create materialized view log on t2 with sequence, rowid (id,t1_id,value) including new values
2 /
Gematerialiseerde viewlog is aangemaakt.And the materialized view itself, containing an outer join. And on that materialized view there is a trigger that logs the action performed (I, U or D):
SQL> create materialized view mv refresh fast on commit
2 as
3 select t1.rowid t1_rowid
4 , t2.rowid t2_rowid
5 , t1.id t1_id
6 , t1.ean ean
7 , t2.id t2_id
8 , t2.value value
9 from t1
10 , t2
11 where t1.id = t2.t1_id (+)
12 and t1.ean is not null
13 /
Gematerialiseerde view is aangemaakt.
SQL> create trigger mv_trg_ariud
2 after insert or update or delete on mv
3 for each row
4 begin
5 add_log_message
6 ( case
7 when inserting then 'I'
8 when updating then 'U'
9 when deleting then 'D'
10 end
11 );
12 end;
13 /
Trigger is aangemaakt.
SQL> select * from mv
2 /
T1_ROWID T2_ROWID T1_ID EAN T2_ID VALUE
AAFwMeAChAABamIAAA 1 360432237186591962
AAFwMeAChAABamIAAB AAFwMhAChAABamaAAA 2 706465424496730795 1 77
AAFwMeAChAABamIAAC 3 678961199378791568
AAFwMeAChAABamIAAD AAFwMhAChAABamaAAB 4 351418443524585979 2 35
AAFwMeAChAABamIAAE 5 610374519804201714
AAFwMeAChAABamIAAF AAFwMhAChAABamaAAC 6 798782716740397566 3 33
AAFwMeAChAABamIAAG 7 909989471290455410
AAFwMeAChAABamIAAH AAFwMhAChAABamaAAD 8 670698835550268126 4 69
AAFwMeAChAABamIAAI 9 746290195605805530
AAFwMeAChAABamIAAJ AAFwMhAChAABamaAAE 10 157491298211132413 5 82
10 rijen zijn geselecteerd.Now we add a new t1 row, which leads to an extra row in the mv on commit time:
SQL> insert into t1 values (11, '999999999999999999')
2 /
1 rij is aangemaakt.
SQL> commit
2 /
Commit is voltooid.
SQL> select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
2 from logtable
3 order by id
4 /
LOG
I 11:39:47.817225
1 rij is geselecteerd.
SQL> select * from mv where ean = '999999999999999999'
2 /
T1_ROWID T2_ROWID T1_ID EAN T2_ID VALUE
AAFwMeAChAABamJAAA 11 999999999999999999
1 rij is geselecteerd.As expected. Now insert a record in t2, which should lead to an update of the materialized view:
SQL> insert into t2 values (11,11,1)
2 /
1 rij is aangemaakt.
SQL> commit
2 /
Commit is voltooid.
SQL> select * from mv where ean = '999999999999999999'
2 /
T1_ROWID T2_ROWID T1_ID EAN T2_ID VALUE
AAFwMeAChAABamJAAA AAFwMhAChAABambAAA 11 999999999999999999 11 1
1 rij is geselecteerd.
SQL> select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
2 from logtable
3 order by id
4 /
LOG
I 11:39:47.817225
D 11:39:47.992824
I 11:39:48.015072
3 rijen zijn geselecteerd.But it doesn't: apparently it has inserted a row and deleted a row. Let's do a normal update:
SQL> update t2 set value = 2 where id = 11
2 /
1 rij is bijgewerkt.
SQL> commit
2 /
Commit is voltooid.
SQL> select * from mv where ean = '999999999999999999'
2 /
T1_ROWID T2_ROWID T1_ID EAN T2_ID VALUE
AAFwMeAChAABamJAAA AAFwMhAChAABambAAA 11 999999999999999999 11 2
1 rij is geselecteerd.
SQL> select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
2 from logtable
3 order by id
4 /
LOG
I 11:39:47.817225
D 11:39:47.992824
I 11:39:48.015072
D 11:39:48.142621
I 11:39:48.168553
5 rijen zijn geselecteerd.And again: a delete and an insert.
Does anybody know if I can change this behaviour and let the mv perform an update?
In another materialized view (not shown here) containing aggregates, I've seen that it performs an update. But using this "join" mv, it does not.
Here is the script, if you want to try it on your own database:
create table logtable
( id number
, time timestamp
, text varchar2(100)
create sequence log_seq cache 100
create procedure add_log_message (p_text in varchar2)
is
pragma autonomous_transaction;
begin
insert into logtable
values (log_seq.nextval,systimestamp,p_text);
commit;
end;
create table t1 (id,ean)
as
select level
, to_char(trunc(dbms_random.value(0,999999999999999999)))
from dual
connect by level <= 10
alter table t1 add primary key (id)
create materialized view log on t1 with sequence, rowid (id,ean) including new values
create table t2 (id,t1_id,value)
as
select level
, level * 2
, trunc(dbms_random.value(1,100))
from dual
connect by level <= 5
alter table t2 add primary key (id)
alter table t2 add foreign key (t1_id) references t1(id)
create materialized view log on t2 with sequence, rowid (id,t1_id,value) including new values
create materialized view mv refresh fast on commit
as
select t1.rowid t1_rowid
, t2.rowid t2_rowid
, t1.id t1_id
, t1.ean ean
, t2.id t2_id
, t2.value value
from t1
, t2
where t1.id = t2.t1_id (+)
and t1.ean is not null
create trigger mv_trg_ariud
after insert or update or delete on mv
for each row
begin
add_log_message
( case
when inserting then 'I'
when updating then 'U'
when deleting then 'D'
end
end;
select * from mv
insert into t1 values (11, '999999999999999999')
commit
select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
from logtable
order by id
select * from mv where ean = '999999999999999999'
insert into t2 values (11,11,1)
commit
select * from mv where ean = '999999999999999999'
select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
from logtable
order by id
update t2 set value = 2 where id = 11
commit
select * from mv where ean = '999999999999999999'
select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
from logtable
order by id
set echo off
drop materialized view mv
drop table t2 purge
drop table t1 purge
drop procedure add_log_message
drop sequence log_seq
drop table logtable purge
/Regards,
Rob.
Edited by: Rob van Wijk on 7-mrt-2009 9:49
bumpRob,
here's what Tom says about this:
seems dangerous as there is nothing stopping Oracle from performing an "update" of a materialized
view as a DELETE+INSERT. For you see, the internals of how materialized views are maintained are
"internal" and subject to change (so even if documented - so what, you cannot control the "how" of
materialized view refreshes)
...It is from 2006 though ...things might have changed ;) -
Material column is not displayed in ME21N in NEW ECC 6.0 - Urgent
Hi Gurus
I am working in Technical upgradation from 4.6 C to ECC 6.0
We got new system last week only, in the new system (6.0) in ME21N - the filed for entering material no is not coming.
Please suggest
Muthu kumarHi,
After upgradtion some of the screens will changed from older version to new version. This is not common for all clients. Some upgradtion will have like this impact.
The Material number is there on the ME21N transaction but may be in the different column check that correctly, but may not be on the same column as in 4.6 C but in different column may be middle or last.
Other wise check the configuration on the top right of Item overview there is button when you click that system will show the Table settings there check any new variants are created or not. If there modify that and save then activate.
rgds
Chidanand
Maybe you are looking for
-
FCE Won't open - crashes everytime
I am having a dilemma with FCE and FCP. I was having issues with Quicktime 7.4.1 so I used Pacifist to overide it with quicktime 7.2. After I did that, I was unable to open FCE or FCP they crash before they open. I went back in and re-loaded Quicktim
-
Apple's Free Bumper Program is lagging!
So I got my iPhone 4 a few days ago, and yesterday I downloaded the free bumper program app. However, when I received my confirmation e-mail it said it is estimated to ship by August 27 and deliver by Sept 1. Did anyone else get a different date?
-
PDF back to editable text - is it possibly ?
Hi got a .pdf document that needs to be corrected. Can it be imported into Pages08 or any other text editor ? Yours Bengt W
-
Synchronous and asynchronous mode
Hi all, when to use synchronous and asynchronous mode in BDC cheers
-
Why is my ipod always so slow?
it is always slow loading things,going back to home screeen, opening internet using apps, slow with safari, appstore, and itunes store.