DDL of Materialized view

Hi all

I want to check the script or the DDlL of Materialized view.
whts the statement? Help, please.


Thanks in advance.

Only.ashish99 wrote:
People here are only to acquire knowledge, I think. don't want spread.
56 people checked this request, but do not want to answer because there seems to be little.

but it's an important thing for a beginner, we could get.

I understand the 56 people checked this query. But have you tried what I posted? If Yes, what was the error? If not or do not want to try why ask this question?
Second thing, you can be newbie but does google or the document does not have you helped with what means ORA-00904 means.

Let me try if I can make you understand or not.
ORA-00904 means identifier valid, in other words, you used the object name is not valid or is not recognized by the current session of the Oracle.
This means that the object do not exist or you don't have privilege on this object.

Do

desc dbms_metadata

if above does not work
grant execute on dbms_metadata to      --This should be done with sys login

Concerning

Tags: Database

Similar Questions

  • Materialized view DDL

    I try to get the DDL for all materialized views in the database.
    I am using under sql, but somehow, it does not understand it and gives me errors as follows:

    SELECT DBMS_METADATA. GET_DDL ('MATERIALIZED VIEW', 'MV_NAME'), FROM DBA_OBJECTS;
    or
    SELECT dbms_metadata.get_ddl (OBJECT_TYPE, OBJECT_NAME, OWNER) IN DBA_OBJECTS
    WHERE
    OBJECT_TYPE AS "MATERIALIZED VIEW.

    Gives me error like below:
    ERROR:
    ORA-31600: entry invalid value MATERIALIZED VIEW for the OBJECT_TYPE parameter in GET_DDL function
    ORA-06512: at "SYS." Dbms_metadata", line 2682
    ORA-06512: at "SYS." Dbms_metadata", line 2733
    ORA-06512: at "SYS." Dbms_metadata", line 4333
    ORA-06512: at line 1

    Is there anyway I can get DDL for all the materialized view... ?
    Anyhelp is appreciated.
    JP

    Hi, the valid object types do not have spaces, according to [this table | http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_metada.htm#BGBIEDIA].

    Try this:

    SELECT owner, object_name, object_type, dbms_metadata.get_ddl(replace(OBJECT_TYPE, ' ', '_'), OBJECT_NAME,OWNER)
      FROM DBA_OBJECTS
     WHERE OBJECT_TYPE = 'MATERIALIZED VIEW'
    

    I didn't really take a broad look to check on each type of object, but this should work for at least materialized views. If this does work for other specific types you want, you may need to use decode or an expression box.

  • extracting data from the CLOB using materialized views

    Hello

    We have xml data from clob which I have a requirement to extract (~ 50 attributes) on a daily basis, so we decided to use materialized views with refreshes full (open good suggestions)

    A small snippet of code

    CREATE THE MWMRPT MATERIALIZED VIEW. TASK_INBOUND

    IMMEDIATE CONSTRUCTION

    FULL REFRESH ON DEMAND

    WITH ROWID

    AS

    SELECT M.TASK_ID, M.BO_STATUS_CD, b.*

    OF CISADM. M1_TASK m,

    XMLTABLE (' / a ' XMLPARSE PASSING ())

    CONTENT '< a > | M.BO_DATA_AREA | "< /a >."

    ) COLUMNS

    serviceDeliverySiteId varchar2 (15) PATH

    "cmPCGeneralInfo/serviceDeliverySiteId"

    serviceSequenceId varchar2 (3) PATH "cmPCGeneralInfo/serviceSequenceId"

    completedByAssignmentId varchar2 (50) PATH "completedByAssignmentId."

    Cust_id varchar2 (10) PATH "cmPCCustomerInformation/customerId,"

    ACCT_SEQ varchar2 (5) PATH "customerInformation/accountId"

    AGRMT_SEQ varchar2 (5) PATH cmPCCustomerAgreement/agreementId"."

    COLL_SEQ varchar2 (5) PATH "cmPCGeneralInfo/accountCollectionSeq"

    REVENUE_CLASS varchar2 (10) PATH "cmPCCustomerAgreement/revenueClassCode"

    REQUESTED_BY varchar2 (50) PATH ' attributes customerInformation/contactName',...~50

    This ddl ran > 20 hours and no materialized view created. There are certain limits that we have

    • Cannot create a materialized view log
    • cannot change the source as its defined provider table
    • cannot do an ETL

    DB is 11g R2

    Any ideas/suggestions are very much appreciated

    I explored a similar approach, using the following test case.

    It creates a table "MASTER_TABLE" containing 20,000 lines and a CLOB containing an XML fragment like this:

    09HOLVUF3T6VX5QUN8UBV9BRW3FHRB9JFO4TSV79R6J87QWVGN

    UUL47WDW6C63YIIBOP1X4FEEJ2Z7NCR9BDFHGSLA5YZ5SAH8Y8

    O1BU1EXLBU945HQLLFB3LUO03XPWMHBN8Y7SO8YRCQXRSWKKL4

    ...

    1HT88050QIGOPGUHGS9RKK54YP7W6OOI6NXVM107GM47R5LUNC

    9FJ1JZ615EOUIX6EKBIVOWFDYCPQZM2HBQQ8HDP3ABVJ5N1OJA

    then an intermediate table "MASTER_TABLE_XML" with the same columns with the exception of the CLOB which turns into XMLType and finally a MVIEW:

    SQL > create table master_table like

    2. Select level as id

    3, cast ('ROW' | to_char (Level) as varchar2 (30)) as the name

    4       , (

    5. Select xmlserialize (content

    XMLAGG 6)

    7 xmlelement (evalname ('ThisIsElement' | to_char (Level)), dbms_random.string ('X', 50))

    8                    )

    9 as clob dash

    10                  )

    11 double

    12 connect by level<=>

    (13) as xmlcontent

    14 double

    15 connect by level<= 20000="">

    Table created.

    SQL > call dbms_stats.gather_table_stats (user, 'MASTER_TABLE');

    Calls made.

    SQL > create table (master_table_xml)

    Identification number 2

    3, name varchar2 (30)

    4, xmlcontent xmltype

    5)

    binary xmltype 6 securefile XML column xmlcontent store

    7;

    Table created.

    SQL > create materialized view master_table_mv

    2 build postponed

    full 3 Refresh on demand

    4, as

    5. Select t.id

    6, t.nom

    7       , x.*

    master_table_xml 8 t

    9, xmltable ('/ r' in passing t.xmlcontent)

    10 columns

    11 path of varchar2 (50) ThisIsElement1 'ThisIsElement1 '.

    12, path of varchar2 (50) ThisIsElement2 'ThisIsElement2 '.

    13, path of varchar2 (50) ThisIsElement3 'ThisIsElement3 '.

    14, path of varchar2 (50) ThisIsElement4 'ThisIsElement4 '.

    15 road of varchar2 (50) ThisIsElement5 'ThisIsElement5 '.

    16, road of varchar2 (50) ThisIsElement6 'ThisIsElement6 '.

    17 road of varchar2 (50) ThisIsElement7 'ThisIsElement7 '.

    18 road of varchar2 (50) ThisIsElement8 'ThisIsElement8 '.

    19 road to varchar2 (50) ThisIsElement9 'ThisIsElement9 '.

    20, path of varchar2 (50) ThisIsElement10 'ThisIsElement10 '.

    21, road to varchar2 (50) ThisIsElement11 'ThisIsElement11 '.

    22 road of varchar2 (50) ThisIsElement12 'ThisIsElement12 '.

    23 road of varchar2 (50) ThisIsElement13 'ThisIsElement13 '.

    24, path of varchar2 (50) ThisIsElement14 'ThisIsElement14 '.

    25 road of varchar2 (50) ThisIsElement15 'ThisIsElement15 '.

    26, path of varchar2 (50) ThisIsElement16 'ThisIsElement16 '.

    27, way to varchar2 (50) ThisIsElement17 'ThisIsElement17 '.

    28 road of varchar2 (50) ThisIsElement18 'ThisIsElement18 '.

    29 road of varchar2 (50) ThisIsElement19 'ThisIsElement19 '.

    30, path of varchar2 (50) ThisIsElement20 'ThisIsElement20 '.

    31, path of varchar2 (50) ThisIsElement21 'ThisIsElement21 '.

    32 road of varchar2 (50) ThisIsElement22 'ThisIsElement22 '.

    33, path of varchar2 (50) ThisIsElement23 'ThisIsElement23 '.

    34 road of varchar2 (50) ThisIsElement24 'ThisIsElement24 '.

    35 road of varchar2 (50) ThisIsElement25 'ThisIsElement25 '.

    36, road to varchar2 (50) ThisIsElement26 'ThisIsElement26 '.

    37, path of varchar2 (50) ThisIsElement27 'ThisIsElement27 '.

    38, path of varchar2 (50) ThisIsElement28 'ThisIsElement28 '.

    39, path of varchar2 (50) ThisIsElement29 'ThisIsElement29 '.

    40, road of varchar2 (50) ThisIsElement30 'ThisIsElement30 '.

    41 road of varchar2 (50) ThisIsElement31 'ThisIsElement31 '.

    42, path of varchar2 (50) ThisIsElement32 'ThisIsElement32 '.

    43, road to varchar2 (50) ThisIsElement33 'ThisIsElement33 '.

    44, path of varchar2 (50) ThisIsElement34 'ThisIsElement34 '.

    45, path of varchar2 (50) ThisIsElement35 'ThisIsElement35 '.

    46, path of varchar2 (50) ThisIsElement36 'ThisIsElement36 '.

    47, path of varchar2 (50) ThisIsElement37 'ThisIsElement37 '.

    48, path of varchar2 (50) ThisIsElement38 'ThisIsElement38 '.

    49, path of varchar2 (50) ThisIsElement39 'ThisIsElement39 '.

    50 road of varchar2 (50) ThisIsElement40 'ThisIsElement40 '.

    51, path of varchar2 (50) ThisIsElement41 'ThisIsElement41 '.

    52, path of varchar2 (50) ThisIsElement42 'ThisIsElement42 '.

    53, path of varchar2 (50) ThisIsElement43 'ThisIsElement43 '.

    54, path of varchar2 (50) ThisIsElement44 'ThisIsElement44 '.

    55 road of varchar2 (50) ThisIsElement45 'ThisIsElement45 '.

    56, path of varchar2 (50) ThisIsElement46 'ThisIsElement46 '.

    57, path of varchar2 (50) ThisIsElement47 'ThisIsElement47 '.

    58 road of varchar2 (50) ThisIsElement48 'ThisIsElement48 '.

    59 road of varchar2 (50) ThisIsElement49 'ThisIsElement49 '.

    60 road of varchar2 (50) ThisIsElement50 'ThisIsElement50 '.

    (61) x;

    Materialized view created.

    The discount is then performed in two steps:

    1. INSERT INTO master_table_xml
    2. Refresh the MVIEW

    (Note: as we insert in an XMLType column, we need an XML (only root) document this time)

    SQL > set timing on

    SQL >

    SQL > truncate table master_table_xml;

    Table truncated.

    Elapsed time: 00:00:00.27

    SQL >

    SQL > insert into master_table_xml

    2. select id

    3, name

    4, xmlparse (document '' |) XmlContent |'')

    5 master_table;

    20000 rows created.

    Elapsed time: 00:04:38.72

    SQL >

    SQL > call dbms_mview.refresh ('MASTER_TABLE_MV');

    Calls made.

    Elapsed time: 00:00:22.42

    SQL >

    SQL > select count (*) in the master_table_mv;

    COUNT (*)

    ----------

    20000

    Elapsed time: 00:00:01.38

    SQL > truncate table master_table_xml;

    Table truncated.

    Elapsed time: 00:00:00.41

  • Parameter DBMS_METADATA. GET_DDL out of materialized views

    Hi all.
    My version of Oracle's 10g.

    I am extracting DDL for all database objects using the DBMS_METADATA package. I use SET_TRANSFORM_PARAM to configure the output because I need a sql code simple, without information about the attributes of storage spaces, storage and segment. Everything works well except when I work with mviews object types. I can't remove the information about the attributes of the tablespace, storage or segment for materialized views.

    I would like to know if there is a problem related to this topic. Or there is something missing in my code?

    I tried to specify the type of object such as another parameter on DBMS_METADATA. SET_TRANSFORM_PARAM but not work too.
    The only parameter transform that works very well with materialized views is the SQLTERMINATOR.

    ------
    See how I did:

    declare
    CLOB vDDL;
    Start
    DBMS_METADATA.SET_TRANSFORM_PARAM (DBMS_METADATA. SESSION_TRANSFORM 'STORAGE', FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM (DBMS_METADATA. SESSION_TRANSFORM, 'TABLESPACE', FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM (DBMS_METADATA. SESSION_TRANSFORM, "SEGMENT_ATTRIBUTES", FALSE);
    DBMS_METADATA.SET_TRANSFORM_PARAM (DBMS_METADATA. SESSION_TRANSFORM 'SQLTERMINATOR', TRUE);

    Select dbms_metadata.get_ddl ('MATERIALIZED_VIEW', 'MV_STO020', 'HIS117_CHECK') in vDDL FROM DUAL;
    dbms_output.put_line (vDDL);
    end;
    -------
    and how the output is:

    CREATE A MATERIALIZED VIEW 'HIS117_CHECK '. "" MV_STO020 ".
    PCTFREE 10 BUNCH OF ORGANIZATION PCTUSED 40 INITRANS MAXTRANS 255 NOCOMPRESS LOGGING 1
    STORAGE (INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645)
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 DEFAULT USER_TABLES)
    TABLESPACE "TS_HIS117".
    IMMEDIATE CONSTRUCTION
    USING INDEX
    REFRESH THE STRENGTH TO DEMAND
    WITH A KEY PRIMARY WITH THE HELP OF DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE THE QUERY REWRITING
    IN SELECT
    STO020_MOVEMENT_LOG_ID STO020_MOVEMENT_LOG_ID
    STO020_QUANTITY STO020_QUANTITY
    STO020_DATE STO020_DATE
    STO020_BEFORE_BALANCE STO020_BEFORE_BALANCE
    STO011_PRODUCT_MOVEMENT_ID STO011_PRODUCT_MOVEMENT_ID
    ADM082_PRODUCT_ID ADM082_PRODUCT_ID
    ADM089_PRODUCT_PRESENTATION_ID ADM089_PRODUCT_PRESENTATION_ID
    STO010_MOVEMENT_TYPE_ID STO010_MOVEMENT_TYPE_ID
    STO001_STOCK_ID STO001_STOCK_ID
    STO001_TARGET_STOCK_ID STO001_TARGET_STOCK_ID
    STO003_PRODUCT_LOT_ID STO003_PRODUCT_LOT_ID
    SYS010_USER_ID SYS010_USER_ID
    EIR001_MPI EIR001_MPI
    ADM056_MEDICAL_ATTENTION_ID ADM056_MEDICAL_ATTENTION_ID
    ADM094_USE_UNIT_ID ADM094_USE_UNIT_ID
    Of
    STO020_MOVEMENT_LOG;

    Thank you in advance!

    Published by: lucporto on 08/28/2012 07:26

    The LONG data type conversion is explained on http://asktom.oracle.com if you use the search feature.
    I could not find real pointers to your original question it.

  • How to stop refreshing materialized views if the source table is null

    any ideas?

    Probably not what you were hoping for, but here's a few ideas.

    Your account shows - 113 (85 pending)
    1. How about helping to keep the forum clean by examining your 85 not resolved previous issues and give credit relatively USEFUL or RESPONDED to those who helped you in the past.

    2. read the FAQ at the top right of the page and view information about your system and your software so that we know what you're working with.

    3 ask your question in the body of the thread. Don't tell "of ideas.

    What is your question? Is this an academic question or you have a real problem that needs to be addressed?

    If you have a problem producing the DDL for the materialized view, and information about the type of discount that has been set up for this. Is there a newspaper view materialized on the underlying tables?

    The simple answer to your quest is to use UPDATE them on REQUEST and check the base tables before making a manual
    a: the best answer depends on what version of Oracle you are using and what is your actual configuration. Are your
    MVs in REFRESH GROUPS? Who can make a difference in the response.

    How can anyone help with this issue if you do not provide the information needed (FAQ)? Why is - someone MUST help if you show you don't appreciate help in marking questions to which answered once you have helped.

  • Moving all the newspapers and Materialized View at the schema level using the data pump in

    Hi Experts,

    Please help me on how I can exp/imp all materialized views andMV logs (as are some MVs) only the full scheme of other databases. I want to exclude everything else.

    Concerning
    -Samar-

    Using DBMS_METADATA. Create the following SQL script:

    SET FEEDBACK OFF
    SET SERVEROUTPUT ON FORMAT WORD_WRAPPED
    SET TERMOUT OFF
    SPOOL C:\TEMP\MVIEW.SQL
    DECLARE
        CURSOR V_MLOG_CUR
          IS
            SELECT  DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW_LOG',LOG_TABLE) DDL
              FROM  USER_MVIEW_LOGS;
        CURSOR V_MVIEW_CUR
          IS
            SELECT  DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW',MVIEW_NAME) DDL
              FROM  USER_MVIEWS;
    BEGIN
        DBMS_METADATA.SET_TRANSFORM_PARAM(DBMS_METADATA.SESSION_TRANSFORM,'SQLTERMINATOR',TRUE);
        FOR V_REC IN V_MLOG_CUR LOOP
          DBMS_OUTPUT.PUT_LINE(V_REC.DDL);
        END LOOP;
        FOR V_REC IN V_MVIEW_CUR LOOP
          DBMS_OUTPUT.PUT_LINE(V_REC.DDL);
        END LOOP;
    END;
    /
    SPOOL OFF
    

    In my case the script is saved as C:\TEMP\MVIEW_GEN. SQL. Now I will create a journal mview and mview in schema SCOTT and run the script above:

    SQL> CREATE MATERIALIZED VIEW LOG ON EMP
      2  /
    
    Materialized view log created.
    
    SQL> CREATE MATERIALIZED VIEW EMP_MV
      2  AS SELECT * FROM EMP
      3  /
    
    Materialized view created.
    
    SQL> @C:\TEMP\MVIEW_GEN
    SQL> 
    

    Run the C:\TEMP\MVIEW_GEN script. SQL generated a C:\TEMP\MVIEW queue. SQL:

      CREATE MATERIALIZED VIEW LOG ON "SCOTT"."EMP"
     PCTFREE 10 PCTUSED 30 INITRANS
    1 MAXTRANS 255 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 "USERS" 
    
    WITH PRIMARY KEY EXCLUDING NEW VALUES;
    
      CREATE MATERIALIZED VIEW "SCOTT"."EMP_MV" ("EMPNO", "ENAME", "JOB", "MGR",
    "HIREDATE", "SAL", "COMM", "DEPTNO")
      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
    "USERS"
      BUILD IMMEDIATE
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 
    
    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 "USERS"
      REFRESH FORCE ON
    DEMAND
      WITH PRIMARY KEY USING DEFAULT LOCAL ROLLBACK SEGMENT
      USING ENFORCED
    CONSTRAINTS DISABLE QUERY REWRITE
      AS SELECT "EMP"."EMPNO"
    "EMPNO","EMP"."ENAME" "ENAME","EMP"."JOB" "JOB","EMP"."MGR"
    "MGR","EMP"."HIREDATE" "HIREDATE","EMP"."SAL" "SAL","EMP"."COMM"
    "COMM","EMP"."DEPTNO" "DEPTNO" FROM "EMP" "EMP";
                                   
    

    Now, you can run this on the database. You may need to adjust the tablespace and storage clauses. Or you can add more DBMS_METADATA. SET_TRANSFORM_PARAM calls to C:\TEMP\MVIEW_GEN. SQL to force DBMS_METADATA not to include the tablespace or / and the terms of storage.

    SY.

  • DBMS_METADATA. GET_DDL / materialized view

    I can use something like "select dbms_metadata.get_ddl (< object_Type >, < object_Name >) of double" to get the ddl for tables, views, etc. ; However, this doesn't seem to work for me now for the 11.1.0.7.0 version. What should I do to recover the ddl of a materialized view?

    Œuvres:

    SELECT dbms_metadata.get_ddl('MATERIALIZED_VIEW', 'V_CUSTOMER')
    FROM dual;
    

    Does not work:

    SELECT dbms_metadata.get_ddl('MATERIALIZED VIEW', 'V_CUSTOMER')
    FROM dual;
    

    Even for the other types-word-2: "PACKAGE_BODY" is correct, and "BODY of PACKAGE" is not correct.

    Edited by: CharlesRoos May 21, 2010 05:16

  • Materialized view - REFRESH to CLERK a mistake

    I'm changing the mode to refresh a materialized view ON demand to COMMIT ON and I get an error:

    Error in the command line: 4 column: 9
    Error report:
    SQL error: ORA-12054: cannot set the attribute ON COMMIT refresh for the materialized view
    12054 00000 - "cannot set the refresh attribute COMMIT for the materialized view.
    * Cause: The materialized view did not meet the conditions for release at the time.
    * Action: Specify only valid options.

    The original DDL is

    --------------------
    CREATE THE TEST_MV MATERIALIZED VIEW
    REFRESH THE STRENGTH TO DEMAND
    LIKE SOME a.field1, MAX (DECODE (a.field2, 1, field3, NULL)) lbl
    FROM (SELECT field1, Field2, field3 FROM table_source GROUP BY Field1, Field2, field3) a
    GROUP BY a.field1;
    --------------------

    and I tried

    --------------------
    CREATE THE TEST_MV MATERIALIZED VIEW
    REFRESH FORCE THE COMMIT
    LIKE SOME a.field1, MAX (DECODE (a.field2, 1, field3, NULL)) lbl
    FROM (SELECT field1, Field2, field3 FROM table_source GROUP BY Field1, Field2, field3) a
    GROUP BY a.field1;
    --------------------

    WITH ROWID option

    How can I change the mode of a materialized view Refresh?

    Thank you.

    His 10g (10.2)

    10.2.?. ?

    You probably use a wrong syntax to pass through. Try using something like the following. I changed the query to use Scott emp and dept tables. You can pass your own tables and queries using them.

    VARIABLE task_cust_mv VARCHAR2(30);
    VARIABLE create_mv_ddl VARCHAR2(4000);
    EXECUTE :task_cust_mv := 'cust_mv';
    
    EXECUTE :create_mv_ddl := 'CREATE MATERIALIZED VIEW cust_mv REFRESH FAST DISABLE QUERY REWRITE AS SELECT e.empno, d.deptno, SUM(e.sal) sum_amount FROM scott.emp e, scott.dept d WHERE e.deptno = d.deptno GROUP BY d.deptno,e.empno ';
    
    EXECUTE DBMS_ADVISOR.TUNE_MVIEW(:task_cust_mv, :create_mv_ddl);
    

    I am that running on 11106 on Win xp professional SP 2.

    HTH
    Aman...

  • Constraints foreign key in materialized views can be changed (approx 1-master)

    I have a system which consists of a master database and a bunch of materialized view sites homogeneous. 10.2.0.4 all around. Main server is Windows Server 2003. all remote nodes are Windows XP. All materialized views are editable. There are only 20 or two tables (materialized views). Users enter data in the system at the level of the remote nodes via an application.

    There are data integrity constraints in the database on the main site. In the hunt for replication errors, I discovered that the integrity constraints do not exist in the context of the remote node. Then, sometimes, that users can enter data not valid that main site integrity constraints disallow, producing errors of replication on the master site. For a test I then implemented manually some of the constraints on a remote node using the java Enterprise Manager UI. Constraints have behaved as expected, as far as I can tell.

    My ultimate goal is to implement, on all sites of the materialized view, the current constraints of the integrity of the main site, so that entering data at remote sites is governed by the integrity constraints.

    I looked briefly package DBMS_REPCAT subprograms. Nothing jumped out at me.

    I started to collect the DDL (ALTER TABLE... ADD CONSTRAINT...) I could run each site through SQL * more sheet calculation.

    Then I thought that maybe I could use sqldeveloper to run the DDL but when I open the relevant schema to the level of the remote nodes, the actual tables are not shown, only the USLOG$ _... things. Materialized views are shown - but they do not have a constraints tab.

    After some time in the manuals, I decided that I have a good knowledge of what I see; and that's why I'm not sure I'm running in the right direction.

    I will summarize two questions:

    (1) what is the best way for me to apply constraints of integrity of the master site existing in materialized views can be changed on all nodes?

    (2) why I can see and work on the tables on the remote nodes via the EM java, but don't can't see them via sqldeveloper, logged in with the same account twice?

    P.S. It is possible for me to delete and re-create all databases and the views materialized on all remote nodes. It is not a high volume system, and there are windows of time during which I can do these things if necessary. I don't expect a structural change to the database, so I don't need to be able to spread future changes, just make things sync'd up now.

    Published by: Clark October 10, 2008 11:38

    Hi Clark,.
    you are right THAT FK on mviews can cause many problems during refresh. I mentioned on delete cascade, but delete the null value or remove restricted can cause problem too. You cannot complete with active reftesh FK referencing MV PK.

    Because you cannot control the mviews refresh a refresh Group, that the problems I described before can occur.
    You have to my view of these possibilities:
    1 / move Ref. integrity check from the DB to the logic of the application
    2 / use triggers to maintain ref.integrity check DB
    3 / mutlimaster user instead of mviews replication

    But none of them have their more and less.
    1 / + FK is checked - take some time, any other manipulation of data through the application can break rules FK
    2 / + FK is cheked on DB level - you write triggers, lower performance, changing disorders tables
    3 / + FK is chedked at the DB level, - all the data is replicated on the table plan (for MV, you can define where cluase for replication mutlimaster not), with more than two masters, it is difficult to define the replication conflict resolition method that convert in the last time.

    Last post:
    I my case I use this "thing":
    Because our request has not been managed in environment 24 x 7 I wrote my own routine to refresh.
    This routine that follows:
    1 / disable necessary FK
    2 / call dbms_refresh.refresh to perform the refresh of the refresh Group
    3 / activate FK disabled in step 1 with the novalidate
    Refresh the jobs was launched at night.

  • ORA-12028: type of materialized view is not supported by the main site

    Hi guys!

    We face a problem these days about the materialized view.

    We have upgraded database version 9.2.0.7 directly to 10.2.0.5 (RHEL4 x 86) on the same host. Database uses the driver dg4odbc to connect with remote SQL Server 2012 through data binding called MIKSERI. Our developer team would like to have replicated SQL server table data side Oracle using the materialized view.

    They created Materialized view, but it is not at all to refresh the data. I tried to study a little bit, and whenever I try to change the view anyway I hit error:

    ORA-12028: view type is not supported by the master site materialized @ 'MIKSERI '.

    ORA-06512: at line 22

    I looked at the solutions proposed and discovered that it is maybe the compatible database parameter, so I changed from previous 9.2.0.0.0 to 10.2.0.1.0 but still no luck. Just to emphasize this database is of course different clone of production to a different database, with db name retained and other parameters, but on another host computer and listening port. I even try to change global name, but still no luck.

    Main problem is that refresh the work does not at all. To be more precise, we have created MV on the side of the Oracle and FULL Refresh should be done every 3 minutes. MV uses HS db link to the sql server database.

    During the creation of MV, we can see currently given to sql server, but the problem is that we cannot do MV to refresh every 3 minutes. When I try to change MV and put the refresh interval I get above error.

    Any kind of help would be greatly appreciated,

    Thank you

    I found the reason why my MV update jobs failed, job_queue_processes parameter was equal to 0. I change this setting and now works fine.

    Thank you for your time!

  • What is the best way to change a column type in the materialized view?

    Hello my dear friends,.

    I want to change a column type in a materialized view. VARCHAR2 NUMBER, so what do you recommend? What is the best way to do it?

    Thank you

    You can not change the data type of the column while there are data in the MV, so you might as well give up and recreate the MV with a TO_CHAR() around the column in question in the application of MV to get the data exactly as you want (be sure to include an appropriate format mask). That said, I'm fighting to think reasonable grounds to make such a change.

  • A drop materialized view error

    I tried to drop two materialized views (I want to drop one and the other as a test to make sure that the behavior was consistent) with SQL Developer today, using the GUI, not the window of SQL command. When I did this, Developer SQL with these MVs among the tables, he tried to run a 'DROP TABLE' rather than a 'DROP MATERIALIZED VIEW' statement and an ugly error message came up with that and of course she didn't. Is this a bug that needs to be addressed? Or maybe that it is already identified and addressed in a future version?

    Earl

    Looks like you're down the underlying table, not the materialized view.   If you have a my_mv of materialized view, there is also a table called my_mv.

    You must drop the materialized since the Materialized View node in Object Explorer view.

  • Materialized views Refresh method and refresh option

    Hi Experts,

    According to the docs, If the MV contains the following, MV is considered complex. I wonder is there any view data dictionary that indicates the type of MV? Because is very easy to the candidate a complex type mv. Because many queries contains the properties below.

    http://docs.Oracle.com/CD/B28359_01/server.111/b28326/repmview.htm#i52501

    http://docs.Oracle.com/CD/B28359_01/server.111/b28313/basicmv.htm

    Specifically, a materialized view is considered complex if the materialized view definition query contains:

    • A CONNECT BY clause
    • An INTERSECT , MINUS , or UNION ALL operation
    • he DISTINCT or UNIQUE keyword
    • In some cases, an aggregate function, although it is possible to have an aggregation function in the query definition and always have a simple materialized view
    • In some cases, joins other than those in a subquery, although it is possible to have joins in the definition to interrogate and still have a simple materialized view
    • In some cases, a UNION operation


    After that I kept going to read that I learned that when a VM is created, the refresh mode is specified according to the type of the MV. That means, using ON-DEMAND refresh mode is widespread. The documentation mentions that there isa also refresh option. My question is, is it possible to specify

    ON REQUEST and FAST together?

    Also, what are the differences between FULL and FAST. Ends truncate the table and fill it up again?

    ON COMMIT

    Refresh product automatically when a transaction which changed one of the paintings of the materialized view's retail is committed. This can be specified as the materialized view is quickly updatable (in other words, not complex). The ON COMMIT privilege is required to use this mode.

    ON DEMAND

    Refresh occurs when a user manually executes one of the procedures available refresh contained in the DBMS_MVIEW package ( REFRESH , REFRESH_ALL_MVIEWS , REFRESH_DEPENDENT ).

    COMPLETE

    Refreshes and recalculating the materialized view query definition.

    FAST

    Applies incremental changes to refresh the materialized view using the information recorded in the papers of the materialized view, or an SQL * Loader direct-path access or a partition maintenance operation.

    FORCE

    Applies FAST update if possible; otherwise, it applies COMPLETE Refresh.

    NEVER

    Indicates that the materialized view will not be updated with updating mechanisms.

    Select * from version of v$.

    Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production

    Thank you

    Çaglar wrote:

    ...

    Also, what are the differences between FULL and FAST. Ends truncate the table and fill it up again?

    ...

    Thank you

    I just want to answer the truncated question. Seems that nobody covered that yet.

    Answer: It depends.

    If you do a full refresh, then the default is to use ATOMIC_REFRESH = TRUE.

    This means that the update is done via an insert, delete , and ... Select.

    You can change it to ATOMIC_REFRESH = FALSE (parameter dbms_mview.refresh).

    This means that is a TRUNCATE and insert a ... Select with APPEND peak (path direct insert).

    Refresh if Atomic = FALSE is considerably faster than the default. Also way less Archives of newspapers are written.

    The downside is however that, during the update the MV is empty, is no longer an atomar operation!

    See also Oracle documentation: http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_mview.htm#i997194

  • What is 'Table of container' in materialized views

    Hello

    What is meant by ' Container Table ' in materialized views?

    "Materialized view" (MV) is, in fact, a table, rather than a view.

    The term MV is used of the 9i database. In the 7 and 8 databases is the term 'snapshot' (to make things more complicated, the MV concept appeared in the 8i database, but in the context of the data warehouse).

    When you create a MV, for example. using the:

    Create materialized view emp_mv

    full refresh on demand

    as select empno, ename from EMP

    /

    you have, in fact, have created two objects in the data dictionary:

    Select object_name, object_type

    from user_objects

    where object_name = 'EMP_MV. '

    order by 1, 2;

    OBJECT_NAME OBJECT_TYPE

    --------------------- -------------------

    MATERIALIZED VIEW EMP_MV

    EMP_MV TABLE

    You can remove MV and a table of container:

    drop materialized view emp_mv;

    or you can delete only MV, preserving a table containing:

    Let fall the materialized view emp_mv maintain the table;

    Kind regards

    Zlatko

  • What is materialized views named?

    Hi there;

    When I read the documentation below, I met a sentence.

    http://docs.Oracle.com/database/121/DWHSG/basicmv.htm#i1007299

    Materialized views with subqueries or views named in the DE clause can be fast refreshed as points of view can be completely merged.

    What is the point of view named? Thanks in advance.

    Hello

    Named views are normal views created by running ' create view abc as select... from...» ».

    Kind regards

    Bashar

Maybe you are looking for