Creating Materialized View in Toad

As with every new endeavor - come new questions.
I am trying to create a materialized view via toad (first time doing this). Now - toad is great, since it provides a kind-of wizard interface. Hence, one doesn't have to completely code in the create statement, with all of the options, etc.
Instead, in toad, one can (via the schema browser), go into the Materialized Views tab and click on create new. This opens a window with 6 tabs: Basic Info, Refresh Info, Physical Attributes, Query, Partitions & Subpartition Template.
In the Basic Info, one can put a check mark next to some of the following options:
-Build Deffered
-Parallel
-Cache
-Logging
-Using index
-Allow updates
etc.
I have read that build deferred refers to whether or not you would like the view to be created automatically or to be deferred.
Anyways, I tried to find Toad documentation to explain each of the options in-detail. No success. Hence, am researching each part piece by piece.
But - here is my question:
In the Query tab, we are asked to specify a query. I am assuming that the query does not have to be a full query, beginning with CREATE MATERIALIZED VIEW mv_table1 REFRESH FAST etc...
Since in this 'wizard', we are providing the MV name at the top of the dialog box, we are checking the 'options' in the other tabs, etc.
And so, I assumed that the query should merely be a select query in the window mentioned above.
So I entered the following:
select * from table1@remote_db;
When I go to verify the syntax, I get the error message: ORA_00911: invalid character. It seems to be pointing to my db_link (remote_db). I have been using this link throughout many places, w/o any problems.
Has anyone created a MV in toad before? Any links to good toad documentation would be helpful as well.
Thanks.

(This is fun... ;))
For anyone endeavoring this in the future, below I have attached the prerequisites required in order to create a materialized view (can also be found @ http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_6002.htm):
Prerequisites
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:
You must have been granted the CREATE MATERIALIZED VIEW system privilege and either the CREATE TABLE or CREATE ANY TABLE system privilege.
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:
You must have the CREATE ANY MATERIALIZED VIEW system privilege.
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.
To create the materialized view with query rewrite enabled, in addition to the preceding privileges:
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.
If you are defining the materialized view on a prebuilt container (ON PREBUILT TABLE clause), then you must have the SELECT privilege WITH GRANT OPTION on the container table.
The user whose schema contains the materialized view must have sufficient quota in the target tablespace to store the master table and index of the materialized view or must have the UNLIMITED TABLESPACE system privilege.
When you create a materialized view, Oracle Database creates one internal table and at least one index, and may create one view, all in the schema of the materialized view. Oracle Database uses these objects to maintain the materialized view data. You must have the privileges necessary to create these objects.

