Materialized view logs in cloned database

Hi all!
We have materlialized views and materlialized view logs in two separate databases which are connected with a database link. The MV logs are in DB1_PROD, which is the database being cloned. The database link goes from DB2_PROD (where the MVs are located) to DB1_PROD:
DB2_PROD (materialized views) ----DB link---> DB1_PROD (materialized view logs)
When cloning DB1_PROD to DB3_DEV, the MV logs still have a reference to DB2_PROD. However, there is no connection between DB3_DEV and DB2_PROD.
In my opinion this is not harmful, but I would like to know if any of you can see any problems with this.
In summary;
DB1_PROD: Materialized view logs
DB3_DEV: Materialized view logs. Clone of DB1_PROD
DB2_PROD: Materialized views.
DB1_PROD and DB3_DEV:
select * from v$version;
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE     10.2.0.4.0     Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
DB2_PROD:
select * from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE     11.2.0.3.0     Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - ProductionPlease let me know if you need further information.

Oracle automatically purges rows in the materialized view log when they are no longer needed. Because Oracle must wait for all dependent materialized views to refresh before purging rows from a materialized view log, unwanted situations can occur that cause a materialized view log to grow indefinitely when multiple materialized views are based on the same master table or master materialized view.
For example, such situations can occur when more than one materialized view is based on a master table or master materialized view and one of the following conditions is true:
Materialized view is not configured for automatic refreshes and has not been manually refreshed for a long time. OR
Materialized view has an infrequent refresh interval, such as every year, etc
You can also refresh the materialized views associated with the log so that Oracle can purge rows from the materialized view log.
If a materialized view log needs to be purged manually for some reason a procedure called DBMS_MVEW.PURGE_LOG can be used.
Edited by: user130038 on Sep 30, 2011 6:49 AM

