SQL query on SOAINFRA dehydration to fetch version info of composite

Hi all,
I am scanning the SOAINFRA schema for the table that stores information about the latest ACTIVE version of a deployed composite.
Please guide in case anyone is aware of this table.
Thanks,
Srini

Hi Swaroop,
With MII 14.0 SP5 Patch 11, in a transaction, I get following XML output for a query that executes an SP(returning multiple resultSets) :
And, results in this format can surely be used for further processing in an MII transaction.
Thanks Rajasekhar, got to know about this because of your query.
regards,
Manisha

Similar Messages

  • Oracle Sql Query issue Running on Different DB Version

    Hello All,
    I have come into situation where we are pruning sql queries on different DB version of Oracle and have performance issue. Let me tell you in brief and i really appreciate for your prompt response as its very imperative stuff.
    I have a query which is running on a DB of version 7.3.4 and it takes around 30 mins where as the same query when run on 8i it takes 15sec., its a huge difference. I have run the statistics to analyze on 7.3 and its comparatively very high. Question here is, the sql query trys to select data from same schema table and 2 tables from another DB using DB link and 2 other tables from another DB using DB link.So,how can we optimize this stuff and achieve this run as same time as 8i DB in 7.3. Hope i am clear about my question, Eagerly waiting for your replies.
    Thanks in Advance.
    Message was edited by:
    Ram8

    Difficult to be sure without any more detailed information, but I suspect that O7 is in effect copying the remote tables to local temp space, then joining; 8i is factoring out a better query to send to the remote DBs, which does as much work as possible on the remote DB before shipping remaining rows back to local.
    You should be able to use EXPLAIN PLAN to identify what SQL is being shipped to the remote DB, If you can't (and it's been quite a while since I tried DB links or O7) then get the remote DBs to yourself, and set SQL_TRACE on for the remote instances. Execute the query and then examine the remote trace files, And don't forget to turn off the tracing when you're done.
    Of course it could just be that the CBO got better,,,
    HTH - if not, post your query and plans for the local db, and the remote queries.
    Regards Nigel

  • SQL Query.... (Oracle Version 10g)

    Hi All,
    Please find the following requirement.
    Requirement -
    There are 2 standalone database named database A and database B used by 2 separate application. Database A has schema S1 and Database B has schema S2.
    Schema S1 has around 40 master tables which get updated very frequently. This 40 tables are also present in S2 also.
    We want the both the 40 tables to be in sync every hourly or half any hour.
    eg. If records are added/updated deleted in S1.emp then same should be done in S2.emp and visa versa also.
    We dont want to use dblink,materialised views or scripts. Is there any feature in Oracle 10G like replication or Streams where in this can be done.
    Incase if are not able to replicate both ways then at least one way can we replicate ? like any records are added/updated deleted in S1.emp then same should be done in S2.emp and similarly in the other 39 tables.
    Thank you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    ME_XE?create type typ_colVarchar30 is table of varchar2(30)
      2  /
    Type created.
    Elapsed: 00:00:00.96
    ME_XE?declare
      2     v_colVarchar30 typ_colVarchar30;
      3  begin
      4     select table_name bulk collect into v_colVarchar30 from user_tables;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.78
    ME_XE?

  • SQL query to fetch the catalog category for a PLM item

    Hi All,
    Can anyone help me with a sql query of how we can fetch the catalog category for a PLM item.
    Regards,
    Shruti

    Hi,
    You could monitor the SMSProv.log when you check the category of an application. It shows that SQL query the SCCM provider used is related to function fn_ListCategoryInstances.
    Best Regards,
    Joyce

  • How to fetch the executed sql query in publisher

    hi.. like in obiee from manage session we can fetch the sql query similarly how can we fetch the query in BI publisher

    This may help you:
    http://gerardnico.com/wiki/bip/log
    Cheers
    Nico

  • Sql query required to fetch data in desired format.

    Hi All,
    Greetings,
    I have 1 table called sessioninfo. below are the table structure and table data,
    CREATE TABLE HR.SESSIONINFO
    REPORT_DATE DATE,
    REPORT_TIME VARCHAR2(100 BYTE),
    SESSION1 NUMBER,
    SESSION2 NUMBER,
    SESSION3 NUMBER,
    SESSION4 NUMBER,
    SESSION5 NUMBER,
    SESSION6 NUMBER,
    SESSION7 NUMBER,
    SESSION8 NUMBER,
    SESSION9 NUMBER,
    SESSION10 NUMBER,
    SESSION11 NUMBER,
    SESSION12 NUMBER,
    SESSION13 NUMBER,
    SESSION14 NUMBER,
    SESSION15 NUMBER,
    SESSION16 NUMBER,
    SESSION17 NUMBER,
    SESSION18 NUMBER,
    SESSION19 NUMBER,
    SESSION20 NUMBER,
    SESSION21 NUMBER,
    SESSION22 NUMBER,
    SESSION23 NUMBER,
    SESSION24 NUMBER,
    SESSION25 NUMBER,
    SESSION26 NUMBER,
    SESSION27 NUMBER,
    SESSION28 NUMBER,
    SESSION29 NUMBER,
    SESSION30 NUMBER,
    SESSION31 NUMBER,
    SESSION32 NUMBER,
    SESSION33 NUMBER,
    SESSION34 NUMBER,
    SESSION35 NUMBER,
    SESSION36 NUMBER,
    SESSION37 NUMBER,
    SESSION38 NUMBER,
    SESSION39 NUMBER,
    SESSION40 NUMBER,
    SESSION41 NUMBER,
    SESSION42 NUMBER,
    SESSION43 NUMBER
    REPORT_DATE     REPORT_TIME     SESSION1     SESSION2     SESSION4     SESSION5     SESSION6     SESSION7     SESSION8     SESSION9     SESSION10     SESSION11     SESSION14     SESSION15     SESSION16     SESSION17     SESSION18     SESSION19     SESSION20     SESSION21     SESSION22     SESSION23     SESSION24     SESSION25     SESSION26     SESSION27     SESSION30     SESSION31     SESSION32     SESSION35     SESSION36     SESSION37     SESSION38     SESSION40     SESSION41     SESSION42     SESSION43
    8/22/2011     7:01:00     2     1     2               2               1          2     1     2     1     1     1     1     1     2     1     1     0     1     2     2     0     1     1     2     2     2     2     1     1     2
    8/22/2011     7:15:41     1     2     2               2               2          3     1     2     2     1     1     1     1     2     3     1     3     2     2     5     1     1     2     1     2     1     2     1     1     1
    8/22/2011     7:30:45     1     1     4               3               2          3     2     2     3     2     1     2     2     1     2     1     2     2     2     2     2     3     2     1     2     2     2     2     1     2
    8/22/2011     7:46:10     1     2     1               2               2          2     3     3     3     1     1     3     4     3     1     5     3     3     2     2     3     3     2     3     3     2     3     2     2     2
    8/22/2011     8:01:05     5     5     7               4               2          3     3     5     2     6     2     3     2     3     4     4     3     3     4     4     2     4     3     4     2     3     4     3     3     4
    8/22/2011     8:15:48     2     4     4               4               5          3     3     3     3     4     3     4     4     4     3     3     5     4     4     4     7     3     3     4     3     3     3     5     4     5
    8/22/2011     8:30:50     4     5     3               5               4          3     5     5     5     4     5     5     6     5     4     6     7     3     3     5     7     5     4     4     4     4     5     8     3     4
    8/22/2011     8:45:42     4     7     5               5               6          5     4     5     4     4     6     4     6     4     7     5     4     4     7     5     7     5     5     5     6     3     7     6     5     5
    8/22/2011     9:01:24          5     6               6               5          3     6     8     6     7     6     4     5     4     7     7     5     6     4     7     5     4     5     4     4     5     6     11     4     6
    8/22/2011     9:15:56     5     6     4               4               4          6     6     4     13     5     8     5     4     6     3     5     4     6     8     5     5     6     7     5     5     7     5     7     6     8
    8/22/2011     9:30:45     7     7     5               5               12          7     4     5     5     6     15     8     6     7     9     9     5     6     5     5     6     5     5     8     9     9     7     5     7     8
    8/22/2011     9:45:41     5     10     7               8               7          6     7     5     6     8     8     7     7     9     5     6     7     9     7     8     6     11     6     10     8     10     6     12     9     12
    8/22/2011     10:01:00     8     5     5               9               6          7     6     7     5     7     7     7     9     6     6     7     7     7     11     8     7     8     10     8     6     5     7     6     9     6
    8/22/2011     10:16:16     6     8     6               14               9          7     7     10     8     8     23     11     16     6     6     4     8     10     9     7     7     10     7     14     12     7     5     10     11     6
    8/22/2011     10:31:09     7     9     8               9               8          7     8     8     9     7     20     11     6     8     9     9     11     8     14     11     12     7     8     7     12     10     12     8     7     11
    8/22/2011     10:46:11     7     8     10               8               12          7     7     9     8     9     8     11     10     12     9     8     9     7     8     6     8     9     10     10     9     8     9     18     7     9
    8/22/2011     11:01:10     8     7     6               9               13          8     10     9     11     9     10     8     7     8     11     14     6     9     12     8     8     7     17     13     12     7     16     19     14     9
    8/22/2011     11:15:40     11     12     9               10               10          11     8     10     9     10     10     8     7     9     8     10     6     10     11     10     8     13     14     8     10     13     9     10     12     10
    8/22/2011     11:31:45     8     7     10               11               10          12     11     11     8     13     30     11     8     8     8     7     8     12     7     10     9     10     12     15     11     11     10     9     9     11
    8/22/2011     11:46:05     9     7     8               7               12          6     11     8     6     9     8     10     7     8     14     9     8     13     8     23     13     7     12     8     12     8     12     10     9     9
    8/22/2011     12:01:22     9     10     10               11               11          10     13     7     9     13     11     11     10     10     8     10     13     12     12     11     10     8     7     8     10     9     20     23     10     9
    8/22/2011     12:16:02     8     9     11               10               9          11     12     9     22     9     7     7     6     9     10     11     9     8     9     8     25     6     9     10     12     18     16     10     7     7
    8/22/2011     12:31:11     18     11     8               14               9          11     5     8     9     7     8     7     8     7     21     10     13     7     6     10     8     7     10     8     7     10     7     10     10     10
    8/22/2011     12:46:15     10     7     11               12               8          13     16     14     23     10     8     10     11     33     9     15     13     16     14     9     10     25     11     7     11     11     9     9     11     8
    8/22/2011     13:00:57     13     16     8               10               16          12     6     9     10     7     22     11     11     8     7     15     8     11     10     14     8     15     9     10     10     10     10     8     8     9
    8/22/2011     13:15:57     6     21     14               26               7          10     9     13     10     12     13     7     8     18     11     10     10     9     25     17     8     21     7     11     7     18     17     9     17     6
    8/22/2011     13:30:53     9     12     6               5               9          14     6     9     7     15     10     6     8     12     8     9     7     9     10     12     7     8     13     11     13     7     8     10     7     10
    8/22/2011     13:46:05     6     13     8               9               10          10     8     22     8     11     8     10     10     11     8     10     6     9     9     8     8     7     11     7     9     8     8     7     10     8
    8/22/2011     14:00:46     13     8     8               11               9          12     8          9     14     9     9     11     14     10     9     11     14     8     16     23     9     6     12     8     8     9     9     9     18
    8/22/2011     14:15:46     8     13     9               7               9          29     7     9     18     10     10     7     9     9     17     10     10     10     12     10     13     12     15     7     12     8     13     9     8     9
    8/22/2011     14:31:13     9     11     11               20               10          9     8     9     9     9     8     25     9     7     11     8     9     10     12     7     10     23     11     9     10     9     10     9     9     9
    8/22/2011     14:45:52     9     12     12               13               25          11     17     8     12     9     11     10     11     10     11     8     21     11     8     7     9     25     11     10     11     10     13     11     8     8
    8/22/2011     15:00:52     7     33     11               9               7          12     9     11     12     10     34     10     11     9     7     9     11     10     9     29     11     10     13     8     10     13     17     15     14     12
    8/22/2011     15:16:16     8     10     6               25               13          10     9     9     13     13     15     10     10     17     8     12     10     11     61     9     9     9     26     10     10     12     10     11     13     9
    8/22/2011     15:31:07     9     10     9               11               11          9     14     14     12     12     19     12     8     11     11     9     9     12     0     11     10     7     24     11     11     9     19     22     10     9
    8/22/2011     15:45:44     7     10     9               25               14          11     23     10     34     11     7     8     7     7     15     16     8     5     9     9     10     10     7     9     7     7     10     10     21     13
    8/22/2011     16:00:59     27     9     12               10               11          9     16     16     16     19     10     10     11     9     7     17     10     10     6     27     11     12     9     20     9     10     18     12     12     9
    8/22/2011     16:15:42     12     9     8               8               9          18     10     9     25     11     8     8     16     10     13     11     23     33     12     8     11     20     9     8     9     22     10     8     11     10
    8/22/2011     16:31:03     10     10     9               14               9          14     10     15     9     14     9     10     11     22     8     9     10     13     8     10     10     8     11     13     10     9     11     10     11     9
    8/22/2011     16:45:44     10     9     10               11               13          10     10     12     8     9     10     9     16     7     8     9     8     14     7     10     11     5     7     11     8     9     10     11     20     11
    8/22/2011     17:00:46     9     12     10               9               11          7     12     10     9     7     11     8     9     7     8     12     10     10     8     15     12     12     8     6     6     10     9     10     9     9
    8/22/2011     17:16:04     7     7     7               20               9          9     9     8     9     8     10     20     8     17     31     10     10     9     8     17     9     8     8     16     8     6     14     10     9     9
    8/22/2011     17:31:22     6     7     9               9               8          6     8     7     8     9     5     18     8     7     8     7     7     12     13     11     16     8     7     25     9     8     22     12     14     10
    8/22/2011     17:45:56     12     6     11               8               8          8     7     6     7     7     7     15     9     8     10     10     13     14     5     9     9     19     9     6     5     14     17     9     14     6
    8/22/2011     18:00:53     8     8     6               8               7          8     5     8     6     7     6     8     16     5     7     7     9     15     8     8     6     8     6     8     9     7     10     7     6     10
    8/22/2011     18:16:04     6     7     6               19               12          12     9     9     8     6     6     7     12     8     7     7     5     6     7     7     7     10     6     7     8     6     6     6     6     9
    8/22/2011     18:31:00     7     6     9               6               11          6     6     6     6     9     6     5     7     7     12     9     18     8     5     5     5     7     5     6     10     6     10     10     15     8
    8/22/2011     18:45:43     17     13     22               11               5          6     6     6     12     4     5     5     5     4     5     5     9     8     4     6     7     5     6     6     7     5     6     7     6     5
    8/22/2011     19:00:57     7     7     4               7               15          17     6     7     10     8     4     6     6     4     5     6     5     13     7     5     6     3     5     5     6     6     16     7     6     4
    8/22/2011     19:15:47     5     4     6               5               4          4     4     4     6     3     5     5     6     4     3     10     6     6     4     7     5     6     6     6     7     5     4     4     8     5
    8/22/2011     19:30:39     5     5     7               4               8          12     3     5     3     5     6     6     4     5     4     4     5     6     4     6     5     4     4     6     7     4     4     6     4     3
    8/22/2011     19:45:39     5     5     15               5               6          6     6     4     5     8     6     6     6     4     6     5     7     4     3     5     3     3     3     4     6     7     6     4     5     5
    8/22/2011     20:01:02     3     4     4               5               3          6     4     5     5     4     2     3     4     4     5     6     4     4     5     4     5     5     4     5     3     5     5     3     4     5
    8/22/2011     20:15:38     6     4     3               4               5          5     4     2     5     3     4     6     4     4     4     5     2     2     4     4     5     4     3     2     4     3     5     4     3     4in short table contains the information about some sessions.
    now i want the output like below, (highest session for the report_date and report_time with the name of session)
    REPORT_DATE     REPORT_Hour     SESSION_CODE     SESSION_VALUE
    8/22/2011     7     Session30     5
    8/22/2011     7     Session24     5
    8/22/2011     8     Session41     8
    8/22/2011     9     Session19     15
    8/22/2011     10          
    8/22/2011     11          
    8/22/2011     12          
    8/22/2011     13          
    8/22/2011     14          
    8/22/2011     15          
    8/22/2011     16          
    8/22/2011     17          
    8/22/2011     18          
    8/22/2011     19          
    8/22/2011     20          How can i get using sql query.
    Any help appriciated.

    In version 11 you can use UNPIVOT.
    A sample with just three columns:
    SQL> with sessioninfo as (
      2     select date '2011-08-29' report_date, '7:12:34' report_time,
      3            1 session1, cast(null as number) session2, 11 session3 from dual union all
      4     select date '2011-08-29' report_date, '7:56:00' report_time,
      5            4 session1, 2 session2, cast(null as number) session3 from dual union all
      6     select date '2011-08-29' report_date, '14:44:44' report_time,
      7            cast(null as number) session1, cast(null as number) session2, 2 session3 from dual
      8  )
      9  select
    10  report_date,
    11  substr(lpad(report_time,8),1,2) report_hour,
    12  max(session_code) keep (dense_rank last order by session_value) session_code,
    13  max(session_value) session_value
    14  from sessioninfo
    15  unpivot(
    16     session_value for session_code in (
    17        session1 as 'Session1',
    18        session2 as 'Session2',
    19        session3 as 'Session3'
    20     )
    21  )
    22  group by
    23  report_date,
    24  substr(lpad(report_time,8),1,2)
    25  order by
    26  report_date,
    27  substr(lpad(report_time,8),1,2)
    28  ;
    REPORT_D RE SESSION_ SESSION_VALUE
    11-08-29  7 Session3            11
    11-08-29 14 Session3             2For your 43 columns you just need to expand the list in lines 17,18,19 - the rest will work fine.
    (Your best way would actually be to change your datamodel to be more useful in a relational database - having columns session1, session2,...,session43 is not a very useful datamodel. Storing a timestamp in a VARCHAR2 is also not very good for the database.)

  • How to pass a string value from XL sheet cell to SQL query.

    Hi,
    I am using SQL query in XL sheet to fetch some data. for that i am using ODBC connection. Now I want to pass a string from XL sheet Cell value in the where clause of Select statement, Please let me know how to do this.
    Below is My code:
    nge("A4").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
    "ODBC;DRIVER={Microsoft ODBC for Oracle};UID=xyz;PWD=xyz;SERVER=xyz;" _
    , Destination:=Range("A4"))
    .CommandText = Array( _
    "SELECT CRYSTAL_REPORT1.PROJECT, CRYSTAL_REPORT1.OBJECT" & Chr(13) & "" & Chr(10) & "FROM NAIODEV.CRYSTAL_REPORT1 CRYSTAL_REPORT1" _
    .Name = "Query from gg"
    Thanks,
    Priya

    What does "XL" (whatever that is) have to do with Crystal Reports which is what you are obviously working with have to do with the Oracle database?
    The rules for using Crystal with Oracle are quite clearly described in all the Crystal Reports docs ... you MUST use IN OUT ref cursors unless you are doing direct table or view access.

  • Pinning the sql query in cache

    Hi All,
    I want to pin the sql query is cache because the physical reads are very high. Can anyone tell me steps to pin the sql query in the cache. Current version 10.2.1.0 OS : Windows.
    Reads CPU Elapsed
    Physical Reads Executions per Exec %Total Time (s) Time (s) SQL Id
    19,836 38 522.0 2.1 25.40 50.00 1r0wh3v6bayyk
    With regards
    kccrga

    Oscar,
    I've read Carys paper and a good paper it is.
    The point I was trying to get across is that there should be no rules of thumb. (par this one of course ;) )
    It all depends. Should one concentrate on reducing cpu usage on a disk-bound system? Is doing, say, 100 single-block reads from disk faster than doing 100 current mode gets?

  • Need help with sql query dates

    Hi,
    I have a sql query where i need to extract some info between given dates. The where clause of this query is as follows:
    WHERE CPD_BUS_UNIT=:ESI_PRM_1
    AND CPD_VOUCHER_DATE >= :P_DATE_FROM
    AND CPD_VOUCHER_DATE < (:P_DATE_TO+1)
    When i execute the query in toad, i can view the data but not the execution plan.It gives an error ORA-00932-Inconsistent Datatypes.
    But when i remove (+1) from :P_DATE_TO, i can c the execution plan and data. Will the data be different from the previous one.
    Please suggest how to rewrite the query.

    Can you please give it a try?
    WHERE CPD_BUS_UNIT=:ESI_PRM_1
    AND CPD_VOUCHER_DATE >= :to_date(P_DATE_FROM)
    AND CPD_VOUCHER_DATE < (to_date(:P_DATE_TO)+1) Regards

  • Class oracle.xml.sql.query.OracleXMLQuery not found in import

    I tried to perform load java using a non-sys user :
    loadjava -user user1/passwd -v -o -r Archive.java
    but encountered the following error:
    Errors in Archive:
    ORA-29535: source requires recompilation
    Archive:11: Class oracle.xml.sql.query.OracleXMLQuery not found in import.
    Info: 1 errors
    loadjava: 3 errors
    But if I use sys user I don't have any error:
    loadjava -user sys/manager -v -o -r Arachive.java
    initialization complete
    loading : Archive
    creating : Archive
    resolver :
    resolving: Archive
    Why is this so?
    ANy security setup that I missed?
    Thanks in advance.
    Note:
    my Archive.java file contains:
    // Core Java Classes
    import java.io.*;
    import java.sql.*;
    // Oracle Java classes
    import oracle.jdbc.*;
    import oracle.jdbc.driver.*;
    import oracle.xml.sql.query.OracleXMLQuery;
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Azman Diron ([email protected]):
    I tried to perform load java using a non-sys user :
    loadjava -user user1/passwd -v -o -r Archive.java
    but encountered the following error:
    Errors in Archive:
    ORA-29535: source requires recompilation
    Archive:11: Class oracle.xml.sql.query.OracleXMLQuery not found in import.
    Info: 1 errors
    loadjava: 3 errors
    But if I use sys user I don't have any error:
    loadjava -user sys/manager -v -o -r Arachive.java
    initialization complete
    loading : Archive
    creating : Archive
    resolver :
    resolving: Archive
    Why is this so?
    ANy security setup that I missed?
    Thanks in advance.
    Note:
    my Archive.java file contains:
    // Core Java Classes
    import java.io.*;
    import java.sql.*;
    // Oracle Java classes
    import oracle.jdbc.*;
    import oracle.jdbc.driver.*;
    import oracle.xml.sql.query.OracleXMLQuery;
    <HR></BLOCKQUOTE>
    Managed to solve this problem.
    Drop all xml objects owned by sys and user1.
    Reload xml objcets for user1 with -force option.
    null

  • SQL query to fetch approximately 9000 rows

    Hi,
    I am using the following SQL query in a java class. Using JDBC to connect to an Oracle database using JRUN app server connection pooling.
    SELECT PT.ACCOUNT_NUMBER,PAYMENT_REF_ID, TO_CHAR (PT.DATE_CREATED, 'MM/DD/YYYY'),
    PT.AMOUNT_PAID, DECODE(STATUS_VALUE,'Cancelled','Canceled',STATUS_VALUE)
    FROM EPAY_PAYMENT_TRANSACTIONS PT, EPAY_STATUS_LOOKUP SL
    WHERE
    PT.CLIENT_NAME = 'someclientname'
    AND TO_CHAR(DATE_PAYMENT_SCHEDULED,'MM/DD/YYYY') = '08/28/2006'
    AND PT.PAYMENT_STATUS = SL.STATUS_CODE
    ORDER BY PT.DATE_CREATED DESC
    EPAY_PAYMENT_TRANSACTIONS is a huge table consisting of thousands of rows. There are 4 indexes defined on this table but not on the columns used in the join condition of the query.
    EPAY_STATUS_LOOKUP is a much smaller table mainly used for lookup consisting of some 100 rows.
    The above query fetches approx 9000 records and takes a very long time to execute. Is there any way it can be optimized or we can change some attributes on the tables involved for speeding up the query?
    Thanks in advance,
    Nisha.

    So the task is to avoid FTS on EPAY_PAYMENT_TRANSACTIONSWell, maybe...
    But I believe that we have yet to hear more details about data distribution, execution plans and so on.
    Because it all depends...
    Consider simple testcase:
    SQL> select * from v$version where rownum = 1;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
    SQL> -- Create "small" table
    SQL>
    SQL>  create table build_t as
      2   select rownum x,
      3          rpad('*', 200, '*') padding
      4     from dual
      5  connect by level <= 100;
    Table created.
    SQL> -- Create "large" table - initially, add 9000 rows which satisfy join criteria
    SQL>
    SQL>  create table probe_t as
      2   select mod(rownum - 1, 100) + 1 x,
      3          dbms_random.value y,
      4          rpad('*', 200, '*') padding
      5     from dual
      6  connect by level <= 9000;
    Table created.
    SQL> -- Now, add some extra rows to large table - "thousands of rows"
    SQL>
    SQL>  insert into probe_t
      2   select rownum + 100,
      3          0,
      4          rpad('*', 200, '*') padding
      5     from dual
      6  connect by level <= 100000;
    100000 rows created.
    SQL> exec dbms_stats.gather_table_stats(user, 'BUILD_T')
    PL/SQL procedure successfully completed.
    SQL> exec dbms_stats.gather_table_stats(user, 'PROBE_T')
    PL/SQL procedure successfully completed.
    SQL> -- Ok, let's measure ...
    SQL>
    SQL> set autot traceonly
    SQL>
    SQL> select a.*, b.*
      2    from build_t a,
      3         probe_t b
      4   where a.x = b.x
      5   order by b.y;
    9000 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1387 Card=109 Bytes=45017)
       1    0   SORT (ORDER BY) (Cost=1387 Card=109 Bytes=45017)
       2    1     HASH JOIN (Cost=1386 Card=109 Bytes=45017)
       3    2       TABLE ACCESS (FULL) OF 'BUILD_T' (Cost=5 Card=100 Bytes=20400)
       4    2       TABLE ACCESS (FULL) OF 'PROBE_T' (Cost=1355 Card=109000 Bytes=22781000)
    Statistics
              0  recursive calls
              0  db block gets
           3280  consistent gets
              0  physical reads
              0  redo size
         360756  bytes sent via SQL*Net to client
           7096  bytes received via SQL*Net from client
            601  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
           9000  rows processedOn my server, this query finished in less that second and took 3280 LIO to complete.
    Now, which index did you mean to build? I guess it's and index on join column, isn't it?
    If so - let's build it and measure again:
    SQL> create index idx_probe_t on probe_t(x);
    Index created.
    SQL> select /*+ ORDERED USE_NL(a b) */
      2         a.*, b.*
      3    from build_t a,
      4         probe_t b
      5   where a.x = b.x
      6   order by b.y;
    9000 rows selected.
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=211 Card=109 Bytes=45017)
       1    0   SORT (ORDER BY) (Cost=211 Card=109 Bytes=45017)
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'PROBE_T' (Cost=3 Card=1 Bytes=209)
       3    2       NESTED LOOPS (Cost=210 Card=109 Bytes=45017)
       4    3         TABLE ACCESS (FULL) OF 'BUILD_T' (Cost=5 Card=100 Bytes=20400)
       5    3         INDEX (RANGE SCAN) OF 'IDX_PROBE_T' (NON-UNIQUE) (Cost=2 Card=1)
    Statistics
              0  recursive calls
              0  db block gets
           9124  consistent gets
             21  physical reads
              0  redo size
         360756  bytes sent via SQL*Net to client
           7096  bytes received via SQL*Net from client
            601  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
           9000  rows processedLook at this - 9124 consistent gets, almost three times larger than in case of hash join.
    Full table scan is not something to be avoided at all cost.
    Indexing - sometimes it is good,
    sometimes it's just useless,
    sometimes it only makes things worse...
    It all depends on underlying data distribution. That's why I asked user527580 to tell us more.
    Kind regards.

  • SQL Query to Fetch 500 Rows at once

    Hi,
      Due to performance issue of the SQL query takes lot of time to execute. I tried modifying the code as mentioned below but it is not working to fetch when search is implemented. Actually data is more than 1 Million Records so it takes lot of time to query the data.
    SELECT DISTINCT
    IMV.*,
      nvl(imv.party_name,imv.bill_to_name) "Bill To Name",
      Imv.Ship_To_City "Reseller City",
      Imv.Ship_To_State "Reseller State",
      Edb2_Global.Country_Name_Theater(Imv.Ship_To_Country ,'COUNTRY') "Reseller Country",
      Edb2_Global.Country_Name_Theater(Imv.Ship_To_Country ,'THEATER') "Reseller Theater",
      Cl.City "Customer City",
      Cl.State "Customer State",
      EDB2_GLOBAL.COUNTRY_NAME_THEATER(CL.COUNTRY,'COUNTRY') "Customer Country",
      EDB2_GLOBAL.COUNTRY_NAME_THEATER(CL.COUNTRY,'THEATER') "Customer Theater"
    FROM IB_SUPPORT_CONTRACTS_MV IMV,
      customer_products cp,
      customer_locations cl
    WHERE
    UPPER(TRIM(IMV.SERIAL_NUMBER)) = UPPER(TRIM(CP.PRODUCT_SERIAL_NUMBER(+) ) )
    AND CP.LOCATION_ID                     = CL.LOCATION_ID(+)
    AND ROWNUM <= 501
    Please suggest me how to improve the performance of the query.
    Thanks
    Sudhir

    Hi,
    As mentioned already, this condition is really hurting performance:
    UPPER(TRIM(IMV.SERIAL_NUMBER)) = UPPER(TRIM(CP.PRODUCT_SERIAL_NUMBER(+) ) )
    Could you trim and capitalize the serial numbers before storing them?  Do you really need to remember exactly how the serial numbers were entered?  If you really do, then store it in one column, and store UPPER (TRIM (serial_number)) in a different column.  Starting in Oracle 11, this could be a virtual column; in any version (7 or higher), it could be maintained by a trigger.  Failing that, create a function-based index on UPPER (TRIM (serial_number)).

  • Sql query to fetch session id

    Hi,
    I am to trying to fetch session id of a previously submitted process of a search button......so that i can display the search results in a different page.....so is there any sql query or pl/sql procedure to fetch the session id.

    >
    Please update your forum profile with a real handle instead of "968337".
    I am to trying to fetch session id of a previously submitted process of a search button......It's not all clear what you are trying to do. The documentation describes an APEX session and its ID thus:
    >
    A session is a logical construct that establishes persistence (or stateful behavior) across page views. Each session is assigned a unique identifier. The Application Express engine uses this identifier (or session ID) to store and retrieve an application's working set of data (or session state) before and after each page view.
    >
    This means that each page view and page submission does not have its own session ID, but uses the session ID established when the user's current session began (which is usually through logon and authentication).
    Given this definition of session and session ID, are you therefore referring to the ID of some previous user session in which a page was submitted by a search button? Or some private meaning that you have yet to fully explain?
    so that i can display the search results in a different page.....so is there any sql query or pl/sql procedure to fetch the session id.The session ID of the current session is available using the the built-in substitution string<tt>APP_SESSION</tt> built-in substitution string.
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    Following the guidelines in these documents will also help to explain the problem in much more detail and with sufficient background for it to be understood:
    <li>+How to ask questions+
    <li>+{message:id=9360002}+
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.

  • Inline transform for Sql Query not working in SAP MII 12.1 Version 12.1.8 B

    Hi All,
    I applied an xslt for an sql query which returns an xml file.
    I used inline transform icon in sql query to load an xsl file which has to return me a string
    Any idea why is not working for me..?
    My Sample XML file:
                                     <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="/XMII/CM/BatchDisposition/BatchQueueManagement/StyleSheets/ProductXsl.xsl"?>
    <Rowsets DateCreated="2011-05-05T07:27:45" EndDate="2011-05-05T07:27:45" StartDate="2011-05-05T06:27:45" Version="12.1.8 Build(20)">
         <Rowset>
              <Columns>
                   <Column Description="ProductName" MaxRange="1" MinRange="0" Name="ProductName" SQLDataType="12" SourceColumn="ProductName"/>
              </Columns>
              <Row>
                   <ProductName>Asprin 100mg Tablets 12 x10 strip</ProductName>
              </Row>
              <Row>
                   <ProductName>Asprin 300mg Tablets 12 x10 strip</ProductName>
              </Row>
              <Row><ProductName>Ibprooven 200mg Tablets 12 x 10 strip</ProductName></Row>
              <Row><ProductName>RipTide 50mg Tablets 40 x10 strip</ProductName></Row>
              <Row><ProductName>Seroquel 200mg Tablets 6 x10 strip</ProductName></Row>
              <Row><ProductName>Seroquel 400mg Tablets 12 x10 strip</ProductName></Row>
         </Rowset>
    </Rowsets>
    My Sample XSl File:
                                    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
         <xsl:text>["</xsl:text>
         <xsl:for-each select="Rowsets/Rowset/Row">
              <xsl:value-of select="ProductName"/>
              <xsl:if test="position() &lt; last()">
                   <xsl:text>","</xsl:text>
                    </xsl:if>
              <xsl:if test="position()=last()">
                           <xsl:text>"]</xsl:text>
                    </xsl:if>
         </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Any Suggestions  are Welcome:
    Thanks

    Something like this should work...
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <Rowsets DateCreated="{Rowsets/@DateCreated}" Version="{Rowsets/@Version}" StartDate="{Rowsets/@StartDate}" EndDate="{Rowsets/@EndDate}">
                   <xsl:copy-of select="/Rowsets/FatalError"/>
                   <xsl:copy-of select="/Rowsets/Messages"/>
                   <Rowset>
                   <Columns>
                        <Column Description="Mycol1" MaxRange="1" MinRange="0" Name="Mycol1" SQLDataType="12" SourceColumn="Mycol1" />
                   </Columns>
                   <Row>
                   <Mycol1>
                   <xsl:text>["</xsl:text>
                        <xsl:for-each select="/Rowsets/Rowset/Row">
                             <xsl:value-of select="." />
                             <xsl:choose>
                                  <xsl:when test="position() &lt; last()"><xsl:text>","</xsl:text></xsl:when>
                                  <xsl:otherwise><xsl:text>"]</xsl:text></xsl:otherwise>
                             </xsl:choose>
                        </xsl:for-each>
                   </Mycol1>
                   </Row>
                   </Rowset>
              </Rowsets>
         </xsl:template>
    </xsl:stylesheet>

  • How to get row number in the fetch row itself in Sql Query ?

    Hi,
    i am fetching some rows from a sql query . Is there any way to get row number as well in each row while all rows are fetched ?
    like this :
    RowNum data1 data2
    1 abc ere
    2 bnh ioi

    Hello
    Ofcourse you can get the rownum inside a query, just keep in mind that the rownum is the number of order in which the records were fetched from the table, so if you do an order by, the rownum will not be sequential, unless you query the information in a subquery first.
    SELECT rown, col1, col1
    FROM table
    Or
    SELECT rownum, col1, col2
    FROM (SELECT col_1, col_2 FROM table ORDER BY col1)
    Regards
    Johan

Maybe you are looking for

  • Weird problem with 290x Lighting on boot

    Hi all, yesterday i took a 290x Lighting, and after installed it i got some very strange problem on system boot. When i turn on the PC it appear a strange cyan line on the left side of the screen: When windows (8.1) is about to begin the system goes

  • How can I have a VMWare repository for add-ons

    I have a virtual environment and need to be able to put add-ons/extensions in one shared directory so all my clients can access them. I do not want the users to have to install them. Is there anyway to do this?

  • Host recomendation - linux - php/mysql

    Hi gangsters and molls :) I'm looking again for some advice from the knowledgable contributors of this forum, of which there are many, many, many! I'm in need of a host, that provides php/mysql linux and some good online instructions (preferably the

  • Youtube doesn't play in Safari sometimes

    Sometimes when I hit play on embedded youtube videos, the youtube box turns black (no controls appear) and no video plays. But sound starts. The problem appears at different sites and even different iOS versions (it was on 4.x and now I have 5.0 then

  • Cannot load a Queue

    Hi, I need to update the solution manager 7.0 for to do the installation of the EHP4. I want to update the solution manager 7.0 but i´ve the next problem: There three patches that is showing the red cross, I´ve uploaded the patches a lot of times an