Problem regarding Materialized View
Hi,
I have a master table "nms_num_schm" on SID-SLBANCS and its corresponding materialized view "mlog$_nms_num_schm". The MV is supposed to move data from this master table to a table "nms_num_schm_mv" on SID-ORCL.
The MV is set to select data after every 5 mins and the db link is also set. also the grants have also been provided.
I inserted the data in master table and data populated in the mlog table.But the problem is that its staying in mlog table and not moved to the "_mv" table even after 1 hr.Even though snaptime is populated with a time of refresh,the refresh didnt happen.
So 3 things here -
1) Why did the refresh didnt happen
2) If the refresh didnt happen because of any issue/error, where can I check what was the issue.
3) To make things worse, there are 17 more tables such similar setup. Some data refresh works sometimes, sometimes not.
Please provide your valuable comments to resolve the same.
Here's a snapshot of the mlog table -
insert into MLOG$_NMS_NUM_SCHM (NMS_SEC_ID, NMS_NMBRNG_SCHM, SNAPTIME$$, DMLTYPE$$, OLD_NEW$$, CHANGE_VECTOR$$)
values ('ZA00ISCDWD', 1, to_date('05-11-2008 11:17:07', 'dd-mm-yyyy hh24:mi:ss'), 'I', 'N', 'FEFF');
Hi,
I have a master table "nms_num_schm" on SID-SLBANCS and its corresponding materialized view "mlog$_nms_num_schm". The MV is supposed to move data from this master table to a table "nms_num_schm_mv" on SID-ORCL.
The MV is set to select data after every 5 mins and the db link is also set. also the grants have also been provided.
I inserted the data in master table and data populated in the mlog table.But the problem is that its staying in mlog table and not moved to the "_mv" table even after 1 hr.Even though snaptime is populated with a time of refresh,the refresh didnt happen.
So 3 things here -
1) Why did the refresh didnt happen
2) If the refresh didnt happen because of any issue/error, where can I check what was the issue.
3) To make things worse, there are 17 more tables such similar setup. Some data refresh works sometimes, sometimes not.
Please provide your valuable comments to resolve the same.
Here's a snapshot of the mlog table -
insert into MLOG$_NMS_NUM_SCHM (NMS_SEC_ID, NMS_NMBRNG_SCHM, SNAPTIME$$, DMLTYPE$$, OLD_NEW$$, CHANGE_VECTOR$$)
values ('ZA00ISCDWD', 1, to_date('05-11-2008 11:17:07', 'dd-mm-yyyy hh24:mi:ss'), 'I', 'N', 'FEFF');
Similar Messages
-
Problem with Materialized Views after an export
Hi @ everybody,
At an Oracle 11g R2 (11.2.0.3.0) instance, all actual CPU's/SPU's are installed, on a Red Hat 6 Machine i have a problem with Materialized Views from a schema, which i have exportet from an old database machine on Oracle 10g (10.2.0.1.0) to the new machine.
I've exportet with the old exp and imported with imp, because i know, that i get some strange errors because of the materialized views when i'm using the new expdp and impdp tools.
At the old machine the materialized views are so programmed, that they get an update of data at a defined time like this:
START WITH TRUNC(SYSDATE) + 21/24
NEXT SYSDATE+1
...But after the export this "update function" of the materialized view is not available. So i have deleted that views and recreated them with the START WITH parameters. So now they are running.
But why do i have this problem?
Is this "START WITH" somewhere written as a job or so in, for example, DBMS_SCHEDULER or something else? So i had forgotten to export these jobs or where is that defined?
Is this a bug?
Thanks for answers and help!
Best regards,
DavidI can't remember the error of expdp/impdp. That is some days ago, i have to rebuild this.
I think in my scenario for the import i don't need the TABLE_EXISTS_ACTION, because by importing at the new server i've just createt the naked tablespace for the data and the users, not more. So he didn't has something to overwrite.
And i have to tell you: i'm just the dbA. The desining of the tables and materialized views is many years ago by installing the old server. I'm just to young in my company to know about the design of the instance and why it was designed so.
Anyway: my problem is, that after the import of the schemas to a new server the "START WITH" option in the materialized views is not there anymore and i just want to why so i can think about a solution for that and create it with the database designers of my company.
EDIT: And here are the SQL Statements for creating the Materialized Views:
First, at the OLD Server (Oracle 10g 10.2.0.1.0)
CREATE MATERIALIZED VIEW "DUPONT_CCG2_P"."PR_PRODUCT_ITEMS"
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "DUPONT_14523"
BUILD IMMEDIATE
USING INDEX
REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT SYSDATE+1
USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS (SELECT DISTINCT
PR_CUSTOMER_MASTER_DATA.CLIENT_ID,
PR_CUSTOMER_MASTER_DATA.ILN_USER,
PR_ARTICLE.EAN,
PR_ARTICLE.CODE,
PR_USED_ARTICLE_TEXT.ARTICLE_TEXT,
PR_USED_ARTICLE_TEXT.LANG_CODE,
PR_ARTICLE.SUP_ITEM_NO,
PR_ARTICLE.OLD_ITEM_NO,
PR_COMPANY_ITEM_MATCH.ITEM_BY_NO,
PR_COMPANY_ITEM_MATCH.UOM_UNIT,
PR_COMPANY_ITEM_MATCH.PRICE_UOM,
PR_COMPANY_ITEM_MATCH.PRICE,
PR_COMPANY_ITEM_MATCH.CURRENCY,
PR_COMPANY_ITEM_MATCH.PRICE_QTY,
PR_COMPANY_ITEM_MATCH.SALES_UNIT,
PR_COMPANY_ITEM_MATCH.START_DATE,
PR_COMPANY_ITEM_MATCH.END_DATE,
PR_ARTICLE.UPDATED_AT
FROM PR_ARTICLE, PR_COMPANY_ITEM_MATCH, PR_USED_ARTICLE_TEXT, PR_CUSTOMER_MASTER_DATA, PR_ADDRESS
WHERE PR_ADDRESS.ORDER_TYPE='REP'
AND PR_CUSTOMER_MASTER_DATA.ILN_USER=PR_ADDRESS.ILN_USER
AND PR_COMPANY_ITEM_MATCH.ILN_USER=PR_ADDRESS.ILN_LINK
AND PR_CUSTOMER_MASTER_DATA.SALES_ORG=PR_COMPANY_ITEM_MATCH.SALES_ORG
AND PR_CUSTOMER_MASTER_DATA.CLIENT_ID=PR_COMPANY_ITEM_MATCH.CLIENT_ID
AND PR_CUSTOMER_MASTER_DATA.CLIENT_ID=PR_ADDRESS.CLIENT_ID
AND PR_ARTICLE.SUP_ITEM_NO=PR_COMPANY_ITEM_MATCH.SUP_ITEM_NO
AND PR_COMPANY_ITEM_MATCH.SALES_ORG=PR_USED_ARTICLE_TEXT.SALES_ORG
AND PR_ARTICLE.SUP_ITEM_NO=PR_USED_ARTICLE_TEXT.SUP_ITEM_NO
AND PR_CUSTOMER_MASTER_DATA.LANG_CODE=PR_USED_ARTICLE_TEXT.LANG_CODE
AND ( PR_COMPANY_ITEM_MATCH.END_DATE IS NULL OR to_date(PR_COMPANY_ITEM_MATCH.END_DATE,'YYYYMMDD') - sysdate > 0)
AND ( PR_COMPANY_ITEM_MATCH.START_DATE IS NULL OR sysdate - to_date(PR_COMPANY_ITEM_MATCH.START_DATE,'YYYYMMDD') > 0)
)And here the at the NEW Server (Oracle 11g R2 11.2.0.3.0)
CREATE MATERIALIZED VIEW "DUPONT_CCG2_P"."PR_PRODUCT_ITEMS" ("CLIENT_ID", "ILN_USER", "EAN", "CODE", "ARTICLE_TEXT", "LANG_CODE", "LANR", "OLD_LANR", "ITEM_BY_NO", "UOM_UNIT", "PRICE_UOM", "PRICE", "CURRENCY", "PRICE_QTY", "SALES_UNIT", "START_DATE", "END_DATE", "UPDATED_AT")
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "DUPONT_14523"
BUILD IMMEDIATE
USING INDEX
REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT SYSDATE+1
USING DEFAULT LOCAL ROLLBACK SEGMENT
USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE
AS (SELECT DISTINCT
PR_CUSTOMER_MASTER_DATA.CLIENT_ID,
PR_CUSTOMER_MASTER_DATA.ILN_USER,
PR_ARTICLE.EAN,
PR_ARTICLE.CODE,
PR_USED_ARTICLE_TEXT.ARTICLE_TEXT,
PR_USED_ARTICLE_TEXT.LANG_CODE,
PR_ARTICLE.SUP_ITEM_NO,
PR_ARTICLE.OLD_ITEM_NO,
PR_COMPANY_ITEM_MATCH.ITEM_BY_NO,
PR_COMPANY_ITEM_MATCH.UOM_UNIT,
PR_COMPANY_ITEM_MATCH.PRICE_UOM,
PR_COMPANY_ITEM_MATCH.PRICE,
PR_COMPANY_ITEM_MATCH.CURRENCY,
PR_COMPANY_ITEM_MATCH.PRICE_QTY,
PR_COMPANY_ITEM_MATCH.SALES_UNIT,
PR_COMPANY_ITEM_MATCH.START_DATE,
PR_COMPANY_ITEM_MATCH.END_DATE,
PR_ARTICLE.UPDATED_AT
FROM PR_ARTICLE, PR_COMPANY_ITEM_MATCH, PR_USED_ARTICLE_TEXT, PR_CUSTOMER_MASTER_DATA, PR_ADDRESS
WHERE PR_ADDRESS.ORDER_TYPE='REP'
AND PR_CUSTOMER_MASTER_DATA.ILN_USER=PR_ADDRESS.ILN_USER
AND PR_COMPANY_ITEM_MATCH.ILN_USER=PR_ADDRESS.ILN_LINK
AND PR_CUSTOMER_MASTER_DATA.SALES_ORG=PR_COMPANY_ITEM_MATCH.SALES_ORG
AND PR_CUSTOMER_MASTER_DATA.CLIENT_ID=PR_COMPANY_ITEM_MATCH.CLIENT_ID
AND PR_CUSTOMER_MASTER_DATA.CLIENT_ID=PR_ADDRESS.CLIENT_ID
AND PR_ARTICLE.SUP_ITEM_NO=PR_COMPANY_ITEM_MATCH.SUP_ITEM_NO
AND PR_COMPANY_ITEM_MATCH.SALES_ORG=PR_USED_ARTICLE_TEXT.SALES_ORG
AND PR_ARTICLE.SUP_ITEM_NO=PR_USED_ARTICLE_TEXT.SUP_ITEM_NO
AND PR_CUSTOMER_MASTER_DATA.LANG_CODE=PR_USED_ARTICLE_TEXT.LANG_CODE
AND ( PR_COMPANY_ITEM_MATCH.END_DATE IS NULL OR to_date(PR_COMPANY_ITEM_MATCH.END_DATE,'YYYYMMDD') - sysdate > 0)
AND ( PR_COMPANY_ITEM_MATCH.START_DATE IS NULL OR sysdate - to_date(PR_COMPANY_ITEM_MATCH.START_DATE,'YYYYMMDD') > 0)
)The own differences i can see is at the "header". In the new one is the NOCOMPRESS LOGGING Option and in the first line the code has the columns diretcly defined.
But, i think, for my problem this line is determining:
REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT SYSDATE+1And this line is the same at both server.
Edited by: David_Pasternak on 12.04.2013 00:06 -
Problem with Materialized Views in 10g
Hi All,
I am creating a Materialized View like
CREATE MATERIALIZED VIEW mvname TABLESPACE SYSTEM BUILD IMMEDIATE REFRESH WITH ROWID FOR UPDATE AS ( SELECT a,b,c FROM table_a,table_b,table_c WHERE cond );
I am getting an error
SQL Error: ORA-12013: updatable materialized views must be simple enough to do fast refresh.
Can anyone tell what is the problem?
I have included rowid of all three tables in select clause.Hi,
From Oracle Docs:
ORA-12013: updatable materialized views must be simple enough to do fast refresh
Cause: The updatable materialized view query contained a join, subquery, union, connect by, order by, or group by caluse.
Action: Make the materialized view simpler. If a join is really needed, make multiple simple materialized views then put a view on top of them.
Regards
K.Rajkumar -
Problems creating Materialized View
Hello,
i have Problems with the creation of a materialized view with the following sql-statement:
SELECT Tag_ID, ROWNUM AS RowNr
FROM L_tag
ORDER BY tag_id ASC
in the table L_tag is only one column (tag_id) that contains all dates (1895.01.01 - 2020.01.01) as numbers (format like: 20020508)
if i create the materialized view, no errors occures. if i check later the sql-statement of this materialized view, there is no ORDER BY!!:
SELECT Tag_ID, ROWNUM AS RowNr
FROM L_tag
has anyone an idea, why oracle don't accept the order by clause?
thanks,
Domehas anyone an idea, why oracle don't accept the order by clause?Yes, because Oracle stores data in an unorderred fashion (except for IOT, but that's different matter). So your ORDER BY clause makes no sense for stored data.
You must use ORDER BY when doing the final select from the MV (...).
Regards,
Yoann. -
Hello everybody!!!
I used the following script in order to see the automatic refresh of data contained in a materialized view.
I used the following script in SCOTT schema:
create materialized view log on emp
with rowid (job,sal)
including new values
create materialized view emp_mv
build immediate
refresh fast on commit
as
select job , sum(sal) sum_sal
from emp
group by job
The problem is that after i update the sal column (and commit it) of an employee and selecting from the emp_nv , I DO NOT see any difference , although the materialized view log has been updated successfully!!!
Under which circumstances the materialized view would be updated as well?
Simon.What is job_queue_processes set to on your system? Materialized view refreshes are generally done as background jobs, so that initializiation parameter needs to be set to a non-zero value.
Justin -
Problem with materialized views
I have a problem with the use of materialized views.
I make this procedure:
1: I create a table with the results of a query
2: Create a materialized view in that prebuilt table
Problem: When i execute the query after creating the materialized view i receive this error from oracle : ora-00903 table do not exists.
I get that error in 10% of the materielized views that i create that way, anyone can tell me what is the problem?I'm using Oracle 9.2.0.5.0
query rewrite disabled -
Problem with materialized view
Hello!!!
In order to see how materialized views work , I executed the following script in SCOTT schema:
create materialized view log on emp
with rowid (job,sal)
including new values;
create materialized view emp_mv
build immediate
refresh fast on commit
as
select job , sum(sal) sum_sal
from emp
group by job;
The problem is that when i update the column sal , or insert a new record in EMP table , the materialized view emp_nv IS NOT UPDATED , although the materialized view log registers the change.
In which circumstances the desired change will take place?
Note:
The parameter 'JOB_QUEUE_PROCESSES' of the database has the value 10.Hi,
I tried your code and it works perfectly for me. You must ensure you commit your change in order for the materialized view to refresh. -
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 -
Buget Exceed problem regarding material transfer in project system
Hello Sir,
I have a problem regarding budget in project system.
when i do budget and release . and do any transaction
with that budgeted wbs element in particular project.
i get budget excced errors usally.
however, budget remains more than exceeded buget.
Let us touch with a example in brief, we have a buget for a L&T project 10 Lakh.
Buget Release actual cost total cost commitment
10Lakh 10Lakh 8lakh 1Lakh
when i transfer a material from another project to this L&T project material worth is 50thousands.
i get a errors for L&T project budget exceed with 40thousands.
however in project budget remains 1Lakh remaining .
why system shows errors for this material transfer worth rs 50thousands
Please help me regarding this problem where is 1lakh budget
with regards
sanjay agrawalHello sir,
there is no any problem regarding budget supplement but if project sometimes
remains 20lakh buget price remaining out of 50lakh.
and need 1 lakh material price for transfer in project
then why need to do budget supplement for 1 lakh if project
remains 20lakh price rest.
please guide me for above problems
with regards
sanjay agrawal -
Numeric Value rounding problems in Materialized Views
All numeric values are getting rounded in the materialized views. Is there any solution for this?
Any help is greatly appreciated...
Thanks,
SatyaHi Bill,
Actually the problem is with the Toad version I'm using, it is not interpreting the decimal values of MVs properly. They look good when I checked in SQLPLUS.
Any way, thanks for your response.
-Satya -
Hi,
I have two servers one is remote database (it resides in public ip) and another one is local database.
I have created Materialized view in Local System to replicate the data from remote system to Local System, Local system Internally creates Jobs , because of this replication Local System continuously ping the remote system, if any point of time network goes down, Local System unable to ping the remote system , at that time it gives Request timed out, due to this Reason jobs were going to fail. Is there any possibility to start these jobs automatically without manual intervention.
Can you please suggest to go forward this.
Regards,
Paparaoyou may have another dbms_job or unix cron job to control and enable some of or all of broken jobs easily? A sample code may be like this one;
DECLARE
CURSOR C1 IS SELECT * from USER_JOBS
WHERE THIS_SEC IS NULL AND BROKEN='Y';
ND DATE;
stmt VARCHAR2(200);
BEGIN
FOR C1R IN C1 LOOP
stmt := 'SELECT '||C1R.INTERVAL||' FROM DUAL';
EXECUTE IMMEDIATE stmt INTO ND;
DBMS_OUTPUT.PUT_LINE(C1R.JOB||'-'||TO_CHAR(ND, 'DD/MM/YYYY HH24:MI:SS'));
DBMS_JOB.BROKEN(C1R.JOB, FALSE, ND);
END LOOP;
END;
/ -
Problems with materialized view and fk between two db
Hi,
i have two databases db1 and db2 and from db1 is a table(DM_MESSDATEN) which contains a foreign key to a table(DM_FAUNA) in db2.
Now I want to write my done steps to get more clearification and hopefully someone can point out my wrong steps.
1st
i create the tables inside db1 without a foreign key to the table in db2.
2nd
i create a database link inside db1 to db2
create public database link DATENBANK2 connect to phantomas identified by bachelor06 using 'DMDB2';
3rd
now and here i stuck want to create a materialized view inside db1
create materialized view DATAMART_MVW AS
select * from DM_MESSDATEN, DM_FAUNA@DATENBANK2
where DM_MESSDATEN.FAUNA_ID=DM_FAUNA.FAUNA_ID;
or should the view be created inside of db2?
4th
and then i want to reactivate the foreign key inside the table of db1- but can't because of
problems in step 3 :(
So it would be nice if someone could help me
thanks a lot
thomasI think you haven't been clear in your statement of your problem:
now and here i stuck want to create a materialized view inside db1Why are you stuck? If you want to enforce a froeign key locally using data from a remote database then you need to build a materialized view on your local table tablespace that sucks data across from the remote database. You can then create a foreign key on your local table using the local MV.
If the remote table is updated frequently and you want the local MV kept in sync then you will need to put soem further replication in place. For instance you may need to create a materilaized view log on the remote database.
Cheers, APC -
Problem refreshing Materialized View in SQL Developer
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? Thanks for any advice on this.Hi Blama,
DDL for Index-organized Materialized Views is generated in the Early Adopter release 4.1.0.866, which is now available for download.
The Organization on the Table that is implemented as the Materialized View should be set to INDEX, and the Table's IOT properties will be used during DDL generation.
David -
CONTAINS problem in materialized view
SELECT SCORE(1) AS RELEVANCE, AST_OID, TOTAL
FROM asset_materialized_vw
WHERE CONTAINS(total, '%PRODUCT%', 1) > 0
ORDER BY RELEVANCE DESC;
The table in the FROM clause, asset_materialized_vw is a materialized view of a view called asset_vw with a complex query in it, it produces 2 columns, 1 ast_oid, which contains a unique id, and total which is a varchar2 column on which I put a CTXSYS.CONTEXT index, after putting the index on this column, I can execute the above query and it results many rows, but after about 5 - 10 minutes it doesn't return any rows at all anymore. Here is the script I used to create the index and materialized view:
The view:
SELECT * FROM asset_materialized_vw WHERE upper(total) LIKE '%N4S%'
DROP MATERIALIZED VIEW mv_emp_pk
CREATE MATERIALIZED VIEW asset_materialized_vw
REFRESH COMPLETE
NEXT SYSDATE + 1/96
WITH PRIMARY KEY
AS
SELECT AST_OID,
CONCAT(ASSET_REMARK, CONCAT(OBJECT_REFERENCE, CONCAT(PRJ_PROJECT_NAME, CONCAT(DV_REFERENCE_VALUE, CONCAT(LD_NAME_B, CONCAT(LD_NAME_A, CONCAT(DVL_DESCRIPTION, CONCAT(MDV_TEXT_VALUE, CONCAT(BUT_DVL_DESCRIPTION, CONCAT(MAG_DVL_DESCRIPTION, CONCAT(AGP_DVL_DESCRIPTION, CONCAT(BRC_DVL_DESCRIPTION, CONCAT(CAM_DVL_DESCRIPTION, CONCAT(PRS_NAME, PRD_PROPERTIES)))))))))))))) AS TOTAL
FROM ASSET_VW
The index:
CREATE INDEX idx_asset_materialized_vw ON asset_materialized_vw(total)
INDEXTYPE IS CTXSYS.CONTEXTSimple testcase to reproduce your issue:
/* snapshot refreshes every 15 seconds */
SQL> CREATE MATERIALIZED VIEW emp_mv
REFRESH COMPLETE
NEXT SYSDATE + 15/(24*60*60)
AS
SELECT * FROM emp
Snapshot created.
/* Context index */
SQL> CREATE INDEX emp_txt_idx ON emp_mv
(ename)
INDEXTYPE IS ctxsys.CONTEXT
Index created.
SQL> SELECT ename,
deptno
FROM emp_mv
WHERE contains (ename, 'scott') > 1
ENAME DEPTNO
SCOTT 20
/* wait 20 seconds*/
SQL> EXEC dbms_lock.sleep(20)
PL/SQL procedure successfully completed.
SQL> SELECT *
FROM emp_mv
WHERE contains (ename, 'scott') > 1
"no rows selected."
/* sync the index */
SQL> BEGIN
ctx_ddl.sync_index ('emp_txt_idx');
END;
SQL> SELECT ename,
deptno
FROM emp_mv
WHERE contains (ename, 'scott') > 1
ENAME DEPTNO
SCOTT 20I would alter the generated job (from creation of materialized view) to append the sync of the index:
BEGIN
SYS.DBMS_JOB.CHANGE
job => 325634 /* your job number */
,what => 'dbms_refresh.refresh(''"EMP_MV"'');
ctx_ddl.sync_index (''emp_txt_idx'');'
,next_date => sysdate
,interval => 'SYSDATE + 15/(24*60*60) '
END; -
Doubt Regarding Materialized View
Hello,
I am working on Oracle 10g.
We have multiple materialized Views which we Refresh in every 15 mins. My question is that can we get data from these MV's for a particular date....??When i am Executing a query ..which was mentioned in the earlier post...m getting a particular error.
My Query
select * from db_rational_status_reaffirm_mv as of timestamp sysdate-1
Error m Getting
ORA-01555: snapshot too old : rollback segment number 4 with name "_SYSSMU4$" too small
Any Solution ..?
Maybe you are looking for
-
Custom message is not getting displayed after raising do_not_save
Hi all, In Order_save BADI, based some conditions, we were throwing custom messages. FYI., code used, CV_OWN_MESSAGE = 'X'. MESSAGE 'xxxxxxxxxxxxxx' TYPE 'W' Raising do_not_save. After Solman upgrade from 7.0 to 7.1, system is not displaying custom m
-
What do I need to connect my new Yamaha RX-V671 receiver wirelessly to my Air Port Express?
I have just received my new Yamaha RX-V671 receiver and the only connection I have for the internet is by a network cable or by a USB slot. I would like to hook this up wirelessly to my Air Port Express, I just need to know what I need to get so I c
-
i have a dynamic JMenu on a jframe. The menu is populated by looking up database entries and ptting them into the right place. This is done by a method 'menus()'. I also have an addingredients class which adds new ingredient entries into the database
-
Missing Playlist in iTunes when trying to sync iPod nano
I have a playlist called new tunes, it's my most recent songs added to iTunes. For some reason when I plug in my iPod nano I don't have this playlist available to sync to my iPod, it's not in the list of playlists available to sync to the iPod nano.
-
How to recognize invalid UTF8-codepoints ?
Not all possible byte-sequence are valid UT8-characters. ( See http://en.wikipedia.org/wiki/Utf-8 ) For instance the byte-sequnence 195 and 34 (decimal) is invalid. Oracle seems to have no problem with it. It stores the sequence in the database and i