Creating a view in ODI

Hello

A few ODI experts in this regard, I earlier aid, but unfortunately I could not be implemented.
My oracle database is. My requirement is I have one huge question I use to create a view, but the view of the source and target are in different databases. The subquery suggested options previously provided as this http://www.business-intelligence-quotient.com/?p=1045 only works if the motion of the source and the target table are on the same database. How to accomplish if they are on different databases?

If you have a great view, you have many maintenance problems. It is therefore preferable to split in a different subview and make a package with different performance.

You can store all the data in a technical drawing (WRK_ODI) or a procedure that remove the tables at the end.

Tags: Business Intelligence

Similar Questions

  • You can create a view that filters (ESX host) Linux machines on the view of the Infrastructure?

    Hello

    We have recently implemented Foglight and VMware plugin. As part of the VMware plugin, Foglight pulls in all the Linux VM machines including the ESX host. Our team of Linux only manages the running redhat Linux hosts. They fail the ESX VM guest. That said, is there a way to create a view that shows only the hosts running redhat Linux?

    For example the view of rail infrastructure below contains 88 Linux machines, but nearly half of them are ESX hosts for our Linux team would not see all these. Is it possible to filter these?

    Any help is appreciated.

    Thank you

    Tony

    The easiest way would be to create a personalized, pair it with Infrastructure and then create a dynamic management component.  This will help create you a rule for "All hosts" where you can find just the hosts that are not of the ESX host and run Linux.

    The query would be:

    detail.topologyTypeName! = "VMWESXServer" & os.longName like «% Linux»

  • Create a view of RDF in Oracle 12 c of tables in an Oracle 11 g Server

    Hello!

    I have a relational database in Oracle 11 g server, but I need to create the view of RDF model in Oracle 12 c in the base tables.

    I created a database connection to connect to the server of Oracle 11 g Oracle 12 c, using the statement:

    CREATE DATABASE LINK myDBLink

    CONNECT to user_test

    IDENTIFIED BY test123

    WITH THE HELP OF '(DESCRIPTION=)

    (ADDRESS = (PROTOCOL = TCP)(HOST=192.0.56.158) (PORT = 1521))

    (CONNECT_DATA = (SID = orcl)))';

    The works of the SELECT statement:

    Select * from EMP@myDBLink;

    I also created a SYNONYM:

    CREATE the SYNONYM MY_EMP FOR EMP@myDBLink;

    The SELECT statement with the synonym also works:

    Select * from EMP@MY_EMP;

    Well, to create the view of RDF, I use a sem_apis.create_rdfview_model function. Now, I wrote the statement of the following two ways:

    BEGIN

    () sem_apis.create_rdfview_model

    Model_name = > "test_linked"

    tables = > SYS. ODCIVarchar2List ('MY_EMP', 'MY_DEPT'),

    prefix = > ' http://GrDF/ ',

    Options = > ' COMPLIANCE = you

    );

    END;

    BEGIN

    () sem_apis.create_rdfview_model

    Model_name = > "test_linked"

    tables = > SYS. ODCIVarchar2List('EMP@myDBLink','DEPT@myDBLink'),

    prefix = > ' http://GrDF/ ',

    Options = > ' COMPLIANCE = you

    );

    END;

    And I get the following error:

    ORA-13199: fetchTabIDList: not found in tables:

    ORA-06512: at the 'MDSYS. SDO_RDF_INTERNAL', line 14308

    ORA-06512: at the 'MDSYS. SDO_RDF', line 3616

    ORA-06512: at the 'MDSYS. RDF_APIS', line 1253

    ORA-06512: at line 2


    I use examples of book of the Oracle tables.


    Thank you


    Yenier

    Yenier,

    Could you please try creating a view rather than a synonym? Here is an example:

    SQL >-create dblink

    SQL > create public database link

    2 mylink

    3 connect to

    Scott 4

    5 identified by

    6 Tiger

    using a 7 ':/';

    Database link created.

    SQL >

    SQL >-create view local using queries involving remote database objects

    SQL > create view dblink_scott_EMP in select * from EMP@mylink;

    Created view.

    SQL >

    SQL >-add the primary key (help requests on Direct mapping according to models RDFView to have shorter SubjectMaps)

    SQL > alter view dblink_scott_EMP add constraint pk_EMPNO primary key (EMPNO) disable;

    Altered view.

    SQL >

    SQL > - create model DM - based RDFview

    SQL > exec sem_apis.create_rdfview_model ('dblink_test_rv', sys.odcivarchar2list ('DBLINK_SCOTT_EMP'), "http://dm/");

    PL/SQL procedure successfully completed.

    SQL >

    Thank you

    -Smiled.

  • Creating a view and replacing id with strings of text values

    This can be a pretty basic question, but I'm a newbie so any advice is appreciated.

    Here's my data:

    create table user_attributes (id NUMBER, attr1 number, attr2 number, attr3 number, attr4 number, attr5 number);
    create table tag_values (tag_id number, tag varchar2(30));
    
    
    insert into user_attributes (id, attr1, attr2, attr3, attr4, attr5) values (1, 101, 105, 102, null, null);
    insert into user_attributes (id, attr1, attr2, attr3, attr4, attr5) values (2, 105, null, 101, 105, null);
    insert into user_attributes (id, attr1, attr2, attr3, attr4, attr5) values (3, 102, null, null, 105, 103);
    
    
    insert into tag_values (tag_id, tag) values (101, 'blue');
    insert into tag_values (tag_id, tag) values (102, 'red');
    insert into tag_values (tag_id, tag) values (103, 'green');
    insert into tag_values (tag_id, tag) values (104, 'orange');
    insert into tag_values (tag_id, tag) values (105, 'black');
    

    I want to create a view and the column id and the text of the tag instead of the ID.

    That's what I use so far (just showing three columns of attribute for example):

    SELECT a.id,
      b.tag ATTR1,
      c.tag ATTR2,
      d.tag ATTR3
    FROM user_attributes a
    LEFT JOIN tag_values b
    ON a.attr1 = b.TAG_ID
    LEFT JOIN tag_values c
    ON a.attr2 = c.TAG_ID
    LEFT JOIN tag_values d
    ON a.attr3 = d.TAG_ID
    ORDER BY 1;
    

    Result:

      ID        ATTR1                          ATTR2                          ATTR3                        
    ---------- ------------------------------ ------------------------------ ------------------------------
             1 blue                           black                          red                            
             2 black                                                         blue                           
             3 red        
    

    That's what I want, but I have a lot of data and I want to just make sure that I do things properly. Is there a more efficient way to build this application?

    Hello

    It would be so much easier if you had only 1 column to search, not 5.  We will therefore unpivot the table so there is only 1 column to search; then we can switch it to display as you wish:

    WITH unpivoted_data AS

    (

    SELECT ua.id, ua.col, tv.tag

    Of user_attributes

    UNPIVOT (attr

    FOR the collar (attr1, attr2, attr3, attr4, attr5)

    )                ua

    JOIN tag_values tv ON tv.tag_id = ua.attr

    )

    SELECT *.

    Of unpivoted_data

    PIVOT (MIN (tag)

    At THE neck ('ATTR1' AS attr1

    'ATTR2' attr2 VALUE

    'ATTR3' attr3 AS

    'ATTR4' AS attr4

    'ATTR5' AS attr5

    )

    )

    ORDER BY id

    ;

    Output:

    ID ATTR1 ATTR2, ATTR3 ATTR4 ATTR5

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

    1 red blue black

    2 black blue black

    3 black red green

    .

    It is better to have the attributes in a dynamic no cross-form for this problem, it is perhaps better to have the attributes of the dynamic non cross-shape for most other uses, too.  Consider to permanently store the attributes with only 1 attribute per line.

  • Syntax to create the view with 2 inline tables

    Hello

    If I run this SQL, I can compile a view without error:

    CREATE OR REPLACE FORCE VIEW APPS.XX_TEST
    (
        period_name
      , ytd
    )
    AS
    with tbl_data AS
    (
    SELECT '1314-03:OCT' period_name, -100 YTD FROM DUAL UNION ALL
    SELECT '1314-03:OCT' period_name, -1250 YTD FROM DUAL UNION ALL
    SELECT '1314-03:OCT' period_name, 10922 YTD FROM DUAL UNION ALL
    SELECT '1314-02:SEP' period_name, -100 YTD FROM DUAL UNION ALL
    SELECT '1314-01:AUG' period_name, 0 YTD FROM DUAL UNION ALL
    SELECT '1314-00:OBL' period_name, 0 YTD FROM DUAL UNION ALL
    SELECT '1213-14:CBL' period_name, -350 YTD FROM DUAL UNION ALL
    SELECT '1213-13:ADJ' period_name, -350 YTD FROM DUAL UNION ALL
    SELECT '1213-12:JUL' period_name, -100 YTD FROM DUAL
    )    SELECT  period_name
               , ytd
            FROM tbl_data;
    

    I need to create a view that includes the 2 tables inline (sorry if this is the incorrect terminology), using this SQL:

    CREATE OR REPLACE FORCE VIEW APPS.XX_TEST2
    (
        period_name
      , ytd
    )
    AS
    with tbl_data AS
    (
    SELECT '1314-03:OCT' period_name, -100 YTD FROM DUAL UNION ALL
    SELECT '1314-03:OCT' period_name, -1250 YTD FROM DUAL UNION ALL
    SELECT '1314-03:OCT' period_name, 10922 YTD FROM DUAL UNION ALL
    SELECT '1314-02:SEP' period_name, -100 YTD FROM DUAL UNION ALL
    SELECT '1314-01:AUG' period_name, 0 YTD FROM DUAL UNION ALL
    SELECT '1314-00:OBL' period_name, 0 YTD FROM DUAL UNION ALL
    SELECT '1213-14:CBL' period_name, -350 YTD FROM DUAL UNION ALL
    SELECT '1213-13:ADJ' period_name, -350 YTD FROM DUAL UNION ALL
    SELECT '1213-12:JUL' period_name, -100 YTD FROM DUAL
    ), got_analytics AS
        (
            SELECT  
                period_name,
                ytd,
                ROW_NUMBER () OVER (ORDER BY  period_name)  AS a_num,
                ROW_NUMBER () OVER (ORDER BY  period_name  DESC)  AS d_num,
                FIRST_VALUE (ytd) OVER (ORDER BY  period_name) - FIRST_VALUE (ytd) OVER (ORDER BY  period_name  DESC) AS dif
        FROM    tbl_data
        )
        SELECT  *
           FROM got_analytics;
    

    I get this message:

    ORA-24344: success with compilation error

    There are no other errors but to provide additional information. I am using TOAD.

    I was wondering if it is not possible to create a view in this way, or if I'm missing something?

    I had a peek here:

    ORA-24344: success with Compilation error

    I'm using TOAD, trying to SHOW the ERRORS immediately after the code above only returned 'No Errors'.

    I also looked here:

    ORA-24344: success with compilation error

    Ran the same code SQL/Plus, but "Show Errors" or "see the err" also returned "No. Errors."

    Any advice would be much appreciated.

    Thank you very much.

    Hello

    Try this

      CREATE OR REPLACE FORCE VIEW  APPS.XX_TEST2
        (
            period_name
          , ytd
          ,  a_num    -- because you select * you need all rows
          ,  d_num
          ,  dif
        )
        AS  ...
    

    concerning
    Kay

  • How to create a Viewer without buying the image? I want to be able to save the images I'm looking a subject without purchase or download.

    How to create a Viewer without buying the image? I want to be able to save the images I'm looking a subject without purchase or download.

    After talking to the Customer Service, I now get it. Thank you.

    That is to say: down arrow recorded a watermark image in the gallery without you buy. You can download an overview lores on your desktop for motorhomes with this same arrow, but it is unfortunately a watermark (unlike the DPC). You can also copy and send a link to the Gallery clients to review before you buy.

  • Create a view using the table

    Hi all

    I am beginner in Oracle.

    I have a two-column table that I use to create a view documents/statement once it meets the qualification.

    The table has fields. 1 number and 2. Group. If there is more than 3 records found on this table with the same NUMBER and the GROUP he should create this table view.

    Thank you

    Pramod Devkate

    The training is therefore two lines for a ticket and the agent. When the third row is added, create a line in the summary table. Later a fourth line is added to the table of training for this ticket and the agent, but we do not update the line in the summary table. We only touch the summary table when the third row is added to the training table, then it is only updated by the application. Very well

    INSERT INTO summary (ticket, agent, total_travel, total_mtts)

    Select ticket agent, sum (travel), sum (mtts)

    training

    where (ticket, agent) not in

    (select the ticket agent summary)

    Group ticket, agent

    having count (*) > 2.

    This inserts in the table only notes and agent ID that do not exist already.

  • Creating a view in a new schema

    I use the Oracle SQL Developer 10g client.  I want to know how to create a view in the diagram. I have a schema that has all of my table and the views. I want to create a view in a pattern that has no data. It is only to look at a goal only of the view I want to create.

    Thank you

    Kevin

    As I said.

    Connection to the schema where the table exists

    Grant select on to

    Connect to the new schema

    Create view select * from .;.

    What you want?

  • Create Materialized view and Materialized view log.

    I wanted to create a materialized view with option "REFRESH QUICKLY YOU COMMIT".

    (1) table 1 - it is partitioned range + list - added primary key

    (2) View1 - having primary keys on the base table of view

    Steps to follow:

    (1) create the materialized on Table1; view journal -primary key by default

    (2) create the materialized on view1 view log.  -It gives below error.

    ORA-00942: table or view does not exist

    I wanted to create Materialized view as below

    create a materialized view

    Quickly REFRESH ON validation

    as

    Select...

    ........

    ... from table1

    where c1 (select c1 from View1 which...);


    Question:

    (1) because I am getting above error when creating journal of MV on the view. Can one create log view MV or we create a MV newspaper on the base table of view?

    (2) to create the MV with "REFRESH QUICKLY YOU COMMIT' option, we need to have the primary key on the main tables?


    Pointers on this will be really useful.


    Thank you

    Prasad

    "When a materialized view is maintained by the ON COMMIT method, the time required to perform the validation can be slightly longer than usual." This is because the refresh operation is performed as part of the validation process. This is why this method may not be suitable if many users at the same time change the tables on which is based the materialized view. »

    See: basis of materialized views (refreshment options) for all the other options and how they work.

  • Creating a view using causes error ORA-00600

    Hello ladies and gentlemen,

    I tried to deploy a recursive query, as a point of view in Oracle XE and Standard Edition, nor a lot of success.

    The query is in this issue here: http://stackoverflow.com/questions/17358109/how-to-retrieve-all-recursive-children-of-parent-row-in-oracle-sq

    with recursion_view(base, parent_id, child_id, qty) as (
       -- first step, get rows to start with
       select 
      parent_id base, 
      parent_id, 
      child_id, 
      qty
      from 
      md_boms
    
      union all
    
      -- subsequent steps
      select
       -- retain base value from previous level
      previous_level.base,
       -- get information from current level
      current_level.parent_id,
      current_level.child_id,
       -- accumulate sum 
       (previous_level.qty + current_level.qty) as qty 
      from
      recursion_view previous_level,
      md_boms current_level
      where
      current_level.parent_id = previous_level.child_id
    
    )
    select 
      base, parent_id, child_id, qty
    from 
      recursion_view
    order by 
      base, parent_id, child_id

    The query itself works and returns the results. However, when I try to create a view with this query, I get errors.

    I posted two screenshots: http://www.williverstravels.com/JDev/Forums/StackOverflow/17358109/ViewError.jpg and http://www.williverstravels.com/JDev/Forums/StackOverflow/17358109/InternalError.jpg one with the! and * is when I am using JDeveloper 11g, using the navigation database, right-click on the view and select "New View". I get the error when I click on OK. I can indeed create the view through a sql script, but when I try to view the data, I get the error ORA_00600.

    I tried it work on my machine the two premises for XE (version 11.2.0.2.0) and 11g Standard Edition (11.2.0.2.v6) via Amazon Web Services. The result is the same.

    Does anyone know how to get around this problem?

    Not 5 minutes after I have this post, I decide not to use the graphical editor of JDev and simply write

    SELECT * FROM BOMS_VIEW;

    And it works like a charm.  I can not just use data tab to display records in the editor.  Wish I'd known that there is 5 hours.

  • How to create a view?

    Hi all

    11.2.0.1


    I have tables EMP and DEP, and their structures are the ff:

    DEP (depno, depname)
    EMP (emp_id, depno)

    I want to create a view EMP_VIEW (emp_id, status).

    The status value is "Active" (if depno exists in DEP) or 'Inactive' (if depno is null or not depno corresponding to the DEP).

    How to create this view?

    Thank you very much

    zxy

    Check this box

    SQL> insert into emp(empno,ename) values (1234,'test');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> create or replace view emp_view as  select e.empno, nvl2( d.deptno,'Active','Inactive') Status from emp e left outer join dept d on e.deptno=d.deptno;
    
    View created.
    
    SQL> select * from emp_view;
    
         EMPNO STATUS
    ---------- --------
          7369 Active
          7499 Active
          7521 Active
          7566 Active
          7654 Active
          7698 Active
          7782 Active
          7788 Active
          7839 Active
          7844 Active
          7876 Active
          7900 Active
          7902 Active
          7934 Active
          1234 Inactive
    
    15 rows selected.
    
  • Associate data to create a view.

    I am currently using a database of Oracle 10.2.0.4.0. I work for the Department of public safety and I am trying to create an Oracle Forms Application that will be used to track information of the mandate. I need to create a view that I can use in my form that will allow me to the warrants list who are associated with each other. In the forms I create these associations in a table by using primary keys for these records.

    I created a few fictitious tables with data that you can use to help me create the SQL I can use in the creation of the view, that I need, I hope.
    CREATE TABLE order_info
    (wp_id             number(12)   primary key,
     info              varchar2(10),
     order_no          number(12)   not null,
     order_name        varchar2(30) not null);
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (1, 'AXE', 123456, 'DOE, JOHN P');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (2, null, 245645, 'DOE, JOHN P');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (3, 'SHOVEL', 354654, 'DOE, JOHN P');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (4, 'PAIL', 432110, 'DOE, JONATHAN');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (5, null, 514654, 'DOE, JOHN');
     
    insert into order_info (wp_id, info, order_no, order_name)
    values (6, null, 687980, 'DOE, JONATHAN');
    
    commit;
     
    CREATE TABLE associate_order
    (wp_id             number(12)   not null,
     associated_wp_id  number(12)   not null,
     constraint assoc_wp_ip_fk
       foreign key (associated_wp_id)
       references order_info(wp_id));
     
    insert into associate_order (wp_id, associated_wp_id)
    values (2, 1);
    
    insert into associate_order (wp_id, associated_wp_id)
    values (3, 1);
    
    insert into associate_order (wp_id, associated_wp_id)
    values (5, 3);
    
    insert into associate_order (wp_id, associated_wp_id)
    values (6, 4);
    
    commit;
     
    Once the tables are created, the table ORDER_INFO contains detailed information (in real life, it comes to the information related to a mandate). The ASSOCIATE_ORDER table contains the relationships between the records in the ORDER_INFO table. The ASSOCIATE_ORDER table is the one I want to use to create a view that I use in my Application Forms to list all of the warrants that are associated with each other.

    If you look at the data in the ASSOCIATE_ORDER table:
    WP_ID ASSOCIATED_WP_ID
    ----- ----------------
        2                1
        3                1
        5                3
        6                4
    WP_ID 2 is associated with WP_ID 1
    WP_ID 3 is associated with WP_ID 1
    WP_ID 5 is associated with WP_ID 3
    6 WP_ID is associated with 4 WP_ID

    I want to be able to do in the view that I have create is something like:
    SELECT associated_wp_id
      FROM ORDER_VIEW
     WHERE WP_ID = 3;
    And he have all the primary keys for the warrants (orders in this case) come back to me:
    ASSOCIATED_WP_ID
    ----------------
                   1
                   2
                   3
                   5
    The WP_ID of 1 is not included in the ASSOCIATE_ORDER table, because it is not associated with a previous mandate (order in this case), but because it is associated with WP_ID 2 and 3 I think.

    Here are all the commands associated together based on the data that is in the table. There may be 0 to many of these records in the ASSOCIATE_ORDER table, but if they reference a primary key (WP_ID) so I want to include in the view.

    I really hope that makes sense. I tried to play a little with analytics, but I'm not even close to the selection of any of the data that I want, so I can't yet show you what I've tried because it probably doesn't even have sense.

    Thanks in advance - mike

    In order to clean your database if you filled with the scripts above, you can do the following:
    drop table associate_order;
    drop table order_info;

    Hello

    I know right what you want the view to look like.
    Given the example of data you posted, that's what you want to the content of the view?

    WP_ID INFO         ORDER_NO ORDER_NAME       WP_ID_GRP
    ----- ---------- ---------- --------------- ----------
        1 AXE            123456 DOE, JOHN P              1
        2                245645 DOE, JOHN P              1
        3 SHOVEL         354654 DOE, JOHN P              1
        4 PAIL           432110 DOE, JONATHAN            4
        5                514654 DOE, JOHN                1
        6                687980 DOE, JONATHAN            4
    

    ? You will notice that it is just order_info, with an additional column, wp_id_grp, added. Wp_id_grp is the lowest related wp_id. For example, wp_ids 1, 2, 3, and 5 are all related, so they all have wp_id_grp = 1.

    Here's a way to do it:

    CREATE OR REPLACE VIEW order_info_grp
    AS
    WITH     got_pairs     AS
    (
         SELECT     wp_id               AS x_id
         ,     associated_wp_id     AS y_id
         FROM     associate_order
        UNION
         SELECT     associated_wp_id     AS x_id
         ,     wp_id               AS y_id
         FROM     associate_order
    )
    ,     got_relatives     AS
    (
         SELECT     CONNECT_BY_ROOT x_id     AS wp_id
         ,     y_id
         FROM     got_pairs
         CONNECT BY NOCYCLE     y_id     = PRIOR x_id
    )
    ,     got_wp_id_grp     AS
    (
         SELECT       wp_id
         ,       MIN (y_id)     AS wp_id_grp
         FROM       got_relatives
         GROUP BY  wp_id
    )
    SELECT       o.*
    ,       g.wp_id_grp
    FROM       order_info     o
    JOIN       got_wp_id_grp g  ON  o.wp_id  = g.wp_id
    ;
    

    If you want a view which only has the columns wp_id and wp_id_grp, then everything just omit the main request; got_wp_id_grp, it's just what you want.

    I guess that the associate_order relationship is reflexive. In other words, instead of:

    insert into associate_order (wp_id, associated_wp_id)
    values (2, 1);
    

    you have it, could just as well, says:

    insert into associate_order (wp_id, associated_wp_id)
    values (1, 2);
    

    In other words, all that matters is that 1 and 2 are linked. What number goes in which column is not relevant.

    In table assoiciate_order, why is there a foreign key on associated_wp_id constraint, but not on wp_id?

    CONNECT BY is never terribly effective, and NOCYCLE does only make it worse. Depending on your data, in particular how different wp_ids can be in a related group, this may not be practical. You might consider adding a column wp_id_grp in the associate_order table, rather than owning a view and containing a PL/SQL (which would be faster) procedure re - fill this column when associate_order is changed.

    Published by: Frank Kulash on April 17, 2013 18:33

    MLBrown wrote:
    I think I left mouth stumped the Panel...

    Be patient! It's true that the median time for a first response on this forum is less than 10 minutes, but it's because the first response often only pointed out that we need more information. When you provide all the sample data, and a good explanation of the problem, as you did, then people can begin to solve the problem instead of complaining, complaining is so much faster than problems.

  • We can create a view or table with a form button?

    We can create a view or table with a form button using forms 6i?
    If Yes, what will be the command?

    Gul says:
    We can create a view or table with a form button using forms 6i?
    If Yes, what will be the command?

    Yes. You can. Use the FORMS_DDL built-in. For example

    BEGIN
      Forms_DDL('create table temp(n NUMBER)');
      IF NOT FORM_SUCCESS THEN
        Message ('Table Creation Failed');
      ELSE
        Message ('Table Created');
      END IF;
    END; 
    

    Hope this helps

    Hamid

  • create materialized view log on the table without a primary key

    Hi all
    CREATE TABLE client_months 
    (
      SUBJ_CODE         NUMBER(4),
      SERV_CODE         NUMBER(4),
      DEBIT_CODE        NUMBER(4),
      PERIOD_NUM        NUMBER(2),
      PERIOD_NAME       VARCHAR2(40 CHAR),
      FIRST_MON_DAY     DATE,
      LAST_MON_DAY      DATE,
      VALUE_MON_DAY     DATE,
      MONTHES           NUMBER(4,2),
      GARDENING_WEIGHT  NUMBER(5,4),
      REASON_CODE       NUMBER(5),
      STAMP_ACTION      VARCHAR2(1 CHAR),
      STAMP_CDATE       DATE                        DEFAULT SYSDATE,
      STAMP_DATE        DATE,
      STAMP_USER        VARCHAR2(15 CHAR),
      REGION_CODE       NUMBER(9)
    )
    table created.
    
    CREATE UNIQUE INDEX client_months_UK  ON client_months 
    (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
    index created.
    
    CREATE MATERIALIZED VIEW LOG ON client_months with rowid;
    
    CREATE MATERIALIZED VIEW client_months_mv 
    BUILD immediate 
    REFRESH FAST ON COMMIT 
    AS 
    SELECT * FROM client_months;
    
    ORA-12014: table 'CLIENT_MONTHS' does not contain a primary key constraint
    I don't want to refresh the mview when validation is performed on the base table.
    And I don't want to change the base table by adding a primary key.

    is it possible to create the mview journal using the unique index? or another solution?
    Please help
    Thanks in advance
    Naama

    Naamas wrote:
    No,
    I already read this post!

    Then you read wrong:

    SQL> CREATE TABLE client_months
      2  (
      3    SUBJ_CODE         NUMBER(4),
      4    SERV_CODE         NUMBER(4),
      5    DEBIT_CODE        NUMBER(4),
      6    PERIOD_NUM        NUMBER(2),
      7    PERIOD_NAME       VARCHAR2(40 CHAR),
      8    FIRST_MON_DAY     DATE,
      9    LAST_MON_DAY      DATE,
     10    VALUE_MON_DAY     DATE,
     11    MONTHES           NUMBER(4,2),
     12    GARDENING_WEIGHT  NUMBER(5,4),
     13    REASON_CODE       NUMBER(5),
     14    STAMP_ACTION      VARCHAR2(1 CHAR),
     15    STAMP_CDATE       DATE                        DEFAULT SYSDATE,
     16    STAMP_DATE        DATE,
     17    STAMP_USER        VARCHAR2(15 CHAR),
     18    REGION_CODE       NUMBER(9)
     19  )
     20  /
    
    Table created.
    
    SQL> CREATE UNIQUE INDEX client_months_UK  ON client_months
      2  (SUBJ_CODE, SERV_CODE, DEBIT_CODE, PERIOD_NUM, REGION_CODE)
      3  /
    
    Index created.
    
    SQL> CREATE MATERIALIZED VIEW LOG ON client_months with rowid
      2  /
    
    Materialized view log created.
    
    SQL> CREATE MATERIALIZED VIEW client_months_mv
      2  BUILD immediate
      3  REFRESH FAST WITH ROWID ON COMMIT -- pay attention to WITH ROWID
      4  AS
      5  SELECT * FROM client_months
      6  /
    
    Materialized view created.
    
    SQL>
    

    SY.

  • 'Invalid metadata objects' when creating materialized views

    Hi experts,

    I ran into some trouble. I had an analytic workspace that has grown too quickly (see 11.2.0.2 size AW grows regularly with each generation of cube so I deleted and created a new.)

    He seemed to do very well with the tip David Greenfield, gave us in the mentioned forum post, but when I try to activate materialized views (that I had activated in the previous workspace) I am gettig the following error:

    -----
    Your metadata changes have been saved, with the following errors
    Invalid metadata objects:
    Invalid object "TABLESPACE. LECTURAS': 'CREATE A MATERIALIZED VIEW 'TABLESPACE' '. "CB$ LECTURAS.
    ORGANIZATION OF CUBE ON THE TABLESPACE. () TABLESPACE_AW
    MADE "LECTURAS_STORED"("LECTURAS_MEASURE_DIM" "LECTURA") IS "LECTURA"
    DIMENSION "TIEMPO" IS "TIEMPO", WITH THE HELP OF "TIEMPO_TIEMPO_HOUR_ID_UNIQUE_KEY."
    DIMENSION 'GEOGRAPHY' IS 'GEOGRAPHY' WITH THE HELP OF 'GEOGRAFIA_GEOGRAFIA_CONTADOR_ID_UNIQUE_KEY')
    POSTPONED BUILD
    UPDATE ON REQUEST
    FORCE
    WITH THE HELP OF CONSTRAINTS OF TRUST
    AS
    (
    SELECT
    TO_CHAR (T1." FEC_LECTURA', "dd/mm/yyyy hh24:mi:ss") "TIEMPO"
    T1. "" COD_METERID ""GEOGRAPHY. "
    SUM (T1." VAL_AI_HOR') "LECTURA".
    Of
    TABLESPACE. "' LECTURA_HORARIA_FINAL ' T1
    GROUP BY
    (TO_CHAR (T1." (FEC_LECTURA"," hh24:mi:ss dd/mm/yyyy '), T1. ("' COD_METERID")
    )
    ORA-00942: table or view does not exist
    "
    -----

    This same script running in SQLDeveloper gives the same error in line 17, which is the FROM clause. BUT I can run the select by itself and returns the expected result. If the table exists in the correct storage space.

    I must be missing something big...

    Thanks in advance.

    Joan

    P.S.: In the above code I use 'SPACE' to replace the real name from username and a tablespace (which is the same) for reasons of confidentiality.

    When you run the select statement, you connect to the same user you are trying to activate the VM?

    You can create a standard (No cube) MV with the same select statement? (Connected to the same user that 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}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    

Maybe you are looking for