VIEW Query Problem

Hi Greg,
I had created a view on a table which doesn't have Primary Key, but it has Unique and Not Null constraints on required columns.
I had wrote a procedure to query the data on VIEW. I have experienced strange problem, very first call to procedure will take more time than succeeding requests. For example from second request onwards, it returns data in < 2 Sec, but first transaction is taking 12 Sec to 30 Sec.
I thought that very first time VIEW is taking time to refresh it self. So, I added FORCE keyword in CREATE VIEW stattement. However, that doesn't helped out.
In my further investigation I came to know that base table on which VIEW created, has to be loaded in to memory before querying on VIEW.
So, I had executed a simple select statement on base table, before I execute VIEW query in procedure.
With this change I got results consistently < 2 Sec all the times.
My question is instead of executing the select statement on base table is there a way to load base tables data in memory before querying on VIEW?
Thanks,
Subbarao

Hi,
A view is nothing but parsed SQL statements stored in the database, a view may or may not run faster. If you execute the SQL used to define the view how much time is it taking. If you want try looking at MATERIALIZED VIEW , that may help you.
thanks

Similar Messages

  • Spatial vs. materialized views/query rewrite

    Dear all,
    we are trying to use Spatial (Locator) functionality together with performance optimization using materialized views and query rewrite, and it does not seem to work. Does anybody has experience with this?
    The problem in more detail:
    * There is a spatial attribut (vom Typ GEOMETRY) in our table;
    * we define a materialized view on that table;
    * we run a query that could be better answered using the materialized view with query rewrite;
    *the optimizer does not choose the plan using the materialized view, query rewrite does not take place;
    This happenes, even if neither the materialized view, nor the query contains the spatial attribut.
    The explanation given by the procedure DBMS_MVIEW.Explain_Rewrite is:
    "QSM-01064 query has a fixed table or view Cause: Query
    rewrite is not allowed if query references any fixed tables or views"
    We are using Oracle 9R2, Enterprise Edition, with locator. Nevertheless, it would also be interesting, if there is any improvement in 10g?
    A more complicated task, using materialized views to optimize spatial operations (e.g., sdo_relate) would also be very interesting, as spatial joins are very expensive operations.
    Thanks in advance for any comments, ideas!
    Cheers,
    Gergely Lukacs

    Hi Dan,
    thanks for your rapid response!
    A simple example is:
    alter session set query_rewrite_integrity=trusted;
    alter session set query_rewrite_enabled=true;
    set serveroutput on;
    /* Creating testtable */
    CREATE TABLE TESTTABLE (
    KEY1 NUMBER (4) NOT NULL,
    KEY2 NUMBER (8) NOT NULL,
    KEY3 NUMBER (14) NOT NULL,
    NAME VARCHAR2 (255),
    X NUMBER (9,2),
    Y NUMBER (9,2),
    ATTR1 VARCHAR2 (2),
    ATTR2 VARCHAR2 (30),
    ATTR3 VARCHAR2 (80),
    ATTR4 NUMBER (7),
    ATTR5 NUMBER (4),
    ATTR6 NUMBER (5),
    ATTR7 VARCHAR2 (40),
    ATTR8 VARCHAR2 (40),
    CONSTRAINT TESTTABLE_PK
    PRIMARY KEY ( KEY1, KEY2, KEY3 ));
    /* Creating materialized view */
    CREATE MATERIALIZED VIEW TESTTABLE_MV
    REFRESH COMPLETE
    ENABLE QUERY REWRITE
    AS SELECT DISTINCT ATTR7, ATTR8
    FROM TESTTABLE;
    /* Creating statistics, just to make sure */
    execute dbms_stats.gather_table_stats(ownname=> 'TESTSCHEMA', tabname=> 'TESTTABLE', cascade=>TRUE);
    execute dbms_stats.gather_table_stats(ownname=> 'TESTSCHEMA', tabname=> 'TESTTABLE_MV', cascade=>TRUE);
    /* Explain rewrite procedure */
    DECLARE
    Rewrite_Array SYS.RewriteArrayType := SYS.RewriteArrayType();
    querytxt VARCHAR2(1500) :=
    'SELECT COUNT(*) FROM (
    SELECT DISTINCT
    ATTR8 FROM
    TESTTABLE
    i NUMBER;
    BEGIN
    DBMS_MVIEW.Explain_Rewrite(querytxt, 'TESTTABLE_MV', Rewrite_Array);
    FOR i IN 1..Rewrite_Array.count
    LOOP
    DBMS_OUTPUT.PUT_LINE(Rewrite_Array(i).message);
    END LOOP;
    END;
    The message you get is:
    QSM-01009 materialized view, string, matched query text
    Cause: The query was rewritten using a materialized view, because query text matched the materialized view text.
    Action: No action required.
    i.e. query rewrite works!
    /* Adding geometry column to the testtable -- not to the materialized view, and not to the query! */
    ALTER TABLE TESTTABLE
    ADD GEOMETRYATTR mdsys.sdo_geometry;
    /* Explain rewrite procedure */
    DECLARE
    Rewrite_Array SYS.RewriteArrayType := SYS.RewriteArrayType();
    querytxt VARCHAR2(1500) :=
    'SELECT COUNT(*) FROM (
    SELECT DISTINCT
    ATTR8 FROM
    TESTTABLE
    i NUMBER;
    BEGIN
    DBMS_MVIEW.Explain_Rewrite(querytxt, 'TESTTABLE_MV', Rewrite_Array);
    FOR i IN 1..Rewrite_Array.count
    LOOP
    DBMS_OUTPUT.PUT_LINE(Rewrite_Array(i).message);
    END LOOP;
    END;
    The messages you get are:
    QSM-01064 query has a fixed table or view
    Cause: Query rewrite is not allowed if query references any fixed tables or views.
    Action: No action required.
    QSM-01019 no suitable materialized view found to rewrite this query
    Cause: There doesn't exist any materialized view that can be used to rewrite this query.
    Action: Consider creating a new materialized view.
    i.e. query rewrite does not work!
    If this works, the next issue is to use materialized views for optimizing spatial operations, e.g., a spatial join. I can supply you with an example, if necessary (only makes sense, I think, after the first problem is solved).
    Thanks in advance for any ideas, comments!
    Cheers,
    Gergely

  • Reg: fetch the data by using item_id which is retuned by In line View Query

    Hi all,
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items1(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items1 values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_quantity(item_id number);
    insert into xxc_quantity values (123);
    create table xxc_quantity_1(item_id number);
    insert into xxc_quantity_1 values (123);
    SELECT union_id.item_id,
           b.org_id,
           e.name,
           fun1(union_id.item_id) item_no
    FROM   xxc_transactions a,
           xxc_items1 b,
           xxc_headers c,
           xxc_lines d,
           xxc_types_tl e,
           (SELECT item_id
            FROM   xxc_quantity
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_quantity_1
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_transactions
            WHERE  item_id = 123) union_id
    WHERE  a.type_id = 6
           AND a.item_id  = b.item_id
           AND union_id.item_id = b.item_id
           AND a.org_id = b.org_id
           AND c.header_id = d.header_id
           AND d.line_id = a.trx_line_id
           AND d.item_id = b.item_id
           AND c.order_id = e.transaction_id
           AND b.org_id = 12
    GROUP  BY union_id.item_id,
              b.org_id,
              e.name
    ORDER  BY union_id.item_id;
    create or replace function fun1(v_item in number)
    return varchar2
    is
    v_item_no
    Begin
       select item_no from xxc_items1
       where item_id=v_item;
       return v_item_no ;
        Exception
         When Others Then
          v_item_no := null;
          return v_item_no;
    END fun1;
    I  need  fetch the data by using item_id which is retuned by In line View Query(UNION)
    item_id  org_id  name    item_no
    123        12        abc       book
    Version: 11.1.0.7.0  and 11.2.0.1.0
    Message was edited by: Rajesh123 Added test cases script
    Message was edited by: Rajesh123 changed Question as fetch the data by using item_id which is retuned by In line View Query(UNION)

    Hi Master , sorry for the late reply and can you please help on this?
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_uinon_table(item_id number);
    insert into xxc_types_tl values(123);
    SELECT   union_id.item_id,
             b.org_id ,
             e.name ,
             fun1(union_id.item_id) item_no   --> to get item_no
             FORM xxc_transactions a,
             xxc_items             b,
             xxc_headers           c,
             xxc_lines             d,
             xxc_types_tl          e,
             ( SELECT item_id
                 FROM   xxc_uinon_table ) union_id
    WHERE    a.type_id= 6
    AND      a.item_id = b.item_id
    AND      union_id.item_id = b.item_id
    AND      a.org_id = b.org_id
    AND      c.header_id = d.header_id
    AND      d.line_id= a.trx_line_id
    AND      d.item_id= b.item_id
    AND      c.order_id= e.transaction_id ---106
    AND      b.org_id = 12
    GROUP BY union_id.item_id,
             b.org_id ,
             e.name
    ORDER BY union_id.item_id;
    Note: xxc_uinon_table is a combination of UNION's
    select 1 from dual
    union
    select 1 from dual
    union
    select no rows returned  from dual;
    I will get 1 from the above Query
    Thank you in advanced

  • Creating a Hierarchy Viewer query

    Hello,
    I'm having huge difficulties creating a Hierarchy Viewer Query. I've looked through the source code contained withing the demo, but it seems to require great knowledge regarding the component. I'm using a three-node model, each node grouped within it's parent.
    So I created a custom View to be used as a result list for the query and this part is working just fine. I can pick the unique ID for the node I want from the search results when the user selects one, but I don't know how I can make that specific node my "anchor", my "current node", after that.
    Since I'm looking for a specific "contact_id" selected from the search results, I think the correct way of doing it is finding it's node on the TreeModel, and then setting it as my current anchor.
    Please, any tips, directions or suggestions on how can I go about doing this?
    Thanks!!

    Hi!
    Thanks for the attention, but I've been through all the basic stuff. The HV documentation only teaches the most primitive part of it. I searched all blogs related to HV, all articles I could find, I've meddled with the demo source code and all I can think of, but I couldn't find anyone who would give much insight on the mechanics of the component or how to build a really powerful search engine for it.
    As a sugestion for the developer team, it would be great if the query for this component allowed us to specify actions to be performed on all levels of the tree, instead of only the root node, since most of the time people use HV as a multi-root tree.

  • Materialized view query (Oracle 9i)

    I have dropped a materialized view query and trying to create the same with additional columns in the prebuilt table.
    Option - 1
    when Iam using a query in the materialized view query "select * from schema.table@link, with refresh mode fast option, the database throws an error " no table or view exists"
    Option - 2
    When Iam using a query in the materialized view query "select * from schema.table@link, with refresh mode option either complete or force, it gets created.
    I need to create the above materialized view query in the fast mode option, Please help.
    -bala

    Hi,
    Does a table named profit_mvw already exist?
    The following example illustrates the two steps required to register a user-defined table. First, the table is created, then the materialized view is defined using exactly the same name as the table. This materialized view sum_sales_tab is eligible for use in query rewrite.
    CREATE TABLE sum_sales_tab
    PCTFREE 0 TABLESPACE demo
    STORAGE (INITIAL 16k NEXT 16k PCTINCREASE 0) AS
    SELECT s.prod_id, SUM(amount_sold) AS dollar_sales,
    SUM(quantity_sold) AS unit_sales
    FROM sales s GROUP BY s.prod_id;
    CREATE MATERIALIZED VIEW sum_sales_tab
    ON PREBUILT TABLE WITHOUT REDUCED PRECISION
    ENABLE QUERY REWRITE AS
    SELECT s.prod_id, SUM(amount_sold) AS dollar_sales,
    SUM(quantity_sold) AS unit_sales
    FROM sales s GROUP BY s.prod_id;
    Regards,
    Simon

  • Designing LOV Query Problem

    Hello APEX people,
    I posted my problem here:
    Designing LOV Query Problem
    What I have is a sequence like this:
    CREATE SEQUENCE
    DR_SEQ_FIRST_SCHEDULE_GROUP
    MINVALUE 1 MAXVALUE 7 INCREMENT BY 1 START WITH 1
    CACHE 6 ORDER CYCLE ;
    What I need would be a SQL query returning all possible values oft my sequence like:
    1
    2
    3
    4
    5
    6
    7
    I want to use it as a source for a LOV...
    The reason why I use the cycling sequence is: My app uses it to cycle scheduling priorities every month to groups identified by this number (1-7).
    In the Admin Form, I want to restrict the assignment in a user friendly way - a LOV.
    Thanks
    Johann

    Here ist the solution (posted by michales in the PL/SQL forum):
    SQL> CREATE SEQUENCE
    dr_seq_first_schedule_group
    MINVALUE 1 MAXVALUE 7 INCREMENT BY 1 START WITH 1
    CACHE 6 ORDER CYCLE
    Sequence created.
    SQL> SELECT LEVEL sn
    FROM DUAL
    CONNECT BY LEVEL <= (SELECT max_value
    FROM user_sequences
    WHERE sequence_name = 'DR_SEQ_FIRST_SCHEDULE_GROUP')
    SN
    1
    2
    3
    4
    5
    6
    7
    7 rows selected.

  • ORA-01762: vopdrv: view query block not in FROM ????

    Hi All
    any one aware of the error.
    ORA-01762: vopdrv: view query block not in FROM
    Please reply back.

    ORA-01762:vopdrv: view query block not in FROM
    Cause:This is an internal error message not normally issued.
    Action:Contact Oracle Support Services.
    Edited by: Karthick_Arp on Sep 23, 2008 11:01 PM

  • Declaratively set the value of a bind parameter in a view query

    Can I declaratively set that I want the value of the bind parameter in the view query to be the value of a specific field in the current row of a specific iterator in my data bindings? Thanks :D

    user11976105 wrote:
    Hm I guess I should mention I'm doing the retrieval in Java, using a ValueChangeListenerIn this case, you will still need to bind an ExecuteWithParams action to your page definition and execute it from your ValueChangeListener after supplying its named data.
    In the code spinet, the new value from the ValueChangeEvent is passed to the bind variable.
    public void yourValidChangeListener(ValueChangeEvent valueChangeEvent) {
        // get the ExecuteWithParameters operation binding from the bindings
        OperationBinding executeWithParameters = ADFUtils.findOperation("yourExecuteWithParametersBindingId");
        // setup bind variable using the new value from the valueChangeEvent
        executeWithParameters.getParamsMap().put("yourParameterId", valueChangeEvent.getNewValue());
        // execute
        executeWithParameters.execute();
        // check for errors
        if(executeWithParameters.getErrors().size() != 0) {
            // error(s) occured
    }

  • SQL+-MULTI TABLE QUERY PROBLEM

    HAI ALL,
    ANY SUGGESTION PLEASE?
    SUB: SQL+-MULTI TABLE QUERY PROBLEM
    SQL+ QUERY GIVEN:
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE FROM PATIENTS_MASTER1, HAEMATOLOGY1,
    DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM AND PATIENT_NUM = DLC_PATIENT_NUM AND PATIENT_NUM
    = &PATIENT_NUM;
    RESULT GOT:
    &PATIENT_NUM =1
    no rows selected
    &PATIENT_NUM=2
    no rows selected
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    ACTUAL WILL BE:
    &PATIENT_NUM=1
    PATIENT_NUM 1
    PATIENT_NAME BBBB
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 5
    HMTLY_RBC_NORMAL 4.6-6.0
    &PATIENT_NUM=2
    PATIENT_NUM 2
    PATIENT_NAME GGGG
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     42
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    &PATIENT_NUM=3
    PATIENT_NUM 3
    PATIENT_NAME KKKK
    HMTLY_TEST_NAME HAEMATOLOGY
    HMTLY_RBC_VALUE 4
    HMTLY_RBC_NORMAL 4.6-6.0
    DLC_TEST_NAME DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE     60
    DLC_POLYMORPHS_NORMAL_VALUE     40-65
    4 TABLES FOR CLINICAL LAB FOR INPUT DATA AND GET REPORT ONLY FOR TESTS MADE FOR PARTICULAR
    PATIENT.
    TABLE1:PATIENTS_MASTER1
    COLUMNS:PATIENT_NUM, PATIENT_NAME,
    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BBBB
    GGGG
    KKKK
    PPPP
    TABLE2:TESTS_MASTER1
    COLUMNS:TEST_NUM, TEST_NAME
    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HAEMATOLOGY
    DIFFERENTIAL LEUCOCYTE COUNT
    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM,HMTLY_PATIENT_NUM,HMTLY_TEST_NAME,HMTLY_RBC_VALUE,HMTLY_RBC_NORMAL_VALUE     
    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HAEMATOLOGY
    HAEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6-6.0
    4.6-6.0
    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS:DLC_NUM,DLC_PATIENT_NUM,DLC_TEST_NAME,DLC_POLYMORPHS_VALUE,DLC_POLYMORPHS_
    NORMAL_VALUE,
    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUCOCYTE COUNT
    DIFFERENTIAL LEUCOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    THANKS
    RCS
    E-MAIL:[email protected]
    --------

    I think you want an OUTER JOIN
    SELECT PATIENT_NUM, PATIENT_NAME, HMTLY_TEST_NAME, HMTLY_RBC_VALUE,
    HMTLY_RBC_NORMAL_VALUE, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE,
    DLC_POLYMORPHS_NORMAL_VALUE
    FROM PATIENTS_MASTER1, HAEMATOLOGY1,  DIFFERENTIAL_LEUCOCYTE_COUNT1
    WHERE PATIENT_NUM = HMTLY_PATIENT_NUM (+)
    AND PATIENT_NUM = DLC_PATIENT_NUM (+)
    AND PATIENT_NUM = &PATIENT_NUM;Edited by: shoblock on Nov 5, 2008 12:17 PM
    outer join marks became stupid emoticons or something. attempting to fix

  • View Query with DART

    Hi,
    I m tring to use the DART tool for extract tax data;
    We extact the tax data from 2 separately system SAP ECC6 (S1 et S2) with DART
    My question is :
    It is possible to use a extract file generate by S1 for executing view query in S2 system with the (FTWH) transaction
    Thank you for your help

    Hi,
    i m answer my self about this question
    it is possible to use a extraction file generated by S2 system in S1 system to query directely this file and we can also to use this file by view query transaction
    The only restriction is to use the same technical configuration for the both systems FTWP (technicals options)
    bye
    Mohamed

  • Meterlized view Refreshtime problem

    Hi,
    I have an issue with my MATERIALIZED view refreshment.
    Server170 having schema "Afccv" with the table name " Tbl_voicechat".
    Server 169 having a db link name "SERVICEDB1" point to same server.
    MATERIALIZED view on server 169 DB user "smschat" with the following code ::
    CREATE MATERIALIZED VIEW "SMSCHAT"."TBL_VOICECHAT_NEW1" TABLESPACE "SMSCHAT"
    BUILD IMMEDIATE
    REFRESH FAST
    AS SELECT <COLUMNNAMES>
    FROM AFCCV.TBL_VOICECHAT@SERVICEDB1;
    Refreshment time is 15 min.
    alter MATERIALIZED VIEW SMSCHAT.TBL_VOICECHAT_NEW1 REFRESH FAST ON DEMAND START WITH sysdate+0 NEXT sysdate+(15/86400*60);
    Also there is 5 indexes on this MATERIALIZED view.
    Problem is ::
    Sometimes it is refreshing properly in time and taking approximate 5-8 min to refresh. But sometimes it seems to be like hang or when I m checking the job for refreshment its only showing runnning.
    SQL> set time on
    11:44:02 SQL> alter session set nls_Date_format='dd-mon-yyyy hh24:mi:ss';
    Session altered.
    11:44:03 SQL> select mview_name ,last_refresh_date from dba_mviews;
    MVIEW_NAME LAST_REFRESH_DATE
    MGMT_ECM_MD_ALL_TBL_COLUMNS 20-jan-2011 11:44:40
    TBL_VOICECHAT_NEW1 07-jun-2012 09:44:54
    11:44:33 SQL> select * from dba_jobs_running;
    SID JOB FAILURES LAST_DATE LAST_SEC THIS_DATE THIS_SEC INSTANCE
    2893 252 0 07-jun-2012 09:44:51 09:44:51 07-jun-2012 11:14:06 11:14:06 0
    11:44:34 SQL>
    Now What to do and why it is not refreshing properly. DB link is working fine. no network issue is there. no locking is there on db.
    Kindly tell me where to check related to this issue. or what I can do for this.
    thanks in Advnace
    Pradeep.

    Pradeep Sharma wrote:
    Hi,
    I have an issue with my MATERIALIZED view refreshment.
    Server170 having schema "Afccv" with the table name " Tbl_voicechat".
    Server 169 having a db link name "SERVICEDB1" point to same server.
    MATERIALIZED view on server 169 DB user "smschat" with the following code ::
    CREATE MATERIALIZED VIEW "SMSCHAT"."TBL_VOICECHAT_NEW1" TABLESPACE "SMSCHAT"
    BUILD IMMEDIATE
    REFRESH FAST
    AS SELECT <COLUMNNAMES>
    FROM AFCCV.TBL_VOICECHAT@SERVICEDB1;
    Refreshment time is 15 min.
    alter MATERIALIZED VIEW SMSCHAT.TBL_VOICECHAT_NEW1 REFRESH FAST ON DEMAND START WITH sysdate+0 NEXT sysdate+(15/86400*60);
    Also there is 5 indexes on this MATERIALIZED view.
    Problem is ::
    Sometimes it is refreshing properly in time and taking approximate 5-8 min to refresh. But sometimes it seems to be like hang or when I m checking the job for refreshment its only showing runnning.
    SQL> set time on
    11:44:02 SQL> alter session set nls_Date_format='dd-mon-yyyy hh24:mi:ss';
    Session altered.
    11:44:03 SQL> select mview_name ,last_refresh_date from dba_mviews;
    MVIEW_NAME LAST_REFRESH_DATE
    MGMT_ECM_MD_ALL_TBL_COLUMNS 20-jan-2011 11:44:40
    TBL_VOICECHAT_NEW1 07-jun-2012 09:44:54
    11:44:33 SQL> select * from dba_jobs_running;
    SID JOB FAILURES LAST_DATE LAST_SEC THIS_DATE THIS_SEC INSTANCE
    2893 252 0 07-jun-2012 09:44:51 09:44:51 07-jun-2012 11:14:06 11:14:06 0
    11:44:34 SQL>
    Now What to do and why it is not refreshing properly. DB link is working fine. no network issue is there. no locking is there on db.
    Kindly tell me where to check related to this issue. or what I can do for this.
    thanks in Advnace
    Pradeep.
    >Hi,
    I have an issue with my MATERIALIZED view refreshment.
    Server170 having schema "Afccv" with the table name " Tbl_voicechat".
    Server 169 having a db link name "SERVICEDB1" point to same server.
    MATERIALIZED view on server 169 DB user "smschat" with the following code ::
    CREATE MATERIALIZED VIEW "SMSCHAT"."TBL_VOICECHAT_NEW1" TABLESPACE "SMSCHAT"
    BUILD IMMEDIATE
    REFRESH FAST
    AS SELECT <COLUMNNAMES>
    FROM AFCCV.TBL_VOICECHAT@SERVICEDB1;
    Refreshment time is 15 min.
    alter MATERIALIZED VIEW SMSCHAT.TBL_VOICECHAT_NEW1 REFRESH FAST ON DEMAND START WITH sysdate+0 NEXT sysdate+(15/86400*60);
    Also there is 5 indexes on this MATERIALIZED view.
    Problem is ::
    Sometimes it is refreshing properly in time and taking approximate 5-8 min to refresh. But sometimes it seems to be like hang or when I m checking the job for refreshment its only showing runnning.
    SQL> set time on
    11:44:02 SQL> alter session set nls_Date_format='dd-mon-yyyy hh24:mi:ss';
    Session altered.
    11:44:03 SQL> select mview_name ,last_refresh_date from dba_mviews;
    MVIEW_NAME LAST_REFRESH_DATE
    MGMT_ECM_MD_ALL_TBL_COLUMNS 20-jan-2011 11:44:40
    TBL_VOICECHAT_NEW1 07-jun-2012 09:44:54
    11:44:33 SQL> select * from dba_jobs_running;
    SID JOB FAILURES LAST_DATE LAST_SEC THIS_DATE THIS_SEC INSTANCE
    2893 252 0 07-jun-2012 09:44:51 09:44:51 07-jun-2012 11:14:06 11:14:06 0
    11:44:34 SQL>
    Now What to do and why it is not refreshing properly. DB link is working fine. no network issue is there. no locking is there on db.
    Kindly tell me where to check related to this issue. or what I can do for this.
    thanks in Advnace
    Pradeep.
    Hi All,
    Some more queries I also being use to check this process working
    11:44:34 SQL> select LAST_DATE,LAST_SEC,THIS_DATE,THIS_SEC,NEXT_DATE,NEXT_SEC,TOTAL_TIME,BROKEN from dba_jobs where job=252;
    LAST_DATE LAST_SEC THIS_DATE THIS_SEC NEXT_DATE NEXT_SEC TOTAL_TIME B
    07-jun-2012 09:44:51 09:44:51 07-jun-2012 11:14:06 11:14:06 07-jun-2012 11:14:04 11:14:04 44877 N
    11:49:28 SQL> SELECT t.used_ublk, t.used_urec FROM v$session s, v$transaction t WHERE s.taddr=t.addr and s.SID =2893 ;
    USED_UBLK USED_UREC
    389 27054
    11:49:59 SQL> /
    USED_UBLK USED_UREC
    390 27084
    11:50:02 SQL>

  • "ORA-01762: vopdrv: view query block not in FROM" while using LOG ERRORS INTO  feature for Update/Delete

    Hi
    Ours is VPD database in 11GR2. We're using "LOG ERRORS INTO " feature to track list of records violating constraints.
    For Inserts it is working as expected but for Updates/Deletes it is throwing mis. ORA- errors. "ORA-01762: vopdrv: view query block not in FROM"
    We dint find any clue when searched in net.
    Could someone help us here? Is there any limitation with "LOG ERRORS INTO" ?
    Below are the steps we're executing
    EXEC DBMS_ERRLOG.CREATE_ERROR_LOG(
    dml_table_name => 'EMP',
    err_log_table_name => 'ERR_EMP'
    > DESC EMP
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    INSERT INTO EMP VALUES('1','Test','@' /* generates Ora */,2,'2); -- ERR_EMP populated
    UPDATE EMP set SAL='@'
    where EMPNO='1' -- Throwing ORA-01762: vopdrv: view query block not in FROM
    Could someone help us?

    Hi
    Ours is VPD database in 11GR2. We're using "LOG ERRORS INTO " feature to track list of records violating constraints.
    For Inserts it is working as expected but for Updates/Deletes it is throwing mis. ORA- errors. "ORA-01762: vopdrv: view query block not in FROM"
    We dint find any clue when searched in net.
    Could someone help us here? Is there any limitation with "LOG ERRORS INTO" ?
    Below are the steps we're executing
    EXEC DBMS_ERRLOG.CREATE_ERROR_LOG(
    dml_table_name => 'EMP',
    err_log_table_name => 'ERR_EMP'
    > DESC EMP
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    INSERT INTO EMP VALUES('1','Test','@' /* generates Ora */,2,'2); -- ERR_EMP populated
    UPDATE EMP set SAL='@'
    where EMPNO='1' -- Throwing ORA-01762: vopdrv: view query block not in FROM
    Could someone help us?

  • Connecting grid to view\query

    I need some tutorial sample project explaining how to connect a grid to view\query from a DB. I failed to google it - any links?

    The grid is called JTable.
    [JTable tutorial|http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]
    You can find examples and similar questions in the [JDBC forum|http://forums.sun.com/forum.jspa?forumID=48].
    There's also a link to the [JDBC FAQ|http://java.sun.com/products/jdbc/faq.html].

  • DART: Generate program for data view query:RTXWGQ01

    Hi all,
    We've this program RTXWGQ01 which is generating programs for data view queries.
    I'd like to know what is this data view which is there on the selection screen of this program?
    Can we define Z data views, if so how? If we directly run this program in production for a data view does it automatically generate an executable program?
    Is there any transaction which runs this program in background?
    Regards
    Deepthi.

    Hi,
    i m answer my self about this question
    it is possible to use a extraction file generated by S2 system in S1 system to query directely this file and we can also to use this file by view query transaction
    The only restriction is to use the same technical configuration for the both systems FTWP (technicals options)
    bye
    Mohamed

  • Problem viewing Query Result

    Hi- I occasionally come across this issue when I run any query in SQL Developer (3.0.02), the Query Result tab shows a bold red Exclamation point and the display grid is blank. It says "Fetched 50 rows in 0.235 seconds" but the results aren't displayed. There is nothing wrong with the queries so it seems like some type of display problem but I can't figure out how to fix it. Like I said, it doesn't happen all the time and I run the same saved queries so I know it's not a problem with the actual queries. Has anyone ever seen or heard of this before?

    Hi,
    Sounds like you are using an early adopter version of 3.0. Why not upgrade to the latest production release (3.1.07.42)?
    A similar situation is described in this old thread:
    Re: Randomly not getting query results
    Regards,
    SQL Developer Team

Maybe you are looking for