Problems in creating Materialized View from 10g R2  to 11g

Hi,
We have two databases in 10g Release 2. These databases are on two different servers and we use
Materialized views to replicate data between these servers. We are currently using 64 bit version of
oracle 10g release 2 for LINUX.
Oracle Database 10g Release 10.2.0.1.0 - 64 bit Production
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
We use CENTOS 5 - 64 bit edition
We upgraded one of the databases to 11g (We exported the data from old database and
imported it in new database) . Then we tried to create a Materialized view with incremental refresh
on it where the base table is in the second Oracle 10g database.
The problem is that it is not letting us create the view with FAST Refresh. It kept on giving ORA-12028
error. We tried different remedies suggested on forums like creating a view with ROWID, but still it
continued giving us the same error. We also synchronized the characterset of Oracle 10g and Oracle 11g
installations but still it did not work.
Our base table size is pretty large (over 10 Million records) and if we do a full refresh, it takes hours to
refresh it.
Without incremental refresh, we will not be able to fucntion, and to upgrade both database simultaneously
we will need a large down-time which also we can not afford.
Please advise what should we do.
Best Regards
Madhup
Edited by: Madhup on Mar 2, 2009 10:45 AM

Hello,
Yesterday I met the same problem and very sad about this, however, my story is much more complicated (I think so).
I have 6 databases:
2 - 11g
2 - 10g
2 - 9i
Every database of each release has different characterset(UTF8 and AL16UTF16).
I am trying to create Materialized view with FAST REFRESH on Oracle 11g, when master tables are located on 10g database and 9i database.
Materialized view, which points to 9i database, was successfully created.
Materialized view, which points to 10g database, gets ORA-12028
Like you, I tried many notes from METALINK and thought at the begining that the problem is my characterset. But, when the materialized views were successfully built on Oracle 9i database, I understood that the problem is something else.
Did you find the actual reason why this issue does not work??
Thanks,
Alex

