Can't update master table when creating a materialized view log.
Hi all,
I am facing a very strange issue when trying to update a table on which I have created a materialized view log (to enable downstream fast refresh of MV's). The database I am working on is 10.2.0.4. Here is my issue:
1. I can successfully update (via merge) a dimension table, call it TABLEA, with 100k updates. However when I create a materialized view log on TABLEA the merge statement hangs (I killed the query after leaving it to run for 8 hrs!). TABLEA has 11m records and has a number of indexes (bitmaps and btree) and constraints on it.
2. I then create a copy of TABLEA, call it TABLEB and re-created all the indexes and constraints that exist on TABLEA. I created a materialzied view log on TABLEB and ran the same update....the merge completed in under 5min!
The only difference between TABLEA and TABLEB is that the dimension TABLEA is referenced by a number of FACT tables (by FKs on the FACTS) however this surely should not cause a problem. I don't understand why the merge on TABLEA is not completing...even though it works fine on its copy TABLEB? I have tried rebuilding the indexes on TABLEA but this did not work.
Any help or ideas on this would be most appreciated.
Kind Regards
Mitesh
email: [email protected]
Thats what I thought, the MVL will only read data that has changed since it was created and wont have the option to load in all the data as though it was made before the table was created.
From what I have read, the MVL is quicker than a Trigger and I have some free code that prooved to work from a MVL using it as a reference to know what records to update. There is not that much to a MVL, a record ID and type of update, New, Update or Delete.
I think what I will have to do is work on a the same principle for the MVL but use a Trigger as this way we can do a full reload if required at any point.
Many thanks for your help.
Similar Messages
-
Creating a Materialized View Log After the Data has been instered
Hi,
I am trying to create a method of replication from Oracle to MySQL using the Materialized View Log table.
This has been done before and works quite well, the only problem is that I am trying to impliment the log after the table has been created and populated and wish to push all the existing data through the log file...
Does anyone know if it is possible to refresh the Materialized View Log and not a Materialized View.
The way the replication is intended to work is:
Oracle> Data inserted into table
Oracle> writes the vector data to the MVL
Script> Monitors the MVL and can see the changes being made to the Oracle Table
Script> Updates MySQL with the data and removes the rows from the MVL
MySQL is then used with other unix systems
Currently we export the data from the table using Triggers and a cronjob running every x minute to check for changes in the TriggerTables
Many thanks for your time on this, I have been checking for almost a whole working day and not found the answer to this problem.Thats what I thought, the MVL will only read data that has changed since it was created and wont have the option to load in all the data as though it was made before the table was created.
From what I have read, the MVL is quicker than a Trigger and I have some free code that prooved to work from a MVL using it as a reference to know what records to update. There is not that much to a MVL, a record ID and type of update, New, Update or Delete.
I think what I will have to do is work on a the same principle for the MVL but use a Trigger as this way we can do a full reload if required at any point.
Many thanks for your help. -
Creating Material Master IDoc when creating a Material
Hi Guys,
My requirement is to trigger an IDOC at the time when I am creating a material using MM01 transaction. The Changepointer is active and when i am tring to send materials using BD10 it's showing that the IDOC is created which certifies that the config is OK. but when I am creating a material and saving it ..the same process is not triggering an Idoc.
Can anyone help me out ...where I am missing out.
Thanks
Debasis Roy ChowdhuryHi Debasis,
Activating pointers for the message type do not trigger Idoc, we need to manually or scheduled the program to create the idoc against pointers.You need to run BD21 transaction or schedule RBDMIDOC .
Go through this [Idoc Triggers|Automatic Trigger of Idoc Sending to PI on Material Master Create/Change;.There is a good discussions.
Regards,
Madhu.
Edited by: madhurao123 on Feb 2, 2012 9:40 PM
Edited by: madhurao123 on Feb 2, 2012 9:43 PM -
Can't find the table when creating the form application
Hi there,
I have created a new table named lp_cschedule under a user named
lptrain in users tablespace.
I want to create a form application to view this table. However,
I can find this table in the list.
Don't understand why ? Any idea ?
Regards,
MaggiePerhabs, the application's owner does not have the previleges on
the table you have mentioned. Follows the citation of the Forms
(from tables or views) wizard help:
Tables, views, and synonyms in the application schema where you
have SELECT, INSERT, UPDATE, or DELETE privileges.
Tables, views, and synonyms where SELECT has been granted to
public users.
You automatically have SELECT, INSERT, UPDATE, or DELETE
privileges on a table or view if it is owned by an application
schema where you have Edit or higher access privileges.
You can check the owner (=schema) of the application from the
Navigator clicking on the Edit action link against your
application.
Regards,
Alexandre -
CREATE MATERIALIZED VIEW LOG ON / SNAPSHOT LOG ON
HI,
Is there any difference between create materialized view log on and creat snapshot on.
Did some googling, found out that: A snapshot log is a table associated with
the master table of a snapshot and Is used for refresh the master table\'s snapshots.
Materialized view log is a table associated with the master table of a materialized view. Seem like the same.
By the way, are these tables important? Will my database function as normal without these view log.
regards,
becksWhere did you pick up this syntax from ?
The MV Log that will be created on DOCUMENT will be called MLOG$_DOCUMENT.
So, the correct syntax is :
create materialized view log on DOCUMENT with primary key;this will create a "table" called MLOG$_DOCUMENT which serves as the Materialized View Log on the real table called DOCUMENT. This will allow you to create one or more Materialized Views based on DOCUMENT, which can be fast refreshed because of the presence of the MV Log. For example :
create materialized view MV_DOCUMENT refresh fast on demand as select DOC_ID, DOC_DATE from DOCUMENT;(i.e. assuming you want an MV that has only two columns from the table DOCUMENT.
Hemant K Chitale
http://hemantoracledba.blogspot.com -
Will Materialized view log reduces the performance of DML statements on the master table
Hi all,
I need to refresh a on demand fast refresh Materialized view in Oracle 11GR2. For this purpose I created a Materialized view log on the table (Non partitioned) in which records will be inserted @ rate of 5000/day as follows.
CREATE MATERIALIZED VIEW LOG ON NOTES NOLOGGING WITH PRIMARY KEY INCLUDING NEW VALUES;
This table already has 20L records and adding this Mview log will reduce the DML performance on the table ?
Please guide me on this.Having the base table maintain a materialised view log will have an impact on the speed of DML statements - they are doing extra work, which will take extra time. A more sensible question would be to ask whether it will have a significant impact, to which the answer is almost certainly "no".
5000 records inserted a day is nothing. Adding a view log to the heap really shouldn't cause any trouble at all - but ultimately only your own testing can establish that. -
Materialized view log update question
Hi, I am running into a question regarding mview - not sure if it should behave that way or I didn't use it right.
I have two base tables, sales and customers (drived from nested materialized view example in oracle doc):
CREATE TABLE sales
cust_ID VARCHAR2(32 BYTE) NOT NULL,
amount_sold NUMBER,
TEMP VARCHAR2(100 BYTE),
CONSTRAINT sales_pk PRIMARY KEY (cust_id)
CREATE TABLE customers
cust_ID VARCHAR2(32 BYTE) NOT NULL,
CUST_LAST_NAME VARCHAR2(100 BYTE),
TEMP VARCHAR2(100 BYTE),
CONSTRAINT cust_pk PRIMARY KEY (cust_id)
CREATE MATERIALIZED VIEW LOG ON sales
WITH ROWID (cust_id, amount_sold);
CREATE MATERIALIZED VIEW LOG ON customers
WITH ROWID (cust_id, cust_last_name);
Then I create a fast refresh materialized view based on them:
CREATE MATERIALIZED VIEW join_sales_cust
REFRESH FAST ON DEMAND AS
SELECT c.cust_id, c.cust_last_name, s.amount_sold, s.rowid srid, c.rowid crid
FROM sales s, customers c
WHERE s.cust_id = c.cust_id;
Since this materialized view only invole cust_id and amount_sold from sales and cust_id and last_name from customers table, I do not want to trigger materialized view log entry if the TEMP column value gets updated. So follow update shouldn't trigger mlog:
update sales set TEMP='TEMP2' where cust_id=1
but this update should:
update sales set amount_sold=3 where cust_id=1
What I am seeing happenning is any update on the base table will triger mlog entried regardless whether the column is involed in the materialized view or not.
Can someone please confirm if this is the correct behavior and whether there is a way to accomplish what I wanted to do?
Thank you!
Edited by: user3933488 on Jan 8, 2010 12:53 PMYou created the materialized view logs with some columns, which is not necessary when creating a join MV on top of them. You can happily skip those in your MV log definition. And then it becomes clear that those columns are not involved in the decision whether a MV log needs to be updated or not. Everything that happens to the base table gets recorded. The "WITH ROWID" and "INCLUDING NEW VALUES" and the column list only specify WHAT should be recorded when something changed.
Regards,
Rob. -
Truncate table and materialized view log
I user oracle 10 R2
I have a table and on that table a materialized view log.
I execute in a pl/sql procedure:
1) execute immediate('drop materialized view log on tab1');
then:
2) execute immediate('truncate table tab1');
3) Now I insert a lot of records in tab1
4) execute immediate('create materialized view log on tab1 WITH rowid INCLUDING NEW VALUES');
When I create the materialized view log I recieved this message:
ora32321: refresh fast on tab2 unsupported after detail table truncate
Why?Refresh fast after truncate operation on container table is not supported, regardless the container table is or is not partitioned.
Perform a refresh complete.
ORA-32321 :
Cause: A detail table has been truncated and no materialized view
supports fast refersh after a detail table has been truncated
Action: Use REFRESH COMPLETE. Note: you can determine why your
materialized view does not support fast refresh after TRUNCATE
using the DBMS_MVIEW.EXPLAIN_MV() API. -
How to CREATE MATERIALIZED VIEW LOG (MV fast refresh) with some JOINS
Hi @ all,
i'm trying to create a MATERIALIZED VIEW LOG for a fast refresh of a MATERIALIZED VIEW.
It works fine with a simple Request in the MATERIALIZED VIEW:
CREATE MATERIALIZED VIEW MV_ZOTD43_P
TABLESPACE GDII
BUILD IMMEDIATE
REFRESH FORCE AS
SELECT * FROM ZOTD43_P;
COMMIT;
CREATE MATERIALIZED VIEW LOG ON ZOTD43_P
TABLESPACE "GDII"
WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
call DBMS_MVIEW.REFRESH('MV_ZOTD43_P', 'f');
But when I use a complex SQL-Request with some JOINS (one of the Table with spatial Data) in the MATERIALIZED VIEW, I get an error:
CREATE MATERIALIZED VIEW MV_TEST
TABLESPACE GDII
BUILD IMMEDIATE
REFRESH FORCE AS
SELECT lptd04_p.sst_nr AS sst_nr,
lptd03_p.aaaa AS aaaa,
lptd04_geom.geom as geom
FROM lptd04_p lptd04_p
JOIN lptd01_p lptd01_p ON lptd01_p.cre_nr = lptd04_p.sst_nr
JOIN lptd04_geom ON lptd04_geom.sst_nr = lptd04_p.sst_nr
JOIN lptd03_p lptd03_p ON lptd03_p.lief_nr = lptd04_p.lief_nr;
COMMIT;
CREATE MATERIALIZED VIEW LOG ON LPTD04_P
TABLESPACE "GDII"
WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
call DBMS_MVIEW.REFRESH('MV_TEST', 'f');
Error report:
SQL Error: ORA-12004: REFRESH FAST kann für Materialized View "GDI"."MV_GDI_SST_STAMM" nicht benutzt werden
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2255
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2461
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2430
ORA-06512: in Zeile 1
12004. 00000 - "REFRESH FAST cannot be used for materialized view \"%s\".\"%s\""
*Cause: The materialized view log does not exist or cannot be used. PCT
refresh is also not enabled on the materialized view
*Action: Use just REFRESH, which will reinstantiate the entire table.
If a materialized view log exists and the form of the materialized
view allows the use of a materialized view log or PCT refresh is
possible after a given set of changes, REFRESH FAST will
be available starting the next time the materialized view is
refreshed.
Am I doing something wrong or is it not possible CREATE MATERIALIZED VIEW LOG when the MATERIALIZED VIEW got some JOINS?
Regards,
GreqThanks for the link Alessandro ,
the error seems something to do with the Column-Type SDO_GEOMETRY, so
i create a new thread in the Spatial Discussion forum:
FAST REFRESHing of Oracle Materialized Views containing SDO_GEOMETRY column
Regards,
Greq -
Identifying updated column in materialized view logs
Hi all,
I created a materialized view log for a table with three columns(say colA,colB,colC). Is there any way to identify which column got updated among these three columns? through the entries in mat view logs?
any inputs on this ll be of great help.
Thanks in advance.
gopiCan someone tell me about M_ROWS$$ column in Materialized view.
I am in confucion. -
Can't delete master record when matching when matching detail record exist
Hi
on the rel. property:
Delete Record Behaviour = cascading
Prevent masterless Operation =yes
Automatic Query = yesCan't delete Record Master & Detail...
On delete getting error msg.
Can't delete master record when matching when matching detail record exist
am i missing something...!
Regards,
Abdetu...First of all, remember the ripple affect of cascading deletes and updates.
Oracle database allows creating master/detail relationship between tables using foreign keys and allows cascading deletes by defining the FOREIGN KEY constraint with ON DELETE CASCADE clause.
Oracle Forms on the other hand, handle cascade delete thing internally when you set the relation properties.
Now if you have 3 tables with MASTER->DETAIL1->DETAIL2 relationship and you have a form defined with MASTER->DETAIL1 relationship only, it won't let you delete (and save) master or detail record since the third table (DETAIL2) is referencing the rows from DETAIL1 which you are trying to delete.
If DETAIL2 were present on the form, it would have deleted with relation property CASCADING. If you really want that when you delete a master record, all its details should be deleted too, then consider defining FOREIGN KEY constraints with ON DELETE CASCADE and on the form set relation property CASCADING.
And if all master/detail tables are on your form and still it is not allowing you to delete master with cascading, there must be some code preventing it. Check triggers like ON-DELETE, KEY-COMMIT etc what they are doing. -
Not Updating Customized Table when System having Performance Issue
Hi,
This is actually the same topic as "Not Updating Customized Table when System having Performance Issue" which is posted last December by Leonard Tan regarding the user exit EXIT_SAPLMBMB_001.
Recently we changed the program function module z_mm_save_hide_qty to update task. However this causes more data not updated. Hence we put back the old version (without the update task). But now it is not working as it used to be (e.g. version 1 - 10 records not updated, version 2 with update task - 20 records not updated, back to version 1 - 20 records not updated).
I tried debugging the program, however whenever I debugged, there is nothing wrong and the data is updated correctly.
Please advise if anyone has any idea why is this happening. Many thanks.
Regards,
JanetHi Janet,
you are right. This is a basic rule not to do any COMMIT or RFC calls in a user exit.
Have a look at SAP note 92550. Here they say that exit EXIT_SAPLMBMB_001 is called in the update routine MB_POST_DOCUMENT. And this routine is already called in UPDATE TASK from FUNCTION 'MB_UPDATE_TASKS' IN UPDATE TASK.
SAP also tells us not to do any updates on SAP system tables like MBEW, MARD, MSEG.
Before the exit is called, now they call 'MB_DOCUMENT_BADI' with methods MB_DOCUMENT_BEFORE_UPDATE and MB_DOCUMENT_UPDATE. Possibly you have more success implementing the BADI.
I don't know your situation and goal so this is all I can tell you now.
Good luck!
Regards,
Clemens -
How to add multiple table when creating add on using b1de
Hi all,
Plz help me
How to add multiple table when creating add on using b1de.
ThanksHi dns_sap,
Can you explain a little better what you are trying to accomplish? Is it to create UserTables and UserFields in the database, when the addon runs the first time?
If so, you can use the following code
Add User Table
Try
Dim lRetCode As Long
Dim oUDT As SAPbobsCOM.UserTablesMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
oUDT.TableName = TableName
oUDT.TableDescription = TableDescription
oUDT.TableType = TableType
lRetCode = oUDT.Add
'// Check for error when adding the Table: if lRetCode = 0 the table was created; if lRetCode = -2035 the table already exisits
If lRetCode <> 0 Then
oApplication.MessageBox("Error: " & lRetCode.ToString & ", " & oCompany.GetLastErrorDescription)
End If
Catch ex As Exception
oApplication.MessageBox(oCompany.GetLastErrorDescription)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDT)
oUDT = Nothing
lRetCode = Nothing
GC.Collect()
End Try
Add User Field
Try
Dim lRetCode As Long
Dim oUDF As SAPbobsCOM.UserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
oUDF.TableName = TableName
oUDF.Name = FieldName
oUDF.Description = FieldDescription
oUDF.Type = FieldType
lRetCode = oUDF.Add
'// Check for error when adding the field: if lRetCode = 0 the field was created; if lRetCode = -2035, the field already exists
If lRetCode <> 0 Then
oApplication.MessageBox("Error: " & oCompany.GetLastErrorCode & ", " & oCompany.GetLastErrorDescription)
End If
Catch ex As Exception
oApplication.MessageBox(oCompany.GetLastErrorDescription)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUDF)
oUDF = Nothing
lRetCode = Nothing
GC.Collect()
End Try
Regards,
Vítor Vieira -
How enter the values in to table when create entries option is not working
hi everyone,
can u please tell me How enter the values in to table when create entries option is not working.
it's urgent.
thanking u allHi Shree,
how many entries u want to insert ,,
is it a ztable or custom table ..
just tell me ur clear requirement ..
clarify the same ..
if no options avaliable then if its less entries or some value u can do it through debugging ..
if its bulk entries then u can write a program ..
just let me know ..
regards,
VIjay -
Change pointers are not generated when creating a material master
Dear Experts,
Change pointers are not generated when creating a material master.
However, when a change is made to the already created material, the change pointers are created according the fields in BD52.
Am I missing any settings?
I need to create change pointers immediately when I create the material master in MM01.
Please suggest.
Regards,
Shettydid you follow the steps given in
http://help.sap.com/saphelp_nw73/helpdata/en/4a/6dcbe9c95261a3e10000000a421937/frameset.htm
Maybe you are looking for
-
Hard drive failure⦠3 1 TB drives dead?
I have had three 1 TB drives fail after very little use. The first two drives were Western Digital Green 1 TB drives. Best Buy was overstocked and selling the Mac version of its USB Western Digital drives. I took the drives out of the cases and I
-
Archive/source files for web CMS
I produce video for a pair of websites, and am in the process of implementing a web video CMS (thePlatform). I am having some trouble choosing a good source format for my material as I have the following requirements: -files smalls enough to upload t
-
Accordion widget not pushing content out of way
Hi, Following a Lynda.com tutorial I added a menu to an accordion widget while designing a mobile site. Expanding the accordion is supposed to push the page's content downwards but it is simply unfurling over it. Does anybody have any idea what mig
-
Syncing problem between iphone and two computers. Transfer speed issue.
An issue that I've recently started having problems with is syncing my contacts and calendar into two computers and my iphone. I've recently pickup up a new macbook pro to use when out of the office but my mac at work is still my main computer. The p
-
New Camera Raw version released
Adds support for the following cameras: Fujifilm X-E2 Fujifilm X-T1 Nikon D3300 Nikon 1 AW1 Panasonic LUMIX DMC-GM1 Pentax K-3 It requires OS 10.8.5, 10.9 or later plus iPhoto 11 and Aperture 3. As always, before installing anything, back up. Also, i