Similar Messages

  • CREATE MATERIALIZED VIEW ORA-00957

    Hi
    I have tried using this query to create a MVIEW and I get an ORA-00957 (duplicate column name)
    select t.month
    ,t.year
    ,t.entity_code
    ,t.itemref_local
    ,t.qty
    ,t.revenue
    ,t.cogs
    ,t.ppv
    ,t.FD
    ,t.var_labor
    ,t.var_ovhd
    ,n.code entity_code
    ,n.name entity_name
    ,n.finance_responsible
    ,c.local_name
    ,c.emea_name
    ,c.segment
    ,c.country
    ,c.origin_entity
    ,c.icp_code
    ,c.type
    ,c.rmm
    ,c.sales_rep
    ,c.sales_leader
    ,c.emea_director
    ,c.nat_accounts
    ,o.code country_code
    ,o.NAME country_name
    ,o.REGION country_region
    ,e.ELIMINATED
    ,i.PART_NUMBER
    ,i.DESCRIPTION part_description
    ,i.PRODUCT_GROUP
    ,i.LINE
    ,i.CATEGORY
    ,i.FAMILY
    ,i.RANGE
    ,i.SUPPLIER
    ,i.PLM
    FROM hsce_transactions T
           , hsce_entity N
           , hsce_customers C
           , hsce_country O
           , hsce_elim E
           , HSCE_ITEMS I
           , HSCE_MAPPING M
    WHERE T.entity_code = N.code
         AND T.customer_code = C.customer_code
         AND C.ICP_CODE = E.ICP_CODE
         AND C.country = O.code
         AND T.ITEMREF_LOCAL = M.ITEM_REF
         and M.PART_NUMBER = I.PART_NUMBERCan anyone point me to where I have gone wrong?
    Thanks
    Adam

    I'm getting the duplicate column name on my query as well; however the validate feature in Toad, validated the query. I can select and even try to tune the query. therefore, I don't understand the error.
    CREATE MATERIALIZED VIEW SYSADM.BAHAR_MV
    STORAGE (
    BUFFER_POOL DEFAULT
    NOCACHE
    NOLOGGING
    COMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    USING INDEX
    STORAGE (
    BUFFER_POOL DEFAULT
    REFRESH COMPLETE ON DEMAND
    WITH ROWID
    USING DEFAULT LOCAL ROLLBACK SEGMENT
    AS
    /* Formatted on 2009/02/12 13:55 (Formatter Plus v4.8.7) */
    SELECT a.business_unit, a.deptid, a.jobcode, a.emplid, f.oth_hrs, f.oth_earns,
    h.gl_expense, f.erncd, d.descr, b.descr, c.descr, g.NAME, c.setid,
    c.effdt, b.setid, b.deptid, b.effdt, e.check_dt, a.pay_end_dt,
    i.ah89_ldr_summary, i.ah89_ldr_summ_grp
    FROM ps_pay_earnings_bk a,
    ps_bus_unit_tbl_hr d,
    ps_pay_calendar e,
    ps_pay_oth_earns f,
    ps_pay_check g,
    ps_earnings_tbl h,
    ps_jobcode_tbl c,
    ps_job j,
    ps_emplmt_srch_qry j1,
    ps_dept_tbl b,
    ps_ah89_ldr_mappng i
    WHERE j.jobcode = a.jobcode
    AND j.business_unit = d.business_unit
    AND j.setid_dept = d.business_unit
    AND j.jobcode = c.jobcode
    AND j.emplid = a.emplid
    AND j.emplid = j1.emplid
    AND j.empl_rcd = j1.empl_rcd
    AND j.effdt =
    (SELECT MAX (j_ed.effdt)
    FROM ps_job j_ed
    WHERE j.emplid = j_ed.emplid
    AND j.empl_rcd = j_ed.empl_rcd
    AND j_ed.effdt <= a.pay_end_dt)
    AND j.effseq =
    (SELECT MAX (j_es.effseq)
    FROM ps_job j_es
    WHERE j.emplid = j_es.emplid
    AND j.empl_rcd = j_es.empl_rcd
    AND j.effdt = j_es.effdt)
    AND j.setid_jobcode = c.setid
    AND j1.oprid = 'RECPRCSS'
    AND a.company = f.company
    AND a.paygroup = f.paygroup
    AND a.pay_end_dt = f.pay_end_dt
    AND a.off_cycle = f.off_cycle
    AND a.page_num = f.page_num
    AND a.line_num = f.line_num
    AND a.addl_nbr = f.addl_nbr
    AND a.company = g.company
    AND a.paygroup = g.paygroup
    AND a.pay_end_dt = g.pay_end_dt
    AND a.off_cycle = g.off_cycle
    AND a.page_num = g.page_num
    AND a.line_num = g.line_num
    AND a.sepchk = g.sepchk
    AND a.business_unit = b.setid
    AND a.company = e.company
    AND a.paygroup = e.paygroup
    AND a.pay_end_dt = e.pay_end_dt
    AND h.erncd = f.erncd
    AND h.erncd = i.erncd
    AND b.deptid = a.deptid
    AND h.effdt = (SELECT MAX (h_ed.effdt)
    FROM ps_earnings_tbl h_ed
    WHERE h.erncd = h_ed.erncd AND h_ed.effdt <= a.pay_end_dt)
    AND c.effdt =
    (SELECT MAX (c_ed.effdt)
    FROM ps_jobcode_tbl c_ed
    WHERE c.setid = c_ed.setid
    AND c.jobcode = c_ed.jobcode
    AND c_ed.effdt <= SYSDATE)
    AND b.effdt =
    (SELECT MAX (b_ed.effdt)
    FROM ps_dept_tbl b_ed
    WHERE b.setid = b_ed.setid
    AND b.deptid = b_ed.deptid
    AND b_ed.effdt <= SYSDATE)
    AND EXISTS (SELECT i.rowsecclass
    FROM ps_scrty_tbl_dept i
    WHERE i.rowsecclass = 'DPALL' AND i.setid = a.business_unit);

  • Create Materialized View question

    Hi all,
    I have a question about MV.
    Toad creation wizard of a new snapshots (materialized view) on "Refresh Info" tab I set
    Refresh mode: complete On demand
    With: ROWID (I can't use primary key because on my table there isn't PK)
    Writing teh query, next the Materialized View is successfully created and this is a toad script:
    CREATE MATERIALIZED VIEW ASDF
    TABLESPACE USERS
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH COMPLETE ON DEMAND
    WITH PRIMARY KEY
    AS
    select CDA_PART, DES_PART, DES_MAT, CDA_APPART, CDA_PROVEN
    from ldanapr01
    where dat_end>(sysdate-1);Why is specified WITH PRIMARY KEY if I created the view with ROWID option?
    Indeed if a drop a MV and directly run the create VM script above obtain error ORA-14012 table 'LDANAPR01' does not contain a primary key constraint.
    So, if I modify the script in this way
    CREATE MATERIALIZED VIEW ASDF
    TABLESPACE USERS
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH COMPLETE ON DEMAND
    WITH ROWID
    AS
    select CDA_PART, DES_PART, DES_MAT, CDA_APPART, CDA_PROVEN
    from ldanapr01
    where dat_end>(sysdate-1);the MV is successfully created!!
    What is difference between WITH PRIMARY KEY and WITH ROW ID... and why Toad show always the created MV script as WITH PRIMARY KEY ?

    >
    WITH PRIMARY KEY is used to create a primary key materialized view i.e. the materialized view is based on the primary key of the master table instead of ROWID (for ROWID clause). PRIMARY KEY is the default option. To use the PRIMARY KEY clause you should have defined PRIMARY KEY on the master table or else you should use ROWID based materialized views.
    Primary key materialized views allow materialized view master tables to be reorganized without affecting the eligibility of the materialized view for fast refresh.
    Rowid materialized views should have a single master table and cannot contain any of the following:
    * Distinct or aggregate functions
    * GROUP BY Subqueries , Joins & Set operations
    source : http://www.dbasupport.com/oracle/ora9i/mat_views2.shtml

  • Create Materialized View hangs

    Hi,
    I have a query, which contains about 10 tables and returns about 40000 rows. When I execute the query itself it runs about 1minute.
    I want to create a Materialized View for that query, but I had to stop it after some hours. There is no error message, it just doesn't stop.
    Do you have any ideas what the problem could be or where I should start to look at?
    Thank you very much for your help!
    DROP MATERIALIZED VIEW A;
    CREATE MATERIALIZED VIEW A
    TABLESPACE A_T
    PCTUSED    0
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                NEXT             1M
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    NOCACHE
    NOLOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH COMPLETE ON DEMAND
    WITH PRIMARY KEY
    --ENABLE QUERY REWRITE
    AS
    SELECT...

    890408 wrote:
    It returns all rows after 1 minute. I don't have any DB links btw. and I am using oracle 11g.
    We had the same problem with another oracle installation (10g) with another query.
    When I watch the session in my TOAD Session Browser I see the event "asynch descriptor resize" in wait, could this be a hint?
    Or can I enable somehow tracing to find out why the mat view creation never ends?tracing is enabled by below
    DBMS_SESSION.SESSION_TRACE_ENABLE(TRUE,TRUE,'ALL_EXECUTIONS');

  • Error while creating materialized view which using database link

    Helo!
    I'm getting error "ORA-00942: table or view does not exist" when I want to create materialized view.
    Details:
    1. On destination database I create a database link:
    CREATE DATABASE LINK SDATABASE
    CONNECT TO MYUSER
    IDENTIFIED BY MYUSERPASS
    USING 'ORCL';
    => Command "SELECT * FROM TABLE1@SDATABASE" returns data normally!
    2. On source database I create MATERIALIZED VIEW LOG:
    CREATE MATERIALIZED VIEW LOG
    ON TABLE1
    WITH PRIMARY KEY
    INCLUDING NEW VALUES;
    3. Now, when I want to create MATERIALIZED VIEW on destination database:
    CREATE MATERIALIZED VIEW TABLE1
    REFRESH FAST
    START WITH SYSDATE
    NEXT SYSDATE + 1/1440
    WITH PRIMARY KEY
    AS SELECT * FROM TABLE1@SDATABASE;
    ...I get error "ORA-00942: table or view does not exist"!
    How is that possible if command "SELECT * FROM TABLE1@SDATABASE" returns data normally?
    Thanks,
    Voranc

    And, I'm using Oracle 10g.
    Voranc

  • How to create materialized view based on a view?

    Hi,
    I hope this is not very far fetched idea.
    I have a very complex view and I would like to replicate it 'in place' that is I would like to make a materialized view that is based on this view complex view. I would like to use this materialized view (i.e table) to query data instead of using the original view, since it takes Oracle some 10-15 seconds to execute my query on the original view and I am not allowed to create indexes on most of the tables that are included in the original view.
    Can this be done?
    Best regards,
    Tamas Szecsy

    The best way to do this is to create a materialzed view based on the underlying code of the original view. If you don't have this handy, issue the following in sqlplus:
    select text
    from user_views
    where view_name = 'NAME_OF_VIEW'
    You can then cut and paste the sql statement into your create materialized view statement.
    Please note, you will probable have to set the long parameter to a higher value to reveal the complete statement for example:
    SQL> set long 2048

  • How to create materialized view based on a synonym

    Hi all,
    I am trying to create simple materialized view based on a synonym and that synonym is pointing a view in other database (using dblink). I am getting table or view not found error . I am able to select synonym if i use select but not in materialized view. Please help me.
    Thanks,

    The best way to do this is to create a materialzed view based on the underlying code of the original view. If you don't have this handy, issue the following in sqlplus:
    select text
    from user_views
    where view_name = 'NAME_OF_VIEW'
    You can then cut and paste the sql statement into your create materialized view statement.
    Please note, you will probable have to set the long parameter to a higher value to reveal the complete statement for example:
    SQL> set long 2048

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

    Thanks 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

  • Can we create materialized view on the top of another materialized view.

    Hi ,
    can we create materialized view on the top of another materialized view.
    Thanks
    Naveen

    Welcome , Just remember is not good apporch to do that since performance when MV refresh
    Please mark this thread as answered .

  • Error While Creating Materialized View

    Hello,
    I am getting error ORA-22818: subquery expressions not allowed here while creating materialized view. I am using Oracle9i Enterprise Edition Release 9.2.0.1.0. Below pasted is my SQL Script.
    Any help is highly appreciable.
    Thanks
    *********SQL************
    select distinct(id),NAME,(select count(GRADE) from employees where
    nationality like '%US%'and id=a.organization_id and grade=a.grade
    group by ID,GRADE) US,(select count(GRADE) from employees where
    nationality not like '%US%' and organization_id=a.organization_id and grade=a.grade
    group by ORGANIZATION_ID,GRADE) NON_US,grade from employees a
    where grade is not null
    group by GRADE,ID,name
    order by to_number(grade) desc

    Hi,
    This is a documented restriction on MVs. You cannot have a scalar express (i.e a select statement) in the select list.
    You can get round this by joining your select count(grade).. expression in as an inline view in your FROM clause. Or you can create a normal view without the scalar expression, create your MV as a select from this view, then re-define your view to contain the query you want.
    Hope that helps,
    Rod West

  • Error occured while creating MATERIALIZED VIEW

    I created as below:
    CREATE MATERIALIZED VIEW LOG ON FIN.F_CV_HDR
    WITH ROWID, SEQUENCE, PRIMARY KEY;
    CREATE MATERIALIZED VIEW LOG ON FIN.F_CV_DTL
    WITH ROWID, SEQUENCE;
    REATE MATERIALIZED VIEW F_GL_SMRY_MVW
    PARALLEL
    BUILD IMMEDIATE
    REFRESH FAST ON COMMIT AS
    SELECT * FROM
    SELECT
    F_CV_HDR.ROWID "HDR_ID",
    CAST(NULL AS ROWID) "DTL_ID",
    cah_dsm_trm_tr_code gsv_dsm_trm_tr_code,
    cah_dsm_dcmnt_type gsv_dsm_dcmnt_type,
    cah_cv_nmbr gsv_dcmnt_nmbr,
    cah_lcm_lctn_code dsv_lcm_lctn_code,
    cah_dsm_dcmnt_srs gsv_dsm_dcmnt_srs,
    cah_cv_date gsv_dcmnt_date,
    'G' gsv_sub_code_type,
    DECODE(cah_dsm_dcmnt_type,'CPV',0,'CRV',cah_net_amnt) gsv_amnt_dbtd,
    DECODE(cah_dsm_dcmnt_type,'CPV','C','CRV','D') gsv_dr_cr_indctr,
    cah_net_amnt gsv_amnt,
    DECODE(cah_dsm_dcmnt_type,'CPV',cah_net_amnt,'CRV',0) gsv_amnt_crdtd,
    cah_asm_sbldgr_code gsv_sub_code,
    CAH_RMRKS GSV_RMRKS,
    CAST(NULL AS VARCHAR2(3)) GSV_CRS_RFRNCE_TYPE,
    CAST(NULL AS VARCHAR2(3)) GSV_CRS_RFRNCE_TR_CODE,
    CAST(NULL AS NUMBER(10)) GSV_CRS_RFRNCE_NMBR,
    CAST(NULL AS VARCHAR2(6)) GSV_FCM_CRNCY_CODE,
    CAST(NULL AS NUMBER(6,3)) GSV_EXCHNGE_RATE,
    CAST(NULL AS NUMBER(13,2)) GSV_FRGN_CRNCY_AMNT,
    CAST(NULL AS DATE) GSV_DATE_FROM,
    CAST(NULL AS DATE) GSV_DATE_TO,
    CAST(NULL AS NUMBER(7)) GSV_RJH_NMBR,
    CAST(NULL AS VARCHAR2(3)) GSV_PJC_SRS,
    CAST(NULL AS NUMBER(7)) GSV_PJC_NMBR,
    CAST(NULL AS NUMBER(3)) GSV_PJC_EQPTMNT_SRL,
    CAST(NULL AS VARCHAR2(5))GSV_PJC_EXPNSE_HEAD_CODE,
    CAST(NULL AS VARCHAR2(3)) gsv_dpm_dprtmnt_code,
    cah_asm_amm_main_code gsv_amm_main_code,
    CAH_LCM_LCTN_CODE_BOOK GSV_LCM_LCTN_CODE_BOOK,
    CAST(NULL AS NUMBER) gsv_dr_cr_advce_srl,
    0 gsv_dcmnt_srl_nmbr,
    cah_trnsctn_with_indctr gsv_trnsctn_with_indctr,
    cah_trnsctnr_code gsv_trnsctnr_code,
    0 gsv_net_tds_amnt,
    to_number(TO_CHAR(cah_cv_date ,'YYYY')) gsv_year,
    to_number(TO_CHAR(cah_cv_date ,'MM')) gsv_mnth,
    cah_cv_tmpry_nmbr gsv_tmpry_nmbr,
    CAH_SRCE_INDCTR GSV_SRCE_INDCTR,
    CAST(NULL AS VARCHAR2(50)) GSV_BILL_NMBR,
    CAST(NULL AS DATE) gsv_bill_date,
    cah_pay_rcve_name gsv_pay_rcve_name
    FROM f_cv_hdr
    WHERE CAH_FNCL_CLSRE_INDCTR = 'N'
    AND cah_avlble_indctr = 'Y'
    UNION ALL
    SELECT
    F_CV_HDR.ROWID "HDR_ID",
    f_cv_dtl.ROWID "DTL_ID",
    cah_dsm_trm_tr_code gsv_dsm_trm_tr_code,
    cah_dsm_dcmnt_type gsv_dsm_dcmnt_type,
    cah_cv_nmbr gsv_dcmnt_nmbr,
    cah_lcm_lctn_code dsv_lcm_lctn_code,
    cah_dsm_dcmnt_srs gsv_dsm_dcmnt_srs,
    cah_cv_date gsv_dcmnt_date,
    cad_sub_code_type gsv_sub_code_type,
    DECODE(cad_dr_cr_indctr, 'C',0,'D',cad_amnt) gsv_amnt_dbtd,
    cad_dr_cr_indctr gsv_dr_cr_indctr,
    cad_amnt gsv_amnt,
    DECODE(cad_dr_cr_indctr, 'D',0,'C',cad_amnt) gsv_amnt_crdtd,
    cad_sub_code gsv_sub_code,
    cad_rmrks gsv_rmrks,
    cad_crs_rfrnce_type gsv_crs_rfrnce_type,
    cad_crs_rfrnce_tr_code gsv_crs_rfrnce_tr_code,
    CAD_CRS_RFRNCE_NMBR GSV_CRS_RFRNCE_NMBR,
    CAST(NULL AS VARCHAR2(6)) GSV_FCM_CRNCY_CODE,
    CAST(NULL AS NUMBER(6,3)) GSV_EXCHNGE_RATE,
    CAST(NULL AS NUMBER(13,2)) gsv_frgn_crncy_amnt,
    cad_date_from gsv_date_from,
    cad_date_to gsv_date_to,
    cad_rjh_nmbr gsv_rjh_nmbr,
    cad_pjc_srs gsv_pjc_srs,
    cad_pjc_nmbr gsv_pjc_nmbr,
    cad_pjc_eqpmnt_srl gsv_pjc_eqptmnt_srl,
    cad_pjc_expnse_head_code gsv_pjc_expnse_head_code,
    cad_dpm_dprtmnt_code gsv_dpm_dprtmnt_code,
    cad_amm_main_code gsv_amm_main_code,
    cah_lcm_lctn_code_book gsv_lcm_lctn_code_book,
    cad_dr_cr_advce_srl gsv_dr_cr_advce_srl,
    cad_cv_srl_nmbr gsv_dcmnt_srl_nmbr,
    cah_trnsctn_with_indctr gsv_trnsctn_with_indctr,
    cah_trnsctnr_code gsv_trnsctnr_code,
    0 gsv_net_tds_amnt,
    to_number(TO_CHAR(cah_cv_date ,'YYYY')) gsv_year,
    to_number(TO_CHAR(cah_cv_date ,'MM')) gsv_mnth,
    cah_cv_tmpry_nmbr gsv_tmpry_nmbr,
    cah_srce_indctr gsv_srce_indctr,
    CAST(NULL AS VARCHAR2(50)) GSV_BILL_NMBR,
    CAST(NULL AS DATE) GSV_BILL_DATE,
    cah_pay_rcve_name gsv_pay_rcve_name
    FROM f_cv_hdr,
    F_CV_DTL
    WHERE CAH_FNCL_CLSRE_INDCTR = 'N'
    AND cah_avlble_indctr = 'Y'
    AND cah_lcm_lctn_code = cad_cah_lcm_lctn_code
    AND CAH_DSM_DCMNT_TYPE = CAD_CAH_DSM_DCMNT_TYPE
    AND cah_cv_tmpry_nmbr = cad_cah_cv_tmpry_nmbr);
    Giving below error:
    ==================================================
    ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
    12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
    *Cause:    The materialized view did not satisfy conditions for refresh at
    commit time.
    *Action:   Specify only valid options.
    ==================================================

    *Action: Specify only valid options.                                                                                                                                                                                                                           

  • Error while creating Materialized View step 3 of 6 using wizard

    have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group using wizard there is following error on step 3 of 6.
    Statement:----------------
    /*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
    Stack Trace:----------------
    ORA-00942: table or view does not exist.
    ORA-02063: preceding line from masterdbname.
    All parameters for replication are correct.
    Please help me early.
    Thanks

    Hello,
    In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
    Regards,

  • Error while creating Materialized View step 3 of 6

    I have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group there is following error on step 3 of 6.
    Statement:----------------
    /*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
    Stack Trace:----------------
    ORA-00942: table or view does not exist.
    ORA-02063: preceding line from masterdbname.
    All parameters for replication are correct.
    Please help me early.
    Thanks

    Hello,
    In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
    Regards,

  • Error in creating materialized view

    Hi all,
    I am trying to create the following materialized view, but throwing me the error message below
    CREATE MATERIALIZED VIEW "MVIW"."XXFA_R051_SHT2_AMV"
    (PARTITION BY LIST (PERIOD_YEAR)
    PARTITION YEAR2006 VALUES LESS ('2006'),
    PARTITION YEAR2007 VALUES LESS ('2007'),
    PARTITION YEAR2007 VALUES LESS ('2008'))
    TABLESPACE "MVIEW"
    BUILD IMMEDIATE
    USING INDEX
    REFRESH FORCE ON DEMAND
    USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE
    AS (SELECT * FROM XXFA_R051_SHT2_MV);
    SQL Error: ORA-00907: missing right parenthesis
    00907. 00000 - "missing right parenthesis"
    *Cause:   
    *Action:
    Any pointers would be appreciated
    Thanks
    VR

    What is it your are actually trying to do?
    On one hand you say:
    PARTITION BY LIST (PERIOD_YEAR)
    Then you proceed to use the syntax for range partitioning:
    VALUES LESS ('2006'),
    Look up the correct syntax at http://tahiti.oracle.com or the demos in Morgan's Library at www.psoug.org.

  • Error on creating Materialized view.

    Hi,
    I don't understand why it happens...
    When I tried to creating materialized view, it shows a error "ORA-01013: User requested cancel of current operation".
    I don't understand why it happens. I just waited it successfully created. But I didn't press any button.
    Does it matter of size of joining table? I had same issue before. At that time I just removed some tables from the joining condition, this error was gone.
    But at this time, I cannot exclude any other tables the select statement
    Can anyone help me this issue, please?

    Hi,
    11g ( 11.2.0.3 ) has a problem with materialized views based on ROWID, resulting in the problem you mentioned.
    A workaround is creating the MV's based on primary keyl.
    There is also a patch available on MOS, to solve the problem ( thanks to a very long SR from me :-) )
    It is known as bug 13657605 and the patch for it has the same number.
    Remember to read the README, as this patch is only for 11.2.0.3 !!
    Cheers
    FJFranken

Maybe you are looking for