Similar Messages

  • How to create materialized view log on remote database

    How do you create materialized view logs on a remote database.
    I tried
    create materialized view log on global_express_views.vccs438_project_work_request@h92edwp with sequence, rowid ( columns...)
    ERROR at line 1:
    ora-00949 illegal reference to remote database

    Hi,
    I am not getting the error exactly. But have some suggestion:
    If the schema owner does not own the master tables, then the schema owner must have the GLOBAL QUERY REWRITE privilege or the QUERY REWRITE object privilege on each table outside the schema.
    Hope, this may help you?
    Thanx.. Ratan

  • How manage materialized view, materialized view logs and db links in Server explorer and Oracle Database Proyect

    Hi,
    We have installed Oracle 12c Oracle Developer Tools for Visual Studio (Visual Studio is 2010 edition). With this tool we can manage tables, views, etc... but we also need to manage more database objects such as materialized views, materialized view logs and db links.
    Is there any option to manage this object from Server Explorer and to add the script in the Database Project? At the same time, the schema compare tools does not include this object types. Is there any option to compare them?
    Thanks.

    As you noticed, not all database objects are available in Server Explorer, and because of this they can't have scripts generated for them, nor can they be compared with Schema Compare.
    In a pinch, you should be able to use SQL Developer to do this.

  • 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.

  • ORA-12096: error in materialized view log

    Hi All,
    I had created a fast refresh materialized view. Log was also created.
    Now i dropped the mv and the logs.
    But now every time i update or insert into this customer table i get error message.
    ORA-12096: error in materialized view log on Customer
    ORA-00942: table or view does not exist
    There are entries in the DBA_MVIEW_LOGS for customer table.
    Please suggest.

    Hi,
    What database version are you on?
    And do you have access to Metalink/My Oracle Support?
    Found this, by the way:
    ORA-12096: error in materialized view log on <table>
    If problems occur when you try to access a log file for a materialized view, the system issues an ORA-12096 error message which is followed by the actual error. If the ORA-12096 error message is accompanied by an ORA-00942 message, the problem may be due to an online reorganization that was only partially undone. In this case, you can drop the log file for the materialized view manually (after you have verified that it is no longer required):
    DROP MATERIALIZED VIEW LOG ON <table>;
    Edited by: hoek on Jul 29, 2009 2:15 PM

  • ORA-12096: error in materialized view log on ORA-01301:insufficient privile

    Hi,
    One of our ebusiness Apps 11510 instances has database that was
    upgraded from 9.2.0.6 to 10.2.0.4 with Database Vault.
    After that, we are getting an error:
    ORA-12096: error in materialized view log on "SCHEMA"."TABLE_NAME" ORA-01301:insufficient privileges
    Can you please let know what can be the reason. Which user is being checked for the privileges?
    Regards

    I am facing the same issue in one of our internal instances.
    Apps Environment has been upgraded from Database 9.2.0.6 to Database 10.2.0.4 with Database Vault. We started facing this issue and the same error after the upgrade. MLOG definition has not changed.
    What privilege is it expecting to be present for the schema.
    The definition of the MLOG is as given below
    LOG_TRIGGER = NULL
    ROWIDS = YES
    PRIMARY_KEY = NO
    OBJECT_ID = NO
    FILTER_COLUMNS = NO
    SEQUENCE = NO
    INCLUDE_NEW_VALUES = NO

  • Is it possible to create materialized view log file for force refresh

    Is it possible to create materialized view log file for force refresh with join condition.
    Say for example:
    CREATE MATERIALIZED VIEW VU1
    REFRESH FORCE
    ON DEMAND
    AS
    SELECT e.employee_id, d.department_id from emp e and departments d
    where e.department_id = d.department_id;
    how can we create log file using 2 tables?
    Also am copying M.View result to new table. Is it possible to have the same values into the new table once the m.view get refreshed?

    You cannot create a record as a materialized view within the Application Designer.
    But there is workaround.
    Create the record as a table within the Application Designer. Don't build it.
    Inside your database, create the materialized with same name and columns as the record created previously.
    After that, you'll be able to work on that record as for all other within the Peoplesoft tools.
    But keep in mind do never build that object, that'll drop your materialized view and create a table instead.
    Same problem exists for partitioned tables, for function based-indexes and some other objects database vendor dependant. Same workaround is used.
    Nicolas.

  • Disabling Materialized View Logs for a session

    Hi all.
    I was wondering if it is possible to disable the fast refresh log for materialized views for just a given session. So for all other sessions except this one the log would be added to. I'm using 11g.
    In Oracle Database 11g, The Complete Reference on page 447 it states:
    "As of Oracle 11g, the capture of changes in materialized view logs can be disabled for an individual session while logging continues for changes made by other sessions". But no instructions are given
    Does anyone know how to do this? I have not been able to find the answer by looking around.
    Thanks!

    Yeah, I had saw that Oracle mentioned it here also: http://download.oracle.com/docs/cd/B28359_01/server.111/b28279/chapter1.htm#FEATURENO07197
    Any idea of what the code might look like? I've never had to alter an individual session for Oracle before.

  • Materialized view logs pretty huge!

    Hi,
    I have a table MLOG$_XXXXX, which i guess is a materialized view log table. It is huge in size (80GB) and is growing at a very alarming rate.
    Could someone please help me to reduce the size of this table?
    How do I find out which materialized view is causing this table to grow? Is there any query through which I can find this out?
    The database is of version 10204 and is running on HP Unix (B.11.11).
    Thanks!

    The materialized views in the database are:
    SQL> select mview_name, owner, updatable, refresh_mode, last_refresh_date from dba_mviews;
    MVIEW_NAME                     OWNER      U REFRESH_MODE    LAST_REFRESH_DATE
    MV_EXCH_RT                     SYS        N COMMIT          03 JUN 2010 12:02:59
    ADMIN_MGMT_CO                  JJORA      N DEMAND          06 JUL 2010 01:37:39
    REG                            JJORA      N DEMAND          06 JUL 2010 01:37:39
    CNTRY                          JJORA      N DEMAND          06 JUL 2010 01:37:39
    OPER_GRP                       JJORA      N DEMAND          06 JUL 2010 01:37:39
    ADMIN_CO                       JJORA      N DEMAND          06 JUL 2010 01:37:39
    MV_JJGL_SUB_CD_141P            JJGL       N DEMAND          06 JUL 2010 01:24:43
    7 rows selected.The table which grows at an alarming rate is:
    SQL> select sum(bytes)/1024/1024/1024 from dba_segments where segment_name like 'MLOG$_XXXXX%';
    SUM(BYTES)/1024/1024/1024
                   77.8789063Now how do I find out, which materilized view is causing this table to grow? Can someone please provide me the query?
    Thanks!
    Edited by: user9104898 on Jul 6, 2010 8:11 AM

  • Materialized view logs issue

    We are having issues with the size of materialized view logs in one od the database. The size of the log table is around 32G. Will appreciate if somebody will help in explaining why it is having such a huge size and is not getting purged.
    At the same time the master table is having comparatively smaller size of 18G(did not check table fragmentation).
    Also, please help me in understanding what is required to be done for fixing this issue.
    SQL> select LOG_OWNER,MASTER,LOG_TABLE,LOG_TRIGGER,PRIMARY_KEY from dba_mview_logs where log_owner='MARTDATA' and MASTER='POLICY_CONFIGURATION';
    LOG_OWNER MASTER LOG_TABLE LOG_TRIGGER PRI
    MARTDATA POLICY_CONFIGURATION MLOG$_POLICY_CONFIGURATION NO
    SQL> select owner, segment_name, sum(bytes)/1024/1024 "SIZE in MB" from dba_segments where segment_name='POLICY_CONFIGURATION' and owner ='MARTDATA' group by owner, segment_name;
    OWNER SEGMENT_NAME SIZE in MB
    MARTDATA POLICY_CONFIGURATION 18458
    SQL> select owner, segment_name, sum(bytes)/1024/1024 "SIZE in MB" from dba_segments where segment_name='MLOG$_POLICY_CONFIGURATION' and owner ='MARTDATA' group by owner, segment_name;
    OWNER SEGMENT_NAME SIZE in MB
    MARTDATA MLOG$_POLICY_CONFIGURATION 32298
    Thanks

    Oracle automatically purges rows in the materialized view log when they are no longer needed. Because Oracle must wait for all dependent materialized views to refresh before purging rows from a materialized view log, unwanted situations can occur that cause a materialized view log to grow indefinitely when multiple materialized views are based on the same master table or master materialized view.
    For example, such situations can occur when more than one materialized view is based on a master table or master materialized view and one of the following conditions is true:
    Materialized view is not configured for automatic refreshes and has not been manually refreshed for a long time. OR
    Materialized view has an infrequent refresh interval, such as every year, etc
    You can also refresh the materialized views associated with the log so that Oracle can purge rows from the materialized view log.
    If a materialized view log needs to be purged manually for some reason a procedure called DBMS_MVEW.PURGE_LOG can be used.
    Edited by: user130038 on Sep 30, 2011 6:49 AM

  • Materialized View Logs Query

    Hi All,
    I had some problem with my Materialized views, that's why Dropped all of the Logs + Materialized Views from my Production Database. Kindly tell me that, Is there any Query, which I can run and make Materialized View Logs from my Existing Tables . Thanks
    Regards,
    Imran

    Incremental Materialized View creation steps
    Hi,
    Find the below steps to create MV's with logs.
    1.     Materialized view log creation at master.
    2.     DB link creation at MV site to master site.
    3.     Materialized view creation at MV site.
    4.     Refresh the MV.
    Materialized view log creation at master.
    SQLPLUS <USER_MASTER_SITE>/<PASSWORD>@<MASTER_SITE>
    CREATE MATERIALIZED VIEW LOG ON <TABLE_NAME>;
    DB link creation at MV site.
    SQLPLUS <USER_MV_SITE>/<PASSWORD>@<MV_SITE>
    CREATE Database Link <MASTER_SITE> Connect To <USER_MASTER_SITE> Identified By <PASSWORD> Using ‘<tnsnames>’
    Materialized view creation at MV site.
    SQLPLUS <USER_MV_SITE>/<PASSWORD>@<MV_SITE>
    CREATE MATERIALIZED VIEW <TABLE_NAME> BUILD
    IMMEDIATE REFRESH FAST ON DEMAND
    ENABLE QUERY REWRITE
    AS SELECT * FROM <TABLE_NAME>@<MASTER_SITE> REFRESH ;
    Refresh the MV.
    SQLPLUS <USER_MV_SITE>/<PASSWORD>@<MV_SITE>
    Execute DBMS_SNAPSHOT.REFRESH( '<TABLE_NAME>','f');
    Regards,
    Prasanna

  • SELECT PRIVILEGES required on Materialized View Logs

    Hi,
    I have a scenario where in Base table exists in one database and Materialized View on other.
    The Materialized View is created with FAST REFRESH option.
    I have created Materialized View Log in database where master table exists.
    Also I have given Select priv on master table to the user(where MV is created).
    I want to know how will i Grant SELECT PRIV on Materialized View Log so that FAST refresh happens.
    Both databases are Oracle 10g R2.
    I have read following on oracle site:
    The owner of the materialized view must have the CREATE TABLE system privilege. The owner must also have access to any master tables of the materialized view that the schema owner does not own (for example, if the master tables are on a remote database) and to any materialized view logs defined on those master tables, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.
    Please tell me the command to GRANT SELECT to the user who has created MV.
    Thank You,
    Niranjan.

    Hi,
    The privileges required to create a materialized view should be granted directly rather than through a role
    To create a materialized view in your own schema:
    1- Grant CREATE MATERIALIZED VIEW system privilege and either the CREATE TABLE or CREATE ANY TABLE system privilege.
    2-You must also have access to any master tables of the materialized view that you do not own, either through a SELECT object privilege on each of the tables or through the SELECT ANY
    TABLE system privilege.
    To create a materialized view in another user's schema:
    1-You must have the CREATE ANY MATERIALIZED VIEW system privilege.
    2-The owner of the materialized view must have the CREATE TABLE system privilege. The owner must also have access to any master tables of the materialized view that the schema owner does not own (for example, if the master tables are on a remote database) and to any materialized view logs defined on those master tables, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.
    To create a refresh-on-commit materialized view (ON COMMIT REFRESH clause), in addition to the preceding privileges, you must have the ON COMMIT REFRESH object privilege on any master tables that you do not own or you must have the ON COMMIT REFRESH system privilege.
    see this link
    http://download.oracle.com/docs/cd/B12037_01/server.101/b10759/statements_6002.htm

  • Error creating materialized view log using DBlink

    Hi guys,
    I have 2 databases in diferent machines . (machine A and B)
    Machine A is my production database and I have a database link in machine B accessing Machine A
    CREATE MATERIALIZED VIEW vm_test
    BUILD IMMEDIATE
    REFRESH FAST ON commit as
    select * from test@A
    -- no problem in this first operation the materialized view was created sucessfully
    Now I need to create the LOG
    SQL> CREATE MATERIALIZED VIEW LOG ON test
    2 PCTFREE 5
    3 TABLESPACE prodemge_2006
    4 STORAGE (INITIAL 10K NEXT 10K);
    CREATE MATERIALIZED VIEW LOG ON test
    ERROR at line 1:
    ORA-02050: transaction 5.21.8771 rolled back, some remote DBs may be in-doubt
    ORA-02068: following severe error from A
    ORA-03113: end-of-file on communication channel
    What could be causing this error ?
    Thank you,
    Felipe

    ORA-02050 transaction string rolled back, some remote DBs may be in-doubt
    Cause: Network or remote failure during a two-phase commit.
    Action: Notify operations; remote databases will automatically re-sync when the failure is repaired.
    ORA-02068 following severe error from stringstring
    Cause: A severe error (disconnect, fatal Oracle error) was received from the indicated database link. See following error text.
    Action: Contact the remote system administrator.
    M.S.Taj

  • 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,
    becks

    Where 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

  • Materialized View Log Error

    I keep getting a materialized view log error on a table that is not a master table, in fact there are no materialized views created on any tables in this database. The schema was imported from another but the export schema did not have any materialized views either from what I can see.
    Is there a data dictionary or something I can check?
    This is the error: ORA-12096: error in materialized view log on "Schema"."Table".
    ORA-00942: table or view does not exist
    I get this error anytime I try to update or insert.
    Apparently it thinks it should be associated to a materialized view log, how can I disassociate it?
    Thanks

    Hey Justin, thanks for your reply. I did not use the real table names but the original error message did.
    There was a log when I queried the view. I dont know why there was one. We never created any materialized views in or from this database.
    I dropped the log. It took it out of the data dictionary so everything works again.
    Thanks for your reply.

Maybe you are looking for

  • How can I find the serial number for my stolen iPad that's associated with my apple ID ?

    How can I find the serial number for my stolen iPad that's associated with my apple ID ?

  • Macbook Pro and WEP problem

    Hello guys, Ive been looking for a solution to this problem for a long time. I have seen various variations of my problem but nothing exactly the same. But still I appologise in advance if this has already been covered. Basically I bought a MacBook P

  • Back Ground programs

    Dear All, i want all PP related Programs which will be run in Background for various Purposes in SM36/SM37 example background  MRP, back ground Prodction orders relese , back ground production order delete etc .... Regards Madhu Kumar

  • Nokia recovery tool install problem

    i want to reinstall the 8.71 version of my nokia c3-00, so i need to install the 'nokia sofyware recovery tool' app. i downloaded the latest version 5.0.0 on my pc, but when i want to install it, it takes a so much long time on a same point, it seems

  • Individual inventory is failing

    Hello, When running the daily inventory as usual everything is working fine. When I try to run the inventory manually through the Action > Hardware Inventory I am getting an error in the Application Log: Event Type: Error Event Source: SmsAdminUI Eve