Similar Messages

  • Problem in creating MATERIALIZED VIEW

    Hello All,
    I am trying to create the following materialized view and getting this error
    SQL> CREATE MATERIALIZED VIEW system_active_loss_mv
    2 BUILD IMMEDIATE
    3 REFRESH FAST ON COMMIT
    4 ENABLE QUERY REWRITE
    5 AS
    6 SELECT zone_name,
    7 EXTRACT(YEAR FROM active_loss_datetime)|| EXTRACT(MONTH FROM active_loss_datetime) as
    active_loss_period,
    8 count(*) ,
    9 count(active_qloss),
    10 SUM(active_qloss) as active_qloss,
    11 SUM(active_ploss) as active_ploss,
    12 SUM(active_gain) as active_gain
    13 FROM system_active_loss_day
    14 GROUP BY zone_name,
    15 EXTRACT(YEAR FROM active_loss_datetime),
    16 EXTRACT(MONTH FROM active_loss_datetime);
    FROM system_active_loss_day
    ERROR at line 13:
    ORA-01031: insufficient privileges
    what is the error?

    Hello Andrew,
    Thanks for your reply, after granting the necessary priviliges i executed the query again this time i got the following error
    SQL> CREATE MATERIALIZED VIEW system_active_loss_mv
    2 BUILD IMMEDIATE
    3 REFRESH FAST ON COMMIT
    4 ENABLE QUERY REWRITE
    5 AS
    6 SELECT zone_name,
    7 EXTRACT(YEAR FROM active_loss_datetime)|| EXTRACT(MONTH FROM active_loss_datetime) as
    active_loss_period,
    8 count(*) ,
    9 count(active_qloss),
    10 SUM(active_qloss) as active_qloss,
    11 SUM(active_ploss) as active_ploss,
    12 SUM(active_gain) as active_gain
    13 FROM system_active_loss_day
    14 GROUP BY zone_name,
    15 EXTRACT(YEAR FROM active_loss_datetime),
    16 EXTRACT(MONTH FROM active_loss_datetime);
    FROM system_active_loss_day
    ERROR at line 13:
    ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
    when i removed the 'REFRESH FAST ON COMMIT' from above query the view has created...but we want this to be refreshed everytime we insert a new record in the base table.

  • Create materialized view from Designer9i

    Is there a way to create a materialized view from Oracle Designer 9i that will that have a header that look like this :
    CREATE MATERIALIZED VIEW XXXXXXXXX
    REFRESH COMPLETE ON DEMAND WITH PRIMARY KEY
    Instead of this :
    CREATE MATERIALIZED VIEW XXXXXXXXX
    REFRESHWITH ROWID
    Thanks
    Jérôme

    yes.
    as long as you have the privilege.
    but be careful, it may causing locking issue in the SQL Server side.

  • Problems while facing Materialized Views

    Hello All,
    I am facing some problems while creating Materialized Views.
    Senario.
    SCOTT USER:
    sql> Grant select on emp to Public;
    sql> Create materialized view log on emp;
    Connected to LDB User
    sql> CREATE MATERIALIZED VIEW mt_emp
    Refresh fast
    as select * FROM scott.emp;
    I am getting error.. Stating that Table doesnt Exist.
    Please tell me the Reason..
    Note:
    If there is No Log on table Emp then it is throwing the error that there in no LOG on the EMP Table.
    Now when I create a Log on EMP table --> Then it is giving the Problem that Table doesn't Exist.

    Hello paragjp
    The Below are the Steps I am Implementing..
    Connect as Scott User.
    SQL> Grant select on Emp to Public;
    SQL> Create materialized view log on emp with primar key;
    Now I will be Connecting to Other User Say LDB
    Connect as LDB User
    SQL> CREATE MATERIALIZED VIEW mt_emp
    Refresh fast
    as select * FROM scott.emp;
    -- The Below Errors are comming
    ERROR at line 3:
    ORA-12018: following error encountered during code generation for "K5ESK_LDB2"."MT_EMP"
    ORA-00942: table or view does not exist

  • Problem with Materialized Views in 10g

    Hi All,
    I am creating a Materialized View like
    CREATE MATERIALIZED VIEW mvname TABLESPACE SYSTEM BUILD IMMEDIATE REFRESH WITH ROWID FOR UPDATE AS ( SELECT a,b,c FROM table_a,table_b,table_c WHERE cond );
    I am getting an error
    SQL Error: ORA-12013: updatable materialized views must be simple enough to do fast refresh.
    Can anyone tell what is the problem?
    I have included rowid of all three tables in select clause.

    Hi,
    From Oracle Docs:
    ORA-12013: updatable materialized views must be simple enough to do fast refresh
    Cause: The updatable materialized view query contained a join, subquery, union, connect by, order by, or group by caluse.
    Action: Make the materialized view simpler. If a join is really needed, make multiple simple materialized views then put a view on top of them.
    Regards
    K.Rajkumar

  • ORA-12015: cannot create a fast refresh materialized view from a complex qu

    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - ProductionI'm trying to create a fast refresh materialized view that uses a column of xmltype. The problem is I cannot create an MV log that accounts for the xmltype column. I tried excluding it and got the above error. Is there another way I can incrementally update a materialized view where I don't have to do a COMPLETE refresh or use FAST refresh?
    CREATE TABLE "DAS_DESC"."AUTHORITY_TEST"
        "NAID"      NUMBER(20,0) NOT NULL ENABLE,
        "AUTH_TYPE" VARCHAR2(40 BYTE),
        "XML_DATA" "SYS"."XMLTYPE" ,
        "TERM_NAME" VARCHAR2(4000 BYTE)
    CREATE TABLE "DAS_DESC"."AUTH_ASSC_TEST"
        "NAID"    NUMBER(20,0),
        "P_NAID" NUMBER(20,0),
        "REL_TYPE"    VARCHAR2(25 BYTE),
        "XML_DATA" "SYS"."XMLTYPE"
    CREATE
    MATERIALIZED VIEW person_mv
    AS
    SELECT  p.naid
          , p.auth_type
          , INSERTCHILDXML
              p.xml_data                 -- Parent XML Column
            , '//*[contains(local-name(), ''person'')]' --XPATH to Person
            , 'nonPreferredHeadingArray'                -- Value for new child element
            (                                                       -- Sub query for injecting new variant person array
              SELECT XMLELEMENT
                "nonPreferredHeadingArray"
              , XMLAGG -- Aggregator for Variant Persons Array
                  XMLELEMENT
                    "variantPersonName"                    -- Wrapper for each entry in array
                  , extract(a.xml_data,'*/*')
              FROM auth_assc_table -- Link table
              WHERE a.p_naid = p.naid
          ) AS XML_DATA
    FROM authority p -- Parent table
    WHERE p.auth_type = 'Person';The views are created fine and they work perfectly for what we need. The problem is the refresh when we edit the base tables. Ideally, it should take a couple seconds. Right now, it takes a couple minutes. XMLTYPE is one problem and the Complex Query exception is the other. If there is a work-around for fast refresh, please let me know. Greatly appreciated.

    jjmdb wrote:
    I'm trying to create a fast refresh materialized view that uses a column of xmltype. The problem is I cannot create an MV log that accounts for the xmltype column. I tried excluding it and got the above error. Is there another way I can incrementally update a materialized view where I don't have to do a COMPLETE refresh or use FAST refresh? Besides XMLTYPE column, your MV definition has a subquery which prevents it from being fast refreshable.
    I could not find any specific reference in documentation about restriction on XMLTYPE (or CLOB) columns but it seems logical that oracle will not be able to keep track of changes to binary data. What does DBMS_MVIEW.EXPLAIN_MVIEW generate for your MV definition? That should tell you which all conditions (for FAST REFRESH) your MV violates. Since you can not create a MV LOG to include XMLTYPE column, it will not be possible to create a FAST REFRESHABLE MV that includes the XMLTYPE column.
    I am afraid there is not much you can do here unless you are prepared to change the way data is stored in your base tables. If you can store data in base tables using standard data types instead of binary/XML storage, you might be able to create a FAST REFRESHABLE MV.

  • ORA-12015:  cannot create a fast refresh materialized view from a complex q

    Hi,
    I'm facing very strange problem. Please help me why this error is coming
    I'm creating a simple materialized view, but it is giving below error since this is simple select * from.
    CREATE MATERIALIZED VIEW EFMS.MS_TASK
    BUILD IMMEDIATE
    REFRESH FAST
    START WITH SYSDATE
    NEXT (SYSDATE + 1/24)
    WITH ROWID
    AS
    SELECT * FROM MS_TASK@efms_link;
    SELECT * FROM MS_TASK@efms_link
    ERROR at line 8:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    CREATE MATERIALIZED VIEW LOG ON MSDBO.MS_TASK
    TABLESPACE DBOR_MVLOG
    PCTUSED 0
    PCTFREE 60
    INITRANS 20
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOCACHE
    NOLOGGING
    PARALLEL ( DEGREE 2 INSTANCES 1 )
    WITH ROWID, PRIMARY KEY
    EXCLUDING NEW VALUES;


    Not is a best practice to use 'select *'

    ORA-12015: cannot create a fast refresh materialized view from a complex query
    Cause:      Neither ROWIDs and nor primary key constraints are supported for complex queries.
    Action:      Reissue the command with the REFRESH FORCE or REFRESH COMPLETE option or create a simple materialized view.
    Then you have to change REFRESH FAST or create a primary key in MS_TASK@efms_link to avility fast refresh.
    . :-) any help with my english is wellcome :-) .

  • ORA-12015: cannot create a fast refresh materialized view from a complex

    Hi All,
    I am trying to create materialized view but i got a error ORA-12015: cannot create a fast refresh materialized view from a complex query.
    Regards,
    narayana

    Hi,
    Please see if (Note: 179466.1 - Diagnosing ORA-12015 fast refresh materialized view / complex queries) helps.
    Regards,
    Hussein

  • Problem creating materialized view

    OK, I'm totally new in using materialized views.
    I'm trying to create one and to make it refreshed on commit
    CREATE MATERIALIZED VIEW VK_CLIENT  build immediate refresh fast on commit AS
      select c1.code,
    c1.fiche fiche_1,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', 'M. et Mme', c1.lnte ), c1.lnte ) lnte_1,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', 
    decode( c1.lnte, 'M.', c1.libe, c7.libe ), c1.libe ), c1.libe ) libe_1,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', 
    decode( c1.lnte, 'M.', substr( c1.libe, 1, c1.lgnom ), substr( c7.libe, 1, c7.lgnom ) ), substr( c1.libe, 1, c1.lgnom ) ), substr( c1.libe, 1, c1.lgnom ) ) nom_1,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', 
    decode( c1.lnte, 'M.', initcap( substr( c1.libe, c1.lgnom + 2 ) ), initcap( substr( c7.libe, c7.lgnom + 2 ) ) ), initcap( substr( c1.libe, c1.lgnom + 2 ) ) ), initcap( substr( c1.libe, c1.lgnom + 2 ) ) ) prenom_1,
    decode( c1.sfam, '04', decode( c7.sfam, '04', decode( c1.lnte, 'Mlle', 'Mme', c1.lnte ), c1.lnte ), c1.lnte ) lnte_1_bis,
    c1.libe libe_1_bis,
    substr( c1.libe, 1, c1.lgnom ) nom_1_bis,
    initcap( substr( c1.libe, c1.lgnom + 2 ) ) prenom_1_bis,
    c1.sfam sfam_1,
    c1.dnai dnai_1,
    decode( to_char( c1.dnai, 'dd' ), '01', '1er', 
    decode( substr( to_char( c1.dnai, 'dd' ), 1, 1 ), 0, substr( to_char( c1.dnai, 'dd' ), 2 ), to_char( c1.dnai, 'dd' ) ) ) || ' ' || 
    rtrim( to_char( c1.dnai, 'month', 'nls_date_language = french' ) ) || to_char( c1.dnai, ' yyyy' ) dnai_fr_1,
    c1.horsfoyer horsfoyer_1,
    decode( c1.lnte, 'Mlle', 'f', 'Mme', 'f', 'M.', 'm' ) accord_1,
    c7.fiche fiche_7,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', null, c7.lnte ), c7.lnte ) lnte_7,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', null, c7.libe ), c7.libe ) libe_7,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', null, substr( c7.libe, 1, c7.lgnom ) ), substr( c7.libe, 1, c7.lgnom ) ) nom_7,
    decode( c1.sfam, '04', 
    decode( c7.sfam, '04', null, initcap( substr( c7.libe, c7.lgnom + 2 ) ) ), initcap( substr( c7.libe, c7.lgnom + 2 ) ) ) prenom_7,
    decode( c7.sfam, '04', decode( c1.sfam, '04', decode( c7.lnte, 'Mlle', 'Mme', c7.lnte ), c7.lnte ), c7.lnte ) lnte_7_bis,
    c7.libe libe_7_bis,
    substr( c7.libe, 1, c7.lgnom ) nom_7_bis,
    initcap( substr( c7.libe, c7.lgnom + 2 ) ) prenom_7_bis,
    c7.sfam sfam_7,
    c7.dnai dnai_7,
    decode( to_char( c7.dnai, 'dd' ), '01', '1er', 
    decode( substr( to_char( c7.dnai, 'dd' ), 1, 1 ), 0, substr( to_char( c7.dnai, 'dd' ), 2 ), to_char( c7.dnai, 'dd' ) ) ) || ' ' || 
    rtrim( to_char( c7.dnai, 'month', 'nls_date_language = french' ) ) || to_char( c7.dnai, ' yyyy' ) dnai_fr_7,
    decode( c7.lnte, 'Mlle', 'f', 'Mme', 'f', 'M.', 'm' ) accord_7,
    initcap( decode( instr( lower( c1.adr1 ), 'log' ), '1', c1.adr2, decode( instr( lower( c1.adr1 ), 'bât' ), '1', c1.adr2, c1.adr1 ) ) ) adr1,
    initcap( decode( decode( instr( lower( c1.adr1 ), 'log' ), '1', c1.adr2, decode( instr( lower( c1.adr1 ), 'bât' ), '1', c1.adr2, c1.adr1 ) ), c1.adr2, null, 
    decode( instr( lower( c1.adr2 ), 'log' ), '1', c1.adr3, decode( instr( lower( c1.adr2 ), 'bât' ), '1', c1.adr3, c1.adr2 ) ) ) ) adr2,
    initcap( decode( instr( lower( c1.adr3 ), 'log' ), '1', null, decode( instr( lower( c1.adr3 ), 'bât' ), '1', null, c1.adr3 ) ) ) adr3,
    c1.ptt,
    c1.lcom,
    decode( c7.fiche, null, decode( c1.lnte, 'Mme', 'Madame', 'Mlle', 'Mademoiselle', 'M.', 'Monsieur', 'Monsieur' ),
    decode( nvl( c1.sfam, '07' ), '04', 
    decode( nvl( c7.sfam, '07' ), '04', 'Madame, Monsieur', 
    decode( c1.lnte, 
    'Mme', decode( c7.lnte, 'Mme', 'Mesdames', 'Mlle', 'Madame, Mademoiselle', 'M.', 'Madame, Monsieur', 'Madame, Monsieur' ), 
    'Mlle', decode( c7.lnte, 'Mme', 'Madame, Mademoiselle', 'Mlle', 'Mesdemoiselles', 'M.', 'Mademoiselle, Monsieur', 'Mademoiselle, Monsieur' ),
    'M.', decode( c7.lnte, 'Mme', 'Madame, Monsieur', 'Mlle', 'Mademoiselle, Monsieur', 'M.', 'Mesieurs', 'Mesieurs' ),
    '. ', decode( c7.lnte, 'Mme', 'Madame, Monsieur', 'Mlle', 'Mademoiselle, Monsieur', 'M.', 'Mesieurs', 'Mesieurs' ),
    decode( c1.lnte,
    'Mme', decode( c7.lnte, 'Mme', 'Mesdames', 'Mlle', 'Madame, Mademoiselle', 'M.', 'Madame, Monsieur', 'Madame, Monsieur' ),
    'Mlle', decode( c7.lnte, 'Mme', 'Madame, Mademoiselle', 'Mlle', 'Mesdemoiselles', 'M.', 'Mademoiselle, Monsieur', 'Mademoiselle, Monsieur' ),
    'M.', decode( c7.lnte, 'Mme', 'Madame, Monsieur', 'Mlle', 'Mademoiselle, Monsieur', 'M.', 'Mesieurs', 'Mesieurs' ),
    '. ', decode( c7.lnte, 'Mme', 'Madame, Monsieur', 'Mlle', 'Mademoiselle, Monsieur', 'M.', 'Mesieurs', 'Mesieurs' ),
    '-' ) ) ) lnte_long,
    decode( c1.cfam, null, c7.cfam, c1.cfam ) cfam,
    decode( c1.cfam, null, c7.allo, c1.allo ) allo,
    decode( c1.sexe, 'm', decode( c7.sexe, null, 'ms', 'm', 'mp', 'f', 'mp' ), 'f', decode( c7.sexe, null, 'fs', 'm', 'mp', 'f', 'fp' ), '-' ) accord,
    c9.fiche fiche_9,
    c9.lnte lnte_9,
    c9.libe libe_9,
    substr( c9.libe, 1, c9.lgnom ) nom_9,
    initcap( substr( c9.libe, c9.lgnom + 2 ) ) prenom_9,
    initcap( decode( instr( lower( c9.adr1 ), 'log' ), '1', c9.adr2, decode( instr( lower( c9.adr1 ), 'bât' ), '1', c9.adr2, c9.adr1 ) ) ) adr1_9,
    initcap( decode( decode( instr( lower( c9.adr1 ), 'log' ), '1', c9.adr2, decode( instr( lower( c9.adr1 ), 'bât' ), '1', c9.adr2, c9.adr1 ) ), c9.adr2, null, 
    decode( instr( lower( c9.adr2 ), 'log' ), '1', c9.adr3, decode( instr( lower( c9.adr2 ), 'bât' ), '1', c9.adr3, c9.adr2 ) ) ) ) adr2_9,
    initcap( decode( instr( lower( c9.adr3 ), 'log' ), '1', null, decode( instr( lower( c9.adr3 ), 'bât' ), '1', null, c9.adr3 ) ) ) adr3_9,
    c9.ptt ptt_9,
    c9.lcom lcom_9,
    decode( c9.lnte, 'Mlle' , 'Mademoiselle', 'Mme', 'Madame', 'M.', 'Monsieur', 'M. et Mme', 'Madame, Monsieur', null ) lnte_long_9,
    decode( c9.sexe, 'm', 'ms', 'f', 'fs', null, null, '-' ) accord_9,
    no.nbocc
    from client c1,
    client c7, 
    client c9,
    select z.code code,
    count(*) nbocc
    from client z
    where to_char( sysdate, 'yyyymmdd' ) between to_char( z.cdeb, 'yyyymmdd' ) and to_char( nvl( z.cfin, sysdate ), 'yyyymmdd' )
    group by z.code
    ) no
    where c1.code = c7.code (+)
    and c1.role = '1'
    and c7.role (+) ='7'
    and nvl( c7.horsfoyer (+), 0 ) = '0'
    and to_char( nvl( c7.cfin (+), sysdate ), 'yyyymmdd' ) >= to_char( sysdate, 'yyyymmdd' )
    and c1.code = c9.code (+)
    and c9.role (+) = '9'
    and to_char( nvl( c9.cfin (+), sysdate ), 'yyyymmdd' ) >= to_char( sysdate, 'yyyymmdd' )
    and c9.lnte (+) not in ( '. ', 'Assoc.', 'Ste' )
    and c9.lcom (+) is not null
    and c1.code = no.code (+);when doing so, I'm getting a ORA-12054:
    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.
    When I create the materialized view with just CREATE MATERIALIZED VIEW "H6801_GL_00"."VK_CLIENT" AS
    it works but the refresh is only "ON DEMAND"...
    Can't find how and why it won't work...
    Edited by: MacFizz on Dec 17, 2009 3:22 PM

    You could try the DBMS_MVIEW.TUNE_MVIEW and check if you can modify you materialized view or "refactor" it in a smaller, fast refreshable part that you could combine later to the sysdate/rownum part of it.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10821/advisor.htm
    Explanation on restrictions of fast refresh:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10706/repmview.htm
    Below there's an example of a fast refreshable mview, on creating the materialized view log and so on:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_6002.htm#i2080820

  • ORA-04052 creating Materialized View

    ORA-04052 creating Materialized View
    Hi All !!
    I'm trying to create a Materialized view and his query definition uses an active public database link. When I ran the script for creating the view I get the following message:
    ERROR in line 1:
    ORA-04052: error occurred when looking up remote object
    USER.TABLE@ORCL2
    ORA-00604: error occurred at recursive SQL level 1
    ORA-03106: fatal two-task communication protocol error
    ORA-02063: preceding line from ORCL2
    But when I execute his definition query all is ok, the query works fine.
    I mean, I'm using the following sentence to create the view:
    CREATE MATERIALIZED VIEW my_view TABLESPACE tbsname BUILD IMMEDIATE
    REFRESH FORCE
    WITH ROWID
    ENABLE QUERY REWRITE
    AS
    SELECT ...
    FROM SCHEMA_NAME.TABLE_NAME@ORCL2;
    The above sentence give me ORA-04052. Nevertheless the SELECT... FROM SCHEMA_NAME.TABLE_NAME@ORCL2; works fine...
    I checked for the GLOBAL_NAMES parameter and it is set to FALSE. Please help me, How can I fix this problem ?
    I'm using Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production running over Win XP for create the view.
    The Database Link points to Oracle Database 10g Release 10.1.0.4.0 - 64bit Production running over Solaris
    Thanks in advance !!

    I've checked the NLS_LANG settings in both servers, and are set to AMERICAN. NLS TERRITORY are set to America also.

  • Replication of database views/materialized views from big oracle to mobile client

    Hi all,
    Has anyone done a replication of a view or a materialized view
    from big oracle to oracle lite? I can get replication of a
    database table happening(although I cant seem to find the table
    when I log into the odb using msql) but it just doesn't seem to
    work with views(hence the path I have taken which is to use
    materialized views). Anyone? Cheers

    Hello,
    Yesterday I met the same problem and very sad about this, however, my story is much more complicated (I think so).
    I have 6 databases:
    2 - 11g
    2 - 10g
    2 - 9i
    Every database of each release has different characterset(UTF8 and AL16UTF16).
    I am trying to create Materialized view with FAST REFRESH on Oracle 11g, when master tables are located on 10g database and 9i database.
    Materialized view, which points to 9i database, was successfully created.
    Materialized view, which points to 10g database, gets ORA-12028
    Like you, I tried many notes from METALINK and thought at the begining that the problem is my characterset. But, when the materialized views were successfully built on Oracle 9i database, I understood that the problem is something else.
    Did you find the actual reason why this issue does not work??
    Thanks,
    Alex

  • ORA-25175 when trying to create materialized view, organization index SOLV

    Hi,
    I'm trying to create a materialized view to compensate for non-normalized table.
    I have table anormal, and mv is to be on distinct agency, company in that table.
    Here goes:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> create table anormal (company varchar2(8) not null
      2                       ,dept varchar2(8) not null
      3                       ,agency varchar2(8) not null
      4                       ,constraint anormal_pk primary key (company,dept));
    Table created.
    SQL> insert into anormal values('c1', 1, 'Ajax');
    1 row created.
    SQL> insert into anormal values('c1', 2, 'Ajax');
    1 row created.
    SQL> insert into anormal values('c1', 3, 'Acme');
    1 row created.
    SQL> insert into anormal values('c2', 1, 'Acme');
    1 row created.
    SQL> insert into anormal values('c2', 2, 'Acme');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from anormal;
    COMPANY  DEPT     AGENCY
    c1       1        Ajax
    c1       2        Ajax
    c1       3        Acme
    c2       1        Acme
    c2       2        Acme
    SQL> create materialized view agency_comp_mv
      2  organization index --primary key (agency, company)
      3  build deferred
      4  refresh on demand
      5  as
      6  select distinct agency, company from anormal
      7  /
    select distinct agency, company from anormal
    ERROR at line 6:
    ORA-25175: no PRIMARY KEY constraint found
    SQL>The error tells me that there is no primary key, but is there any way to add such?
    - or is my problem rather that I cannot use DISTINCT with organization index?
    Regards
    Peter
    bump
    Message was edited by:
    Peter Gjelstrup
    <SOLVED>
    Message was edited by:
    Peter Gjelstrup

    Thanks William,
    I tried with ON PREBUILT TABLE, just to see what happens.
    Building on my OP:
    SQL> create table iot(agency varchar2(8) not null, company varchar2(8) not null
      2                  ,constraint iot_pk primary key (agency,company))
      3  organization index;
    Table created.
    SQL> insert into iot select distinct agency, company from anormal;
    4 rows created.
    SQL> commit;
    Commit complete.
    SQL> create materialized view iot on prebuilt table
      2  as
      3  select distinct agency, company from anormal;
    Materialized view created.
    SQL> select * from iot;
    AGENCY   COMPANY
    Acme     c1
    Acme     c2
    Ajax     c1
    SQL> insert into anormal values('c3', 2, 'Foo');
    insert into anormal values('c3', 2, 'Foo')
    1 row created
    SQL> select * from anormal;
    COMPANY  DEPT     AGENCY
    c1       1        Ajax
    c1       2        Ajax
    c1       3        Acme
    c2       1        Acme
    c2       2        Acme
    c3       2        Foo
    6 rows selected.
    SQL> select * from iot;
    AGENCY   COMPANY
    Acme     c1
    Acme     c2
    Ajax     c1
    3 rows selectedNow, try to refresh and MV
    SQL> alter materialized view iot refresh complete;
    Materialized view altered.
    SQL> select object_type, to_char(last_ddl_time, 'hh:mi:ss'), status
      2    from user_objects where object_name = 'IOT';
    OBJECT_TYPE         DDL_TIME STATUS
    TABLE               10:40:42 VALID
    MATERIALIZED VIEW   10:41:13 VALID
    SQL> select * from iot;
    AGENCY   COMPANY
    Acme     c1
    Acme     c2
    Ajax     c1Agency "Foo" is not in MV,
    Looks like that IOT select'ed from is indeed the MV:
    SQL> drop table iot;
    drop table iot
    ERROR at line 1:
    ORA-12083: must use DROP MATERIALIZED VIEW to drop "STIK"."IOT"
    SQL>So, seems that Maxim is right, it just can't be done. And it seems my options are:
    Create HEAP organized MV or
    Create and maintain IOT
    Regards
    Peter

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

  • 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

  • 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