Materialized View - Invalid Objects

We created materialized views to access Corporate HRMS data on our local instance using DB Links. All the materialized views become invalid very often. Not sure under which Circumstances. Our DBA mentioned that it happens when we refresh our instance. He suggested to create sysnonyms for DBLINK which points to Corporate instance. Then we should refer the synonym in our Materializd view script and not to refer the DBLINK directly in materialized view definition. He might be right but I am not sure whether his suggestion will solve our issue completely.
We are refreshing the materialized views every four hours and we do complete refresh.
Any suggestions to avoid the the above situation. Right now we recompile the materialized whenever the objects become invalid.
Thanks
Indu

Hi,
it happens when we refresh our instanceWhat do you mean ? Is it an export/import from an other database ? Does the db link used on source exists and works on the target (where you currently experience pb) ?
Nicolas.

Similar Messages

  • Materialized View Invalid

    Hi, i did a drop of a materialized view, the MV doesnt exist, but in the objects, the MV still appearing like an invalid object, and i need to create the MV again but i cant because i get the error that MV already exists. What can i do?

    Hi, im using this drop stament:
    drop materialized view DATOSAREASGEOGRAFICAS_MVW;
    When i execute that stament i got this message materialized view DATOSAREASGEOGRAFICAS_MVW dropped.
    The script to refer the object is:
    select object_name||','||object_type||','||status
    from obj
    where object_name='DATOSAREASGEOGRAFICAS_MVW';
    And the result is:
    DATOSAREASGEOGRAFICAS_MVW,TABLE,VALID
    DATOSAREASGEOGRAFICAS_MVW,MATERIALIZED VIEW,INVALID
    If i try to create the MV again, using this script:
    CREATE MATERIALIZED VIEW "DATOSAREASGEOGRAFICAS_MVW" ("IDAREAGEOGRAFICA", "NOMBRE", "IPID", "IDENTIFICADORUNICO", "GEOMETRIA", "IDEMPRESA", "IDTIPOAREAGEOGRAFICA")
      BUILD IMMEDIATE
       USING INDEX
       REFRESH COMPLETE ON DEMAND
       USING DEFAULT LOCAL ROLLBACK SEGMENT
       USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE
       AS
        SELECT TO_CHAR(idcuenca) idareageografica, nombre, ipid, identificadorunico, geometria, idempresa, 1 idTipoAreaGeografica FROM cuencas
      UNION ALL
    SELECT TO_CHAR(idsubcircuito), nombre, ipid, identificadorunico, geometria, idempresa, 2 FROM subcircuitos
      UNION ALL
    SELECT TO_CHAR(idareatrabajo), nombre, ipid, identificadorunico, geometria, idempresa, 3 FROM areasTrabajo
      UNION ALL
    SELECT TO_CHAR(idareatrabajo), subzonas.subzona, ipid, identificadorunico, geometria, idempresa, 4
    FROM areasTrabajo
      INNER JOIN subzonas
              ON subzonas.idSubzona = areasTrabajo.idSubzona
      UNION ALL
    SELECT TO_CHAR(idareatrabajo), areasOperativas.areaOperativa, ipid, identificadorunico, geometria, idempresa, 5
    FROM areasTrabajo
      INNER JOIN areasOperativas
              ON areasOperativas.idAreaOperativa = areasTrabajo.idAreaOperativa;
    The result is
    Error report:
    SQL Error: ORA-00955: name is already used by an existing object
    00955. 00000 -  "name is already used by an existing object"
    *Cause:   
    *Action:

  • Query Regarding Materialized view invalid

    Hi,
    What is the reason for the Materialized view invalid.

    Question is vague. Can you be more specific?

  • Problem of Materialized view become invalid

    Hi,
    I know that because of DML or DDL operation My Materialized view invalid.
    But I want to know the from which table it become invalid.
    Is there any dictionary view from which I can find ?

    Hi,
    I know that because of DML or DDL operation My Materialized view invalid.
    But I want to know the from which table it become invalid.
    Is there any dictionary view from which I can find ?

  • Many invalid objects found after new install the R12 vision demo (12.1.1)

    In AIX Server,
    I found many invalid objects after new install the R12 vision demo (12.1.1) with DB v11.1.0.7, can I drop the following invalid objects then upgrade to R12.1.3 ?
    OWNER OBJECT_NAME OBJECT_TYPE STATUS
    APPS XLA_00707_AAD_C_000026_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_C_000017_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_C_000016_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_S_000032_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_S_000034_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_S_000039_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_S_000041_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_C_000020_PKG PACKAGE BODY INVALID
    RE RE_PROFILER PACKAGE BODY INVALID
    APPS XLA_00200_AAD_C_000018_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_C_000021_PKG PACKAGE BODY INVALID
    APPS XLA_00555_AAD_S_000014_PKG PACKAGE BODY INVALID
    APPS XLA_00555_AAD_C_000015_PKG PACKAGE BODY INVALID
    APPS XLA_00200_AAD_C_000022_PKG PACKAGE BODY INVALID
    APPS XLA_00140_AAD_S_000036_PKG PACKAGE BODY INVALID
    APPS FSAH_DUPLICATE_PKG PACKAGE BODY INVALID
    APPS XLA_00707_AAD_C_000044_PKG PACKAGE BODY INVALID
    APPS MSD_DEM_OBI_DEMANTRA_MV MATERIALIZED VIEW INVALID
    18 rows selected.
    SQL> alter package XLA_00707_AAD_C_000026_PKG compile body;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY XLA_00707_AAD_C_000026_PKG:
    LINE/COL ERROR
    1/49 PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    is as compress compiled wrapped
    The symbol "compress" was substituted for "end-of-file" to continue.
    SQL> alter package RE.RE_PROFILER compile body;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY RE.RE_PROFILER:
    LINE/COL ERROR
    1180/13 PL/SQL: SQL Statement ignored
    1180/13 PLS-00435: DML statement without BULK In-BIND cannot be used inside FORALL
    1181/32 PLS-00440: FORALL bulk IN-bind variables cannot be used here
    1926/9 PL/SQL: SQL Statement ignored
    1926/9 PLS-00435: DML statement without BULK In-BIND cannot be used inside FORALL
    SQL> alter package FSAH_DUPLICATE_PKG compile body;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY FSAH_DUPLICATE_PKG:
    LINE/COL ERROR
    7/12 PLS-00341: declaration of cursor 'C1' is incomplete or malformed
    8/7 PL/SQL: SQL Statement ignored
    9/14 PL/SQL: ORA-00942: table or view does not exist
    12/17 PL/SQL: Item ignored
    16/7 PL/SQL: SQL Statement ignored
    16/71 PL/SQL: ORA-00942: table or view does not exist
    22/13 PL/SQL: SQL Statement ignored
    22/27 PLS-00320: the declaration of the type of this expression is incomplete or malformed
    Edited by: SamCH on 2013年2月4日 下午11:19

    Hi Hussein,
    Thanks for your reply again, the compile error as below
    e.g.
    show error
    SQL> ALTER PACKAGE APPS.XLA_00707_AAD_C_000026_PKG COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY APPS.XLA_00707_AAD_C_000026_PKG:
    LINE/COL ERROR
    1/49 PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    is as compress compiled wrapped
    The symbol "compress" was substituted for "end-of-file" to continue.
    SQL> ALTER PACKAGE APPS.XLA_00200_AAD_C_000017_PKG COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY APPS.XLA_00200_AAD_C_000017_PKG:
    LINE/COL ERROR
    131072/2 PLS-00103: Encountered the symbol "end-of-file" when expecting
    one of the following:
    ( begin case declare end exit for goto if loop mod null
    pragma raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    continue close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe purge
    SQL> ALTER PACKAGE APPS.XLA_00200_AAD_S_000032_PKG COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY APPS.XLA_00200_AAD_S_000032_PKG:
    LINE/COL ERROR
    131072/7 PLS-00103: Encountered the symbol "end-of-file" when expecting
    2 one of the following:
    . ( ) , * % & = - + < / > at in is mod remainder not rem
    <an exponent (**)> <> or != or ~= >= <= <> and or like like2
    like4 likec between || multiset member submultiset
    SQL> ALTER PACKAGE RE.RE_PROFILER COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY RE.RE_PROFILER:
    LINE/COL ERROR
    1180/13 PL/SQL: SQL Statement ignored
    1180/13 PLS-00435: DML statement without BULK In-BIND cannot be used inside FORALL
    1181/32 PLS-00440: FORALL bulk IN-bind variables cannot be used here
    1926/9 PL/SQL: SQL Statement ignored
    1926/9 PLS-00435: DML statement without BULK In-BIND cannot be used inside FORALL
    SQL> ALTER PACKAGE APPS.XLA_00555_AAD_S_000014_PKG COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY APPS.XLA_00555_AAD_S_000014_PKG:
    LINE/COL ERROR
    131072/5 PLS-00103: Encountered the symbol "end-of-file" when expecting
    7 one of the following:
    begin function pragma procedure subtype type <an identifier>
    <a double-quoted delimited-identifier> current cursor delete exists prior
    SQL> ALTER PACKAGE APPS.FSAH_DUPLICATE_PKG COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY APPS.FSAH_DUPLICATE_PKG:
    LINE/COL ERROR
    7/12 PLS-00341: declaration of cursor 'C1' is incomplete or malformed
    8/7 PL/SQL: SQL Statement ignored
    9/14 PL/SQL: ORA-00942: table or view does not exist
    12/17 PL/SQL: Item ignored
    16/7 PL/SQL: SQL Statement ignored
    16/71 PL/SQL: ORA-00942: table or view does not exist
    22/13 PL/SQL: SQL Statement ignored
    22/27 PLS-00320: the declaration of the type of this expression is incomplete or malformed
    SQL> ALTER PACKAGE APPS.XLA_00707_AAD_C_000044_PKG COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY APPS.XLA_00707_AAD_C_000044_PKG:
    LINE/COL ERROR
    201713/1 PL/SQL: SQL Statement ignored
    201826/1 PL/SQL: ORA-00904: "CST_XLA_INV_REF_V"."TRANSACTION_SOURCE_ID":
    30 invalid identifier
    202147/1 PL/SQL: SQL Statement ignored
    202191/1 PL/SQL: ORA-00904: "CST_XLA_INV_REF_V"."TRANSACTION_SOURCE_ID":
    30 invalid identifier
    202973/5 PL/SQL: Statement ignored
    202973/2 PLS-00364: loop index variable 'HEADER_RECORD' use is invalid
    7
    SQL> ALTER PACKAGE APPS.POS_AP_SUPPLIER_BO_PKG COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY APPS.POS_AP_SUPPLIER_BO_PKG:
    LINE/COL ERROR
    0/0 PL/SQL: Compilation unit analysis terminated
    1/14 PLS-00304: cannot compile body of 'POS_AP_SUPPLIER_BO_PKG' without its specification
    1/14 PLS-00905: object APPS.POS_AP_SUPPLIER_BO_PKG is invalid
    SQL> ALTER PACKAGE APPS.POS_AP_SUPPLIER_BO_PKG COMPILE ;
    Warning: Package altered with compilation errors.
    SQL> show error
    Errors for PACKAGE APPS.POS_AP_SUPPLIER_BO_PKG:
    LINE/COL ERROR
    3/3 PL/SQL: Declaration ignored
    7/32 PLS-00201: identifier 'POS_AP_SUPPLIER_BO' must be declared
    28/3 PL/SQL: Declaration ignored
    35/40 PLS-00201: identifier 'POS_AP_SUPPLIER_BO' must be declared
    SQL> ALTER PACKAGE APPS.POS_BANK_ACCOUNT_BO_PKG COMPILE BODY;
    Warning: Package Body altered with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY APPS.POS_BANK_ACCOUNT_BO_PKG:
    LINE/COL ERROR
    0/0 PL/SQL: Compilation unit analysis terminated
    1/14 PLS-00304: cannot compile body of 'POS_BANK_ACCOUNT_BO_PKG' without its specification
    1/14 PLS-00905: object APPS.POS_BANK_ACCOUNT_BO_PKG is invalid
    SQL> ALTER PACKAGE APPS.POS_BANK_ACCOUNT_BO_PKG COMPILE ;
    Warning: Package altered with compilation errors.
    SQL> show error
    Errors for PACKAGE APPS.POS_BANK_ACCOUNT_BO_PKG:
    LINE/COL ERROR
    4/6 PL/SQL: Declaration ignored
    9/80 PLS-00201: identifier 'POS_BANK_ACCOUNT_BO_TBL' must be declared
    13/5 PL/SQL: Declaration ignored
    19/69 PLS-00201: identifier 'POS_BANK_ACCOUNT_BO_TBL' must be declared

  • Invalid Objects permanent solution required

    Hi,
    This Oracle invalid objects problem is very consistent in our production database (10g).
    select owner,object_name,object_type,status from dba_objects
    where status != 'VALID';
    OWNER          OBJECT_NAME               OBJECT_TYPE         STATUS
    SHOP_LIVE     IEPRODUCTCATEGORYASSIGNMENT1     MATERIALIZED VIEW   INVALID
    SHOP_LIVE     IEPCA_NEWSTATE               MATERIALIZED VIEW   INVALID
    SHOP_LIVE     IEPRODUCTCATEGORYASSIGNMENT2     MATERIALIZED VIEW   INVALID
    SHOP_EDIT     UNSPSCCOUNT1               MATERIALIZED VIEW   INVALID
    SHOP_EDIT     UNSPSCCOUNT2               MATERIALIZED VIEW   INVALID
    SHOP_EDIT     IEPRODUCTCATEGORYASSIGNMENT1     MATERIALIZED VIEW   INVALID
    SHOP_EDIT     IEPCA_NEWSTATE               MATERIALIZED VIEW   INVALID
    SHOP_EDIT     IEPRODUCTCATEGORYASSIGNMENT2     MATERIALIZED VIEW   INVALIDAfter I compile manually each materialized view, and then query again and there are NO ROWS SELECTED.
    But After some time I get the same problem in other schema, and the same scheme with some other invalid objects. What are the reasons for this kind of error, and Can I get rid of this problem permanently?? If yes then please write steps.....
    THanks alot.
    Regards,

    Hi,
    Thank you. Yes I also have noticed that invalid objects are always from these two schemas.
    I don't know the meaning of REWRITE_ENABLED,REWRITE_CAPABILITY,REFRESH_MODE,REFRESH_METHOD,FAST_REFRESHABLE from dba_mviews, but options looked not usual after your suggestion. Can you please have a look and suggest something useful from the below columns to change. I mean which change could prevent invalid objects by changing from below columns if works.
    SYS@rac1p1 AS SYSDBA> select owner,MVIEW_NAME,REWRITE_ENABLED,REWRITE_CAPABILITY,REFRESH_MODE,REFRESH_METHOD,FAST_REFRESHABLE from dba_mviews
      2  where owner = 'SHOP_EDIT';
    OWNER                      MVIEW_NAME                R REWRITE_C REFRES REFRESH_ FAST_REFRESHABLE
    SHOP_EDIT                 ECLASSCOUNT1                N NONE       DEMAND FORCE       NO
    SHOP_EDIT                 ECLASSCOUNT2                N NONE       DEMAND FORCE       NO
    SHOP_EDIT                 IEPCA_BINDINGKEYS           N GENERAL   DEMAND FORCE       NO
    SHOP_EDIT                 IEPCA_NEWSTATE                N TEXTMATCH DEMAND FORCE       NO
    SHOP_EDIT                 IEPCA_OLDSTATE                N GENERAL   DEMAND FORCE       NO
    SHOP_EDIT                 IEPRODUCTCATEGORYASSIGNMENT1   N TEXTMATCH DEMAND FORCE       NO
    SHOP_EDIT                 IEPRODUCTCATEGORYASSIGNMENT2   N TEXTMATCH DEMAND FORCE       NO
    SHOP_EDIT                 UNSPSCCOUNT1                N NONE       DEMAND FORCE       NO
    SHOP_EDIT                 UNSPSCCOUNT2                N NONE       DEMAND FORCE       NO
    9 rows selected.
    SYS@rac1p1 AS SYSDBA> select owner,MVIEW_NAME,REWRITE_ENABLED,REWRITE_CAPABILITY,REFRESH_MODE,REFRESH_METHOD,FAST_REFRESHABLE from dba_mviews
      2  where owner = 'SHOP_LIVE';
    OWNER                      MVIEW_NAME                R REWRITE_C REFRES REFRESH_ FAST_REFRESHABLE
    SHOP_LIVE                 IEPRODUCTCATEGORYASSIGNMENT2   N TEXTMATCH DEMAND FORCE       NO
    SHOP_LIVE                 IEPRODUCTCATEGORYASSIGNMENT1   N TEXTMATCH DEMAND FORCE       NO
    SHOP_LIVE                 IEPCA_OLDSTATE                N GENERAL   DEMAND FORCE       NO
    SHOP_LIVE                 IEPCA_NEWSTATE                N TEXTMATCH DEMAND FORCE       NO
    SHOP_LIVE                 IEPCA_BINDINGKEYS           N GENERAL   DEMAND FORCE       NO
    SHOP_LIVE                 ECLASSCOUNT2                N NONE       DEMAND FORCE       NO
    SHOP_LIVE                 ECLASSCOUNT1                N NONE       DEMAND FORCE       NO
    SHOP_LIVE                 UNSPSCCOUNT2                N NONE       DEMAND FORCE       NO
    SHOP_LIVE                 UNSPSCCOUNT1                N NONE       DEMAND FORCE       NO
    SHOP_LIVE                 IEPRODUCTCATEGORYASSI$2           N TEXTMATCH DEMAND FORCE       NO
    SHOP_LIVE                 IEPRODUCTCATEGORYASSI$1           N TEXTMATCH DEMAND FORCE       NO
    SHOP_LIVE                 ECLASSCOUNT$1                N NONE       DEMAND FORCE       NO
    SHOP_LIVE                 UNSPSCCOUNT$2                N NONE       DEMAND FORCE       NO
    SHOP_LIVE                 UNSPSCCOUNT$1                N NONE       DEMAND FORCE       NO
    SHOP_LIVE                 ECLASSCOUNT$2                N NONE       DEMAND FORCE       NOEdited by: John-M on Jan 25, 2012 8:29 AM

  • Dropping base table of materialized view

    HI please let me know what happens if i drop the base table of a materialized view? does the MV remain valid with data?

    Hi,
    Well, it's easy to test yourself.
    SQL> select count(*) from t1;
      COUNT(*)
           100
    SQL> desc t1
    Name                                      Null?    Type
    ID                                                 NUMBER(10)
    SQL> create materialized view t1_mv as select * from t1;
    Materialized view created.
    SQL> select count(*) from t1_mv;
      COUNT(*)
           100
    SQL> drop table t1 purge;
    Table dropped.
    SQL> select count(*) from t1_mv;
      COUNT(*)
           100
    SQL> desc t1_mv
    Name                                      Null?    Type
    ID                                                 NUMBER(10)
    SQL> select object_type, status from user_objects where object_name = 'T1_MV';
    OBJECT_TYPE         STATUS
    TABLE               VALID
    MATERIALIZED VIEW   INVALID
    SQL> select * from t1_mv where rownum < 5;
            ID
             1
             2
             3
             4
    SQL>I think the answer is very clear.
    Asif Momen
    http://momendba.blogspot.com

  • "Invalid Metadata Objects" when creating materialized views

    Hi experts,
    I have run into some trouble. I had an analytic workspace that grew too fast (see 11.2.0.2 AW size grows steadily with every cube build so I deleted it and created a new one.
    It seemed to build fine using the tip that David Greenfield gave us in the mentioned forum post, but when I try to enable materialized views (which I had enabled in the previous workspace) I'm gettig the following error:
    Your metadata changes have been saved, with the following errors
    Invalid Metadata Objects:
    Invalid Object "TABLESPACE.LECTURAS": "CREATE MATERIALIZED VIEW "TABLESPACE"."CB$LECTURAS"
    ORGANIZATION CUBE ON TABLESPACE.TABLESPACE_AW(
    FACT "LECTURAS_STORED"("LECTURAS_MEASURE_DIM" 'LECTURA') IS "LECTURA",
    DIMENSION "TIEMPO" IS "TIEMPO" USING "TIEMPO_TIEMPO_HOUR_ID_UNIQUE_KEY" ,
    DIMENSION "GEOGRAFIA" IS "GEOGRAFIA" USING "GEOGRAFIA_GEOGRAFIA_CONTADOR_ID_UNIQUE_KEY" )
    BUILD DEFERRED
    REFRESH ON DEMAND
    FORCE
    USING TRUSTED CONSTRAINTS
    AS
    SELECT
    TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') "TIEMPO",
    T1."COD_METERID" "GEOGRAFIA",
    SUM(T1."VAL_AI_HOR") "LECTURA"
    FROM
    TABLESPACE."LECTURA_HORARIA_FINAL" T1
    GROUP BY
    (TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') , T1."COD_METERID")
    ORA-00942: table or view does not exist
    Running this same script in SQLDeveloper yields the same error at line 17, which is the FROM clause. BUT I can run the SELECT statement by itself and returns the expected result. So the table exists in the correct tablespace.
    I must be missing something big...
    Thanks in advance.
    Joan
    P.S.: In the code above I'm using "TABLESPACE" in substitution for the real username and tablespace name (which is the same) for privacy reasons.

    When you ran the select statement, were you connected as the same user that you used to try to enable the MVs?
    Can you create a standard (non cube) MV with the same select statement? (Connected as the same user you used in AWM.)
    "CREATE MATERIALIZED VIEW "TABLESPACE"."MV_TEST"
      BUILD DEFERRED
      REFRESH ON DEMAND
      FORCE
      USING TRUSTED CONSTRAINTS
    AS
      SELECT
       TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') "TIEMPO",
       T1."COD_METERID" "GEOGRAFIA",
       SUM(T1."VAL_AI_HOR") "LECTURA"
      FROM
       TABLESPACE."LECTURA_HORARIA_FINAL" T1
      GROUP BY
       (TO_CHAR(T1."FEC_LECTURA", 'dd/mm/yyyy hh24:mi:ss') , T1."COD_METERID")
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Invalid Column Name on select from materialized view?

    Hey all, I have created this materialized view for my java to select from. For some reason when I try to select from it, I get invalid column name. Here is my mat view statement in its simplest form:
    create materialized view mv_pgridtcevcluster_property as
    select distinct clustername_ as "OBJECT_ID", CLUSTERNAME_, LICENSEMODE_
    from p_gridtcevcluster p
    order by clustername_;
    Now when I run my select statement from jdbc:
    SQL: select object_id from MV_PGRIDTCEVCLUSTER_PROPERTY
    java.sql.SQLException: Invalid column name
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
         at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3319)
         at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1926)
         at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515)
         at com.mchange.v2.c3p0.impl.NewProxyResultSet.getString(NewProxyResultSet.java:3342)
         at historian.objects.mgmt.udrManagerTest.gatherObjects(udrManagerTest.java:73)
    Anyone have issues with this before? It seems to throw the error sporatically, any help would be much appreciated!
    Regards,
    TimS
    Edited by: TimS on Mar 30, 2009 1:54 PM
    Nevermind, figured it out. Was using wrong column name identifier when picking values from resultset.

    Since you have "OBJECT_ID" in quotes, Oracle stores the column name literally and case sensitively, and the column name must be capitalized when referenced.
    From a regular sql*plus window, try
    select object_id from mv_pgridtcevcluster_property;
    select OBJECT_ID from mv_pgridtcevcluster_property;
    select "OBJECT_ID" from mv_pgridtcevcluster_property;What is the result from each of them?

  • Invalid Materialized view

    Hi ALL:
    some of MVs become invalid (yes, we did app upgrade over the weekend). I looked on every object reference in the MV, all permissions - can't find anything.
    I dropped MVs and created them no errors. Status changed to VALID. I decided to re-COMPILE them (because I saw public synonyms for MVs as INVALID). After compilation status changed back to INVALID.
    Oracle 11.2, Solaris 10
    Any ideas where to look?
    Thanks,
    Greg

    Your materialized view will be marked INVALID as soon as any DML is done against the tables on which it is based. Not a problem.
    John Watson
    Oracle Certified Master DBA
    http://skillbuilders.com

  • Recieving ORA-01722 invalid number error while creating a materialized view

    Hi,
    I am receiving a ORA-01722 invalid number error while creating a materialized view. when run the select statement of the view i don't get any error, but when i use the same select statement to create a materialized view i receive this error. Could any please help in resolving this error. Here is the code i am using to create a materialized view.
    CREATE MATERIALIZED VIEW MV_EBS_CH_CLOSED
    REFRESH FORCE ON DEMAND
    AS
    SELECT DISTINCT kr.request_id, org.org_unit_name,
    ebs_ch_ticket_type (kr.request_id) ticket_type,
    DECODE
    (kr.status_code,
    'CLOSED_SUCCESS', kr.last_update_date,
    'IN_PROGRESS', (SELECT MAX (start_time)
    FROM ebs_ch_datastore ecd1
    WHERE kr.request_id = ecd1.request_id
    AND workflow_step_name =
    'Final BA Review and Deployment Exit Criteria')
    ) closed_date,
    substr(krhd.visible_parameter12,1,10) siebel_start_date,
    kr.creation_date itg_start_date
    FROM kcrt_requests kr,
    kcrt_request_types krt,
    kcrt_req_header_details krhd, kcrt_request_details krd1,
    (SELECT koum.user_id user_id,
    DECODE (koup.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    koup.org_unit_name
    ) org_unit_name
    FROM krsc_org_unit_members koum, krsc_org_units koup
    WHERE 1 = 1
    AND 'Y' = koup.enabled_flag
    AND koum.org_unit_id = koup.org_unit_id
    AND EXISTS (
    SELECT 'X'
    FROM krsc_org_units kouc
    WHERE koup.org_unit_id = kouc.org_unit_id
    START WITH kouc.parent_org_unit_id =
    ANY (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units1
    WHERE 'Clearinghouse' =
    org_unit_name)
    CONNECT BY kouc.parent_org_unit_id =
    PRIOR kouc.org_unit_id)
    UNION
    SELECT kou.manager_id user_id,
    DECODE
    (kou.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    kou.org_unit_name
    ) org_unit_name
    FROM krsc_org_units kou
    WHERE 'Y' = kou.enabled_flag
    START WITH kou.parent_org_unit_id =
    (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units2
    WHERE 'Clearinghouse' = org_unit_name)
    CONNECT BY kou.parent_org_unit_id = PRIOR kou.org_unit_id) org
    WHERE krt.request_type_id = kr.request_type_id
    AND krt.request_type_name IN ('Bug Fix', 'IT Enhancement')
    and kr.REQUEST_ID = krd1.request_id
    and krd1.batch_number = 1
    AND kr.request_id = krhd.request_id
    AND org.user_id in (krd1.parameter4, krd1.parameter5, krd1.parameter7)
    AND ( 'CLOSED_SUCCESS' = kr.status_code
    OR 'IN_PROGRESS' = kr.status_code
    AND kr.request_id IN (
    SELECT request_id
    FROM (SELECT DISTINCT request_id,
    MAX
    (start_time)
    closed_date
    FROM ebs_ch_datastore
    WHERE 'Final BA Review and Deployment Exit Criteria' =
    workflow_step_name
    GROUP BY request_id))
    Thanks,
    Shaik Mohiuddin

    This error occurs when you try to create a materialized view , but if you run the sql the results are perfectly fine. Well it happend to me also and to fix this I made sure all the coulmns have the same data type which are used in joins or in where clause.
    use
    where
    to_number(col1)=to_number(col2) and to_number(col3)=to_number(col4)
    hope this helps..

  • What is the red block on left of Materialized View in SQL Object Browser

    Hi
    In APEX 4.0 i have a few Materialized Views - all work fine, but when I view them in the SQL Workshop Object Browser, a little red block appears on the left hand side of the MV name.
    I'm curious to know what this might mean.
    Thanks
    Mike

    Hi Jari
    That is what is puzzling me, because if I examine the Details tab of the particular MV it shows as VALID.
    The same shows when I run in SQL:-
    select status
    from all_snapshots where NAME = 'MV_NAME';
    The status is valid.
    It is not a problem - just puzzling?!
    Thanks anyway.
    Mike

  • Materialized View with column based on PL/SQL function returning object

    I have the following problem - it is known that materialized view wants PL/SQL functions used in it to be DETERMINISTIC. And it appears that a function which returns SDO_GEOMETRY cannot be DETERMINISTIC - I can add DETERMINISTIC modifier to my function which returns sdo_geometry based on USNG grid ID and save the package, and it compiles and runs fine with regular queries, but when it comes to materialized view (mview), the following error is thrown:
    ORA-12018: following error encountered during code generation for "SCHEMA"."MVIEW_NAME"
    ORA-00932: inconsistent datatypes: expected NUMBER got MDSYS.SDO_GEOMETRY
    Looks like DETERMINISTIC modifier is not fully supported for object types. I have tried to use SDO_CS.FROM_USNG Oracle's function, and it appeared that this function is also non-deterministic - I cannot refresh mview with P or F on-demand refresh method (see http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14223/refresh.htm#i1008349 for a list of on-demand refresh methods). Without that function I can refresh mview with P or F flags.

    Hi,
    Yes, the Chart Series can be based on "Function Returing SQL Query" and the "SQL" would be something like:
    DECLARE
    vSQL VARCHAR2(1000);
    BEGIN
    vSQL := 'SELECT NULL LINK, ENAME LABEL, SAL VALUE FROM EMP ORDER BY ENAME';
    RETURN vSQL;
    END;You should tick the "Save query without validation" underneath that. Without this, there is a validation error - the ; at the end is required to get the chart to function correctly but the validator sees this as an error.
    You would need to create this separately from the report. No matter how you did it, the chart would still run a SQL statement to generate the output. If you wanted to use the "same data", then you could create a collection using the PL/SQL and base both the report and the chart on the collection instead.
    Andy

  • Invalid Materialized view Oracle 8

    Hi,
    I have a problem with a Invalid materialized view in Oracle 8.
    this view is in a .sql file. When the SQL file runs and the view is invalid the the loading is stopped.
    Does anyone know if it's possible in Oracle 10 that Oracle solves the problem (with the view) it self, or that I have to repair it myself and run the file again?
    thanks for the help
    kinds regards,
    Richard van der Haag

    Richard,
    There is nothing that on MV gets done automatically in 10g. Please post your query and we will see where the error is.
    Thanks
    G

  • MATERIALIZED VIEW BECOMES INVALID AFTER REFRESH

    Hello All,
    I have wierd problem ,
    In my enviroinment we have a MATERIALIZED VIEW ,which is refreshed by a sheduled DBMS_SNAPSHOT.REFRESH Job post the refresh it becomes invalid and every time we have to compile it manually ,Could anybody help with a solution .Thanks a lot in Advance .
    DETAILS :
    ======
    VERSION:Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    HOST: IBM AIX

    Is the MV part of a refresh group?
    Post the command and parameters used by the scheduled job to do the refresh as well as the parameters you use when you do it manually.

Maybe you are looking for

  • Why are fields displaying in the Word 7 doc?

    I frequently generate a Word 7 document for review purposes only. Today, after I generated the latest version, a bunch of the fields are displaying in some of the headings. I can't hide them; they are acting like text. I am using the same RH8 setting

  • Default Aggregation Rule

    Can someone explain me as to how BI interprets the default aggregation rule. Say when we say the defualt aggregation rule on the sales fact table column revenue is SUM. what does it actually imply. Similarly when we use the Aggregation Content tab in

  • How to Validate PDF documents

    Hi, I need to find the given PDF document has any missing fonts or it is damaged one from my acrobat plugin application.  Which functions should I need to use to get  this information in Acroabt SDK.  Please help me.. Thanks & Regards, Rehana

  • How to run the Pay roll for New employee in back date

    Hi All I have an question Scenario 1 - employee has joined in month of march but pay roll is process in july. In Basic salary fast formula condition is if the emplyee is joined prevoius month and pay roll not process thn it is working but the employe

  • My own website it blocked. Will not come up.

    I have a website. It is available at Internet Explorer, but not a Mozilla Firefox Google.