Multiple plans for my SQL- Which one is following?-11gr2

11gr2, windows-64-bit
I have one sql_id part of 3rd part application, need to tune it. When I tried to get its execution plan im seeing multiple plan_plan values. That means, multiple plans for
same sql_id
How could we know that which plan my sql_id is following.?
SQL> set lines 300
SQL> set pages 50
SQL> select * from TABLE(dbms_xplan.display_awr('5z1r29wc6514q'));
PLAN_TABLE_OUTPUT
SQL_ID 5z1r29wc6514q
SELECT INVOICE_ID,min(CHARGE_DATE),MAX(CHARGE_DATE),
sum(TOTAL_EXCL_VAT),sum(case when instr(LEVEL2,:"SYS_B_0")>:"SYS_B_1"
then SUM_QUANTITY else :"SYS_B_2" end) as KB from
RATOR_CDR.INVOICE_DETAIL_LINE I  INNER JOIN SUBSCRIPTION S ON S.ID =
I.SUBSCRIPTION_ID  inner join SERVICE S1 on S1.SUBSCRIPTION_ID=S.ID
WHERE INVOICE_ID in (SELECT id from  RATOR.INVOICE WHERE
invoice_number is  null) and  S1.PHONE_NUMBER=:1   and LEVEL1=:2  group
by  INVOICE_ID
Plan hash value: 216300602
| Id  | Operation                            | Name                  | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
|   0 | SELECT STATEMENT                     |                       |       |       |  1350 (100)|       |          |       |
|   1 |  HASH GROUP BY                       |                       |   333 | 40293 |  1350   (1)| 00:00:17 |       |       |
|   2 |   HASH JOIN                          |                       |   333 | 40293 |  1348   (1)| 00:00:17 |       |       |
|   3 |    NESTED LOOPS                      |                       |       |       |            |       |          |       |
|   4 |     NESTED LOOPS                     |                       |  1638 |   161K|   866   (0)| 00:00:11 |       |       |
|   5 |      NESTED LOOPS                    |                       |     1 |    34 |     2   (0)| 00:00:01 |       |       |
|   6 |       TABLE ACCESS BY INDEX ROWID    | SERVICE               |     1 |    23 |     2   (0)| 00:00:01 |       |       |
|   7 |        INDEX RANGE SCAN              | SERVICE__PHONE_NUMBER |     1 |       |     1   (0)| 00:00:01 |       |       |
|   8 |       INDEX UNIQUE SCAN              | SUBSCRIPTION__ID_PK   |     1 |    11 |     0   (0)|       |          |       |
|   9 |      PARTITION RANGE ALL             |                       |  1684 |       |    46   (0)| 00:00:01 |     1 |    17 |
|  10 |       INDEX RANGE SCAN               | IDL_SUB_ID            |  1684 |       |    46   (0)| 00:00:01 |     1 |    17 |
|  11 |     TABLE ACCESS BY LOCAL INDEX ROWID| INVOICE_DETAIL_LINE   |  1581 |   103K|   864   (0)| 00:00:11 |     1 |     1 |
|  12 |    TABLE ACCESS FULL                 | INVOICE               |  6048 |   118K|   481   (1)| 00:00:06 |       |       |
SQL_ID 5z1r29wc6514q
SELECT INVOICE_ID,min(CHARGE_DATE),MAX(CHARGE_DATE),
sum(TOTAL_EXCL_VAT),sum(case when instr(LEVEL2,:"SYS_B_0")>:"SYS_B_1"
then SUM_QUANTITY else :"SYS_B_2" end) as KB from
RATOR_CDR.INVOICE_DETAIL_LINE I  INNER JOIN SUBSCRIPTION S ON S.ID =
I.SUBSCRIPTION_ID  inner join SERVICE S1 on S1.SUBSCRIPTION_ID=S.ID
WHERE INVOICE_ID in (SELECT id from  RATOR.INVOICE WHERE
invoice_number is  null) and  S1.PHONE_NUMBER=:1   and LEVEL1=:2  group
by  INVOICE_ID
Plan hash value: 1282779260
| Id  | Operation                            | Name                  | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
PLAN_TABLE_OUTPUT
|   0 | SELECT STATEMENT                     |                       |       |       |  1392 (100)|       |          |       |
|   1 |  HASH GROUP BY                       |                       |   325 | 39000 |  1392   (1)| 00:00:17 |       |       |
|   2 |   HASH JOIN                          |                       |   325 | 39000 |  1391   (1)| 00:00:17 |       |       |
|   3 |    TABLE ACCESS FULL                 | INVOICE               |  5972 |   116K|   550   (1)| 00:00:07 |       |       |
|   4 |    NESTED LOOPS                      |                       |       |       |            |       |          |       |
|   5 |     NESTED LOOPS                     |                       |  1794 |   175K|   840   (0)| 00:00:11 |       |       |
|   6 |      NESTED LOOPS                    |                       |     1 |    34 |     2   (0)| 00:00:01 |       |       |
|   7 |       TABLE ACCESS BY INDEX ROWID    | SERVICE               |     1 |    23 |     2   (0)| 00:00:01 |       |       |
|   8 |        INDEX RANGE SCAN              | SERVICE__PHONE_NUMBER |     1 |       |     1   (0)| 00:00:01 |       |       |
|   9 |       INDEX UNIQUE SCAN              | SUBSCRIPTION__ID_PK   |     1 |    11 |     0   (0)|       |          |       |
|  10 |      PARTITION RANGE ALL             |                       |  1836 |       |    48   (0)| 00:00:01 |     1 |    18 |
|  11 |       INDEX RANGE SCAN               | IDL_SUB_ID            |  1836 |       |    48   (0)| 00:00:01 |     1 |    18 |
|  12 |     TABLE ACCESS BY LOCAL INDEX ROWID| INVOICE_DETAIL_LINE   |  1722 |   110K|   838   (0)| 00:00:11 |     1 |     1 |
------------------------------------------------------------------------------------------------------------------------------also, Any suggestions to tune this query
Thanks

Harry wrote:
11gr2, windows-64-bit
I have one sql_id part of 3rd part application, need to tune it. how do plan on modifying 3 ^rd^ party application?

Similar Messages

  • Different 'execution plans' for same sql in 10R2

    DB=10.2.0.5
    OS=RHEL 3
    Im not sure of this, but seeing different plans for same SQL.
    select sql_text from v$sqlarea where sql_id='92mb4z83fg4st'; <---TOP SQL from AWR
    SELECT /*+ OPAQUE_TRANSFORM */ "ENDUSERID","LASTLOGINATTEMPTTIMESTAMP","LOGINSOURCECD","LOGINSUCCESSFLG",
    "ENDUSERLOGINATTEMPTHISTORYID","VERSION_NUM","CREATEDATE"
    FROM "BOMB"."ENDUSERLOGINATTEMPTHISTORY" "ENDUSERLOGINATTEMPTHISTORY";
    SQL> set autotrace traceonly
    SQL> SELECT /*+ OPAQUE_TRANSFORM */ "ENDUSERID","LASTLOGINATTEMPTTIMESTAMP","LOGINSOURCECD","LOGINSUCCESSFLG",
    "ENDUSERLOGINATTEMPTHISTORYID","VERSION_NUM","CREATEDATE"
    FROM "BOMB"."ENDUSERLOGINATTEMPTHISTORY" "ENDUSERLOGINATTEMPTHISTORY"; 2 3
    1822203 rows selected.
    Execution Plan
    Plan hash value: 568996432
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1803K| 75M| 2919 (2)| 00:00:36 |
    | 1 | TABLE ACCESS FULL| ENDUSERLOGINATTEMPTHISTORY | 1803K| 75M| 2919 (2)| 00:00:36 |
    Statistics
    0 recursive calls
    0 db block gets
    133793 consistent gets
    0 physical reads
    0 redo size
    76637183 bytes sent via SQL*Net to client
    1336772 bytes received via SQL*Net from client
    121482 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1822203 rows processed
    ===================================== another plan ===============
    SQL> select * from TABLE(dbms_xplan.display_awr('92mb4z83fg4st'));
    15 rows selected.
    Execution Plan
    Plan hash value: 3015018810
    | Id | Operation | Name |
    | 0 | SELECT STATEMENT | |
    | 1 | COLLECTION ITERATOR PICKLER FETCH| DISPLAY_AWR |
    Note
    - rule based optimizer used (consider using cbo)
    Statistics
    24 recursive calls
    24 db block gets
    49 consistent gets
    0 physical reads
    0 redo size
    1529 bytes sent via SQL*Net to client
    492 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    15 rows processed
    =========second one shows only 15 rows...
    Which one is correct ?

    Understood, second plan is for self 'dbms_xplan'.
    Anyhow I opened a new session where I did NOT on 'auto-trace'. but plan is somewhat than the original.
    SQL> /
    PLAN_TABLE_OUTPUT
    SQL_ID 92mb4z83fg4st
    SELECT /*+ OPAQUE_TRANSFORM */ "ENDUSERID","LASTLOGINATTEMPTTIMESTAMP","LOGINSOURCECD","
    LOGINSUCCESSFLG","ENDUSERLOGINATTEMPTHISTORYID","VERSION_NUM","CREATEDATE" FROM
    "BOMB"."ENDUSERLOGINATTEMPTHISTORY" "ENDUSERLOGINATTEMPTHISTORY"
    Plan hash value: 568996432
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    PLAN_TABLE_OUTPUT
    | 0 | SELECT STATEMENT | | | | 2919 (100)| |
    | 1 | TABLE ACCESS FULL| ENDUSERLOGINATTEMPTHISTORY | 1803K| 75M| 2919 (2)| 00:00:36 |
    15 rows selected.
    I am just wondering, which plan is the accurate and which I need to believe ?

  • Explain Plan for a SQL

    Hi
    I have done an explain for one of my sql and i got the result as follows
    SELECT STATEMENT Cost = 502
    SORT AGGREGATE
    HASH JOIN
    NESTED LOOPS
    HASH JOIN
    TABLE ACCESS FULL CMC_NWPE_RELATION
    HASH JOIN
    TABLE ACCESS FULL CMC_NWST_NET_SET
    NESTED LOOPS
    TABLE ACCESS FULL CMC_NWPR_RELATION
    INDEX UNIQUE SCAN SYS_C006513
    INDEX UNIQUE SCAN SYS_C006316
    TABLE ACCESS FULL CMC_MEPR_PRIM_PROV
    I need to know whether i have gone wrong with any of the joins in the sql. For the matter of fact I need to interpret the result of the explain plan for my sql.
    Thanks in advance
    Chandra Sekhar

    Hi
    First of all u haven't send the complete explanation in the plan table. As far i got from your result ur accesing the ful table scan CMC_NWPE_RELATION ,CMC_NWST_NET_SET , CMC_NWPR_RELATION & one more.
    check in your auery why these table are accesing full when the data in this table will volumonuous ur system this query will become very slow as it will have to acces nosof rowsin table 1*nosof rowsin table 2*nosof rowsin table 3*nosof rowsin table 4 so u create the index in those tables and index should be made on the columns which r used in ur where clause of the query
    Amit

  • I,m looking for handsfree for iphone 4s, which one is the best for it

    i,m looking for handsfree for iphone 4s, which one is the best for it

    I really like the Plantronics Voyager Pro bluetooth headset.  I have tried a lot of the ones on the market and the Plantronics one that I now use has - a long battery life, excellent sound quality and very low background noise. I occasionally use it when in a vehicle (although I do try to avoid doing this) and people on the other end of the line don't even realise that I am in a car.

  • Help with DR plan for Exchange & SQL Server vDP 6 please.

    Hi there,
    I just need a little guidance building a backup & DR strategy using vDP and/or VR. SRM is probably not in the budget right now.
    First question about "Application" backup recovery.... Do I need BOTH a "Guest Image" & "Application" backup of these servers to be able to recover in case of disaster? I'm guessing YES, since when I try to "Restore" an Application backup, I only see the Exchange or SQL databases for example. I do not see the actual VM C:\ drive, etc. Would I use a "Guest Image" restore, THEN an "Application" restore for a full recovery? What happens if your SQL database is on the C:\ drive, you will be backing them up double in this scenario, once in Guest Image, then again in Application backups?
    Next question.... I've tested VR to a remote location (no SRM yet), and it worked well. I consider this a good DR plan for what we need. We currently use TSM for backups. If I change to local vDP backup + replicated vDP backups at the remote site, would this be a good replacement instead of VR? Our RTO is not a huge issue. Can I recover the replicated backups easily to the remote hosts? I realize the advantages of SRM, and I would need to do more manual steps, but our budget is tight.
    Thanks for your help.

    As with many things, these answers depend a lot on your environment, that said, from my experience as a customer, partner (and now with VMware) here are my answers:
    - Depending on the application both guest and application can be a good idea. If you have applications with agents, I think it often makes sense to use them.
    - You are correct that if you need to recover the entire VM, you would recover the VM image  and then the application backup (if it was needed - there is a likelihood that the application backup may not be needed)
    - You are correct, you are very likely backing up the application data twice. Seems worthwhile to me for the right applications, you'll have to evaluate for your environment
    - VR or backups can work as a DR solution, especially if RTO isn't an issue. The main difference I see between them is RPO. VR can go as low as 15 mins, backups are usually 24 hours so again, it depends on your requirements. One additional benefit to SRM is the ability to non-disruptively test your DR plan which I think is one of the best parts of it. Totally understand about budget. I would recommend building and testing your DR plan and communicating the resulting RPO/RTO to the business so they are aware.
    Does this answer your questions?

  • F110 - several bank accounts for the vendor,which one is retrieved by SAP?

    Hi gurus,
    When using data medium exchange in transaction F110 for a customer (or a vendor) that has several bank accounts in the customer (vendor) master record, which one amongst those accounts will be retrieved by the system ?
    Ronan
    Edited by: Ronan LEGUELLEC on Nov 20, 2008 3:58 PM

    Each bank in vendor master is linked to Partner Bank Type (BnkT) field.  One of these values is entered in header (Payment tab), while entering vendor invoice in the system.  APP picks the bank (in vendor master record) linked to the partner bank type key entered in the vendor invoice.

  • Why tkprof did not show explain plan for some sql statements

    Hi,
    I did a trace for one of the session, hoping to find the explain plan for its tkprof. However, I only get this:
    INSERT INTO AUDIT_TABLE
    VALUES
    ( :B1 , :B2 , :B3 , :B4 , :B5 , :B6 , :B8 , :B7 )
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute   3698      8.08      59.41       3348        566      19092        3698
    Fetch        0      0.00       0.00          0          0          0           0
    total     3699      8.08      59.42       3348        566      19092        3698
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: 30     (recursive depth: 2)
    ********************************************************************************Any idea why the explain plan is missing?
    Also looking at the above statistics, what can I conclude?

    Thanks John. What's ur take on this statistics then?
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute   1798     12.23      36.75       1758       5404       7418        1798
    Fetch        0      0.00       0.00          0          0          0           0
    total     1798     12.23      36.75       1758       5404       7418        1798
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: 30     (recursive depth: 1)
    ********************************************************************************

  • For Working offline - Which one to use -  local database caching or reliable messaging?

    Hi,
    I am working on a mobile application with lcds where there is a feature to be implemented. The user can use the application in airplane mode and be able to automatically send requests to server when he comes online. After some research,  I found that I have to use a feature in the documentation called ocasionally conencted clients, which uses local database with dataservice.savecache() and offline adapter. I also found another feature called reliable messaging which takes care of sending the pending requests when the user comes online, but not sure if this feature supports offline mode for longer periods. The documentation mentioned that reliable messaging is only good for transient network disconnects, meaning disconenction for shorter time.
    Can anybody please confirm which is the right feature that best suits this requirement?
    Thanks,
    Swathi.

    Hi Ashish,
    Thank you so much for the resource. One more question, The code in the resource link,  has calls to Dataservice.disconnect() and Dataservice.connect() on the buttons. If my user need not bother to click on those buttons for connections and just set his phone to airplane mode and start working, I am using SocketMonitor class to monitor for network connection and then perform the Dataservice.connect(). In that case, I have problems when network is connected, the data service seems connected automatically some times and not connected other times resulting in errors. I am using autoConenct = true. How can I handle this? Do I have to call disconnect when socket is not available and then call conenct when it is available, things like that? Or Is there any other way to implement this without using SocketMonitor class?
    Thanks,
    Swathi.

  • Explain plan for a sql statement

    Hi,
    I have a simple sql statement which has a cost of 122, cardinality 59 and CPU cost 1966777.
    Same sql statement written in another way (using a nested select in the 'from' clause), has a cost of 58, cardinality 24 but cpu cost is much higher 29078895.
    What should I look for? For a better cost overall, or for a better cpu cost? Which statement should I consider? What is most important?
    Thanks.

    Roger25 wrote:
    ... Based on this, my question is what statement to choose? which is more important, the cost or the cpu cost?
    Thanks.
    Based on this, sorry, but my reply will remain unchanged:
    Again, you cannot compare explain plan of two different queries.
    Find out more:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:313416745628
    Nicolas.

  • Explain plans for PL/SQL code?

    Hi!
    I am pulling SQL statements (select, insert, update, delete, etc.) from PL/SQL code and producing explain plans. Some of the delete statements have "WHERE CURRENT OF" in them which produces an ORA-3001 error (feature not implemented) error. How can I do an explain plan of these statements? Can I replace "WHERE CURRENT OF" with "=" to get a plan? How far off will the plan be? Any suggestions, ideas, etc. greatfully appreciated!
    This is Oracle 9.2.0.4/5 on AIX if it makes a difference.
    Thanks!
    Dave Venus

    WHERE CURRENT OF shouldn't be a problem. Here above an example on 9.2.0.4 on AIX5.2 :
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.2.0.4.0 - Production
    SQL> create table TBL_USER_PROFILE_CATEGORY
      2  as
      3  select 654 id_category, 1103 id_user from dual union all
      4  select 654 id_category, 1104 id_user from dual union all
      5  select 18  id_category, 1103 id_user from dual union all
      6  select 629 id_category, 1103 id_user from dual union all
      7  select 110 id_category, 1103 id_user from dual union all
      8  select 110 id_category, 1104 id_user from dual union all
      9  select 18  id_category, 1104 id_user from dual union all
    10  select 37  id_category, 1103 id_user from dual union all
    11  select 24  id_category, 1103 id_user from dual union all
    12  select 7   id_category, 104  id_user from dual union all
    13  select 37  id_category, 1104 id_user from dual union all
    14  select 22  id_category, 1103 id_user from dual union all
    15  select 22  id_category, 1104 id_user from dual union all
    16  select 25  id_category, 1104 id_user from dual union all
    17  select 25  id_category, 1103 id_user from dual ;
    Table created.
    SQL>
    SQL> alter table TBL_USER_PROFILE_CATEGORY add primary key (id_category, id_use
    Table altered.
    SQL>
    SQL> CREATE OR REPLACE
      2  PROCEDURE P$UPDATE_TBL_USER_PROFILE_CAT(p_id_cat_old IN NUMBER) AS
      3    p_id_category number;
      4    p_id_user     number;
      5    cursor mycur is select id_category, id_user
      6                    from TBL_USER_PROFILE_CATEGORY
      7                    where  id_category = p_id_cat_old
      8                    for update of id_category;
      9  BEGIN
    10    open mycur;
    11    LOOP
    12       FETCH mycur INTO p_id_category, p_id_user;
    13       EXIT WHEN mycur%NOTFOUND;
    14       BEGIN
    15 DELETE FROM TBL_USER_PROFILE_CATEGORY
    16 WHERE CURRENT OF mycur;
    17       END;
    18     END LOOP;
    19     CLOSE mycur;
    20     COMMIT;
    21  EXCEPTION WHEN OTHERS THEN rollback;
    22  END;
    23  /
    Procedure created.
    SQL>
    SQL> exec P$UPDATE_TBL_USER_PROFILE_CAT(654)
    PL/SQL procedure successfully completed.
    SQL> select * from TBL_USER_PROFILE_CATEGORY;
    ID_CATEGORY    ID_USER
             18       1103
            629       1103
            110       1103
            110       1104
             18       1104
             37       1103
             24       1103
              7        104
             37       1104
             22       1103
             22       1104
             25       1104
             25       1103
    13 rows selected.
    SQL> Please, paste here what's your code...
    Nicolas.

  • Offer Multiple choice for movies playing in one location (Newbie)

    Hi,
    I'm definitely a Flash C3 newbie (newbie for all of flash!).
    I've been able to figure out how to embed a flash movie in my web
    page, but now I need to offer the user a choice of which movie to
    play - and then start that movie in one location... this must be
    CSS compliant and HTML STRICT... I think I need to address this
    through Flash, as I can't figure out how to do it via HTML or
    CSS... Help me, please.

    The steps are correct but you've left out the one that adjusts the 2 through 9 movies position as compared to the others.
    The first video would hold a position of 0,0 (upper left). When you add the second video you need to adjust its "offset" to position it next to but not overlapping the first. Since your videos are 100X75 you would set the offset of the second track too 100,0 (100 pixels to the right of the original and 0 pixels different in height). The third would be 200,0 offset.
    On the second row your first file would be 0,75 (75 pixels below the upper video). The second file on the second row would be offset 100,75 and the third would be 200,75.
    The third row would be 0,150 followed by 100,150 and 200,150.
    You could add a slight "border" between each video and give it a color by using the bgcolor="your color" (standard html color codes) and adding that space by adjusting the offset plus your border width in pixels. Hollywood Squares style of video.
    http://homepage.mac.com/kkirkster/03war/ one of my older files that uses multiple track video playback of a QuickTime file. The "TV" set is a track and the video that plays "inside" it is another. The still image movies are also separate tracks and QuickTime .mov files can hold up to 99 tracks.

  • Different plan for same SQL in different version of DB

    Hello,
    At client side i have upgraded database from 11.2.0.1.0 to 11.2.0.2.0 . and after that i am facing performance related issue.
    is this happen because of up-gradation ?
    for testing i have created two different version db (i.e 11.2.0.1.0 to 11.2.0.2.0 ) with same volume and same parameter. now i am executing same query then i am getting different plan.
    please help me to resolve this issue..

    Which issue? CBO is upgraded with every new release! So, yes, execution plans may change because of that.
    And sensible DBA's first upgrade a test database.
    Also no statement is to be seen.
    Secondly, you can always set optimizer_features_enable to the lower release.
    Finally, please look up 'upgradation' in an English dictionary. You won't find it!!!
    Sybrand Bakker
    Senior Oracle DBA

  • Time for a new startup disk for beige G3 - which one?

    What is a good replacement startup disk [still using 9 GB it shipped with]? I'd also like to install a second internal drive.

    Hi, Terry -
    Your Beige G3 is one of the models subject to the 8GB limit. This is simply an item of concern, not one of hindrance.
    Once you get the new drive installed, initialize it using OS 9's Drive Setup while booted to your OS 9 Install CD. If you are adding the drive as a second internal drive, you can use Drive Setup while booted to the original hard drive.
    As part of the initialization process, partition the drive such that the first (top in the list) volume is slightly less than 8GB - 7.7GB is a safe size. Then complete the initialization. Be sure to select Mac OS Extended (also called HFS+) as the format.
    If you're not familiar with doing that - Using Drive Setup
    Then place OS 9 on the first partition. OS 9 is not fussy about where programs are, so those can be placed on the other parition if you wish. However, the machine will run a little bit faster if the programs are kept on the same volume as the OS.

  • Need a new adapter for Tecra A2 - which ones is compatible?

    Please help!!
    My adapter has stopped working and the serial number was PA3282U-1ACA. Will an adapter with the serial number PA3083U-1ACA work with my laptop? What other compatible adapters are there?
    Thanks

    I know, I know - but its too expensive to order it from Toshiba, and the places I've found via Goggle look a bit dodgy.
    Would the
    PA3201U
    PA3283U or
    PA3083U be compatible, or could they damage my laptop?

  • Plan Table for running SQL..

    Hi There,
    How can I go through the explain plan for a SQL query running by a particular user?
    For example:
    User A is running: select * from table x , table y where x.id = y.id;
    User B login and can do explain plan on the query running above to get the total cost..etc.
    Thanks

    user5545873 wrote:
    More specifically, I want to know how to connect the session id SID and the SQL_ID (we can get both from v$session_longops) with the v$sql_plan.. or plan_table.
    THanks
    Edited by: user5545873 on Oct 2, 2009 12:10 PMhoek's idea of using Oracle trace and tkprof generating execution plans should work.
    Aside from that, you might be able to trace through the V$ tables to get the info you are looking for. I personally find the V$ tables to be a bit erratic regarding what is there and what is not so you may or may not find everything you are looking for.
    Are you asking for join columns?
    Table                     Column          Datatype     Join Column
    v$session_longops     sql_id             varchar2(13)    v$sql.sql_id
                            sql_address     raw(8)             v$sql.address
                            sql_hash_value     number             v$sql.hash_value
    v$sql_plan             address             raw(8)          v$sql.address
                         child_address     raw(8)             v$sql.child_address
                         child_number     number             v$sql.child_number
                         hash_value     number             v$sql.hash_value

Maybe you are looking for