Explain plan for timesten and Oracle

we have a base table in our Oracle 10g database. We created a DSN for this in timesten 7.0 database and are able to connect. Now we have created 3 materialized views in timesten on top of the Oracle Base Table. How can we get the explain plan in timesten to find out when the table is being called by a custom java application, the materialized views are being used or not ? Please advice

Hi Can you help me in this regards,
i am getting the following error. Can you tell me how can i get rid of them?
Command> call ttcachestart();
15001: User lacks privilege ADMIN

Similar Messages

  • Efficient way to read through big explain plan and genterate html explain plan for sql id's executed in past

    Hi,
    I have a sql which is recently having a performance problems in Production. I have generated a explain plan for it trying to find out what it is doing but plan itself is close to 1000 lines. I want to check if there is any efficient way to go through big plan like this one and quickly find the damaging areas..
    2) I also wanted to know if there is way to generate explain plans in HTML format which executed in past and have entry in dba_hist_sqltext.
    3) I also have two sql_monitor reports which I want to compare. is there any efficient way to do it as well?
    Please share your thoughts!
    Thanks in advance!
    Regards,
    Suman-

    Hi,
    I suggest you can try running sql advisor on the query maybe something fruitful comes up
    http://www.oracle-base.com/articles/11g/sql-access-advisor-11gr1.php
    I am not sure about the explain plan being printed in html format but
    You may also want to try the sqlhistory.sql query from below page
    http://evdbt.com/scripts/
    I have used it many times to check on executions and explain plans which may have changed over the period
    I have faced it many times , the query picks up a bad explain plan and performs poorly

  • How to change the explain plan for currently running query?

    Hi All,
    I am using Oracle enterprise 9i edition. I have a query which frames dynamically and running in the database. I noticed a table with 31147758 rows
    in the query which has no indexes and taking more time to process. I tried to create an INdex on that table. I know the query is already running with a FULL table scan. Is it possible to change the explain plan for the current running query to consider the INDEX?
    [code]
    SELECT /*+ USE_HASH (c,e,b,a) */
    d.att_fcc extrt_prod_dim_id,
    d.att_fcc compr_prod_dim_id,
      a.glbl_uniq_id glbl_uniq_id,
      to_date(c.dit_code,'RRRRMMDD')STRT_DT,
      (to_date(c.dit_code,'RRRRMMDD')+150)END_DT,
      a.pat_nbr pat_id,
      a.rxer_id       rxer_id,
      e.rxer_geog_id  rxer_geog_id,
      a.pharmy_id pharmy_id,
      a.pscr_pack_id pscr_pack_id,
      a.dspnsd_pack_id dspnsd_pack_id,
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr ORDER BY c.dit_code) daterank,
      COUNT( DISTINCT d.att_fcc ) OVER (PARTITION BY a.pat_nbr, c.dit_code) event_cnt
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
    d.att_fcc
      ORDER BY c.dit_code) prodrank,
      DENSE_RANK () OVER (PARTITION BY a.pat_nbr,
    d.att_fcc
      ORDER BY c.dit_code DESC) stoprank
      FROM
      pd_dimitems c,
       pd_pack_attribs   d ,
        lrx_tmp_rxer_geog e,
        lrx_tmp_pat_daterank p,
        lrx_tmp_valid_fact_link     a
        WHERE c.dit_id = a.tm_id
        AND   e.rxer_id = a.rxer_id
        AND   a.glbl_uniq_id = p.glbl_uniq_id
        AND   p.daterank > 1
      AND   a.pscr_pack_id = d.att_dit_id
    [/code]
    The table lrx_tmp_pat_daterank is having that 31147758 rows. So I am wondering how to make the query to use the newly created index on the table?

    Why do you think using Indexes will improve the performance of the query? How many rows this query is returning? Optimizer might chose a Full table scan when it finds out that Index plan might not be useful. Why are you using /*+ USE_HASH (c,e,b,a) */ hint? This Hint will force oracle to use Full table scan instead of using the index. Try removing it and see if the plan changes.
    Regards,

  • Explain Plan for domain index

    I am running explain plan for queries using a domain index. i.e. an oracle text 'contains' clause. The usage of the domain index appears in the plan o.k, but I am interested in seeing the underlying access to the DR$...$I etc tables and assoicated indexes belonging to ctxsys. Is it possible to see this access ?
    Basically I have all the objects created by the domain index in their own tablespace using a storage preference, but I am wondering if the sub indexes should be moved out from the sub tables for better performance ? Any guidance is appreciated.

    I am running explain plan for queries using a domain index. i.e. an oracle text 'contains' clause. The usage of the domain index appears in the plan o.k, but I am interested in seeing the underlying access to the DR$...$I etc tables and assoicated indexes belonging to ctxsys. Is it possible to see this access ?
    Basically I have all the objects created by the domain index in their own tablespace using a storage preference, but I am wondering if the sub indexes should be moved out from the sub tables for better performance ? Any guidance is appreciated.

  • Explain Plan for Procedure

    Hi,
    For getting the explain plan for a query, we use the statement
    "explain plan for " + Query
    Similarly, to get an explain plan for a procedure, do we have any way like
    "explain plan for " + "Execute " + Procedure
    How do we get an explain plan for a procedure that is executed
    Thanks in Advance.

    teckfreak wrote:
    Hi Robert,
    I am working on an utility application which will execute the procedure and show the explain plan to the user for him to analyze the explain plan and take necessary steps for optimization. I am showing the Procedure inputs to the user, allowing him to enter values and taking them and executing the procedure. I am setting the trace and extracting the explain plan for the procedure using TKPROF utility and showing it to the user.
    While doing so, the trace file is stored in udump folder. I am accessing the trace file from TKPROF utility. I am able to run the TKPROF from the command prompt. But if I try automating the TKPROF command in a .NET application using Process.Start, it says "Not able to access the file.". I tried giving full permissions to Everyone and it still throws the error. Kindly guide me how to proceed.. A different approach that you might want to consider (as indicated by William):
    - Flush the shared pool and use a unique MODULE description for each execution of your procedure (e.g. using DBMS_APPLICATION_INFO.SET_MODULE), e.g. using a logon trigger
    - Query V$SQL for your unique MODULE description and run DBMS_XPLAN.DISPLAY_CURSOR for each corresponding child cursor found (SQL_ID + CHILD_NUMBER) in the shared pool. This plan generation could be automated using a procedure
    The result of this approach corresponds to the tracing using TKPROF since it will provide the actual execution plans used at runtime rather than separate EXPLAIN PLAN results which might differ from the actual plans.
    This assumes that your shared pool is sufficiently large to hold all the child cursor created by your procedure without aging them out while the procedure is running. It's probably also only applicable to an environment where not too much work is being done while running this test and the recommended flushing of the shared pool.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Explain Plan for Multiple SQL

    Hi ,
    Our db version is Oracle 8i and looking for solution.
    I have multiple select sql statments and need to get the explain plan for all statments.
    Is it possible to take explain plan for all statments one time? If so please provide the steps.
    Thanks.
    Happy Halloween.

    Not sure exactly you are looking. But if you do
    set autotrace on
    from sqlplus and put all the query in a script, you should get all explain plan in one shot. You can spool the output to a file.

  • How to run Explain Plan for SP?

    Can we run Explain Plan for SP??

    EXPLAIN PLAN creates an execution plan for SQL statements. PL/SQL is not SQL.
    PL/SQL procedures can contain SQL, yes. These SQLs can be copied and pasted from PL/SQL into something like TOAD and execution plan determined.
    However, if the aim is to see the "execution/performance plan" for PL/SQL code, then you need to profile the PL/SQL code using the DBMS_PROFILER package. This will tell you the execution path and elapsed time to execute a line of PL/SQL.
    Details can be found in the [url http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_profil.htm#sthref5502]Oracle® Database PL/SQL Packages and Types Reference guide.

  • What privileges needed for producing explain plan for other user's object ?

    Hi there,
    What privileges needed for producing explain plan for other user's object (tables) ?
    Cheers
    Soheil

    Experiment: (public plan table exists)
    create user bob identified by bob;
    grant create session to bob;
    connect bob/bob
    start sample_plan
    If will error off on the table being read in the plan
    connect dba_or_privileged_user
    grant select on the referenced_table(s) to bob;
    connect bob/bob
    start sample_plan
    It will now work providing a public plan table exists or you give bob create table and create a bob.plan_table
    I ran the experiment on Oracle version 9.2.0.6 running on AIX 5.3. Select privilege on all referenced tables in the explained SQL must exist
    HTH -- Mark D Powell --

  • Explain plan for same query in three databases

    Hi,
    We have three databases dev, uat and test, all have same init parameters and almost same data. We are running a query which runs long on dev and on uat and test it runs very fast, the explain plan on uat and test shows a cost of around 4000 but on dev the cost is 20000. Statistics were collected on three instances 2 days ago and the objects are also same.
    My question is what else should I look for this optimizer behaviour? the database version is 10.2.0.3.
    Please help.
    Thanks
    Clin

    user627471 wrote:
    Hi,
    We have three databases dev, uat and test, all have same init parameters and almost same data. We are running a query which runs long on dev and on uat and test it runs very fast, the explain plan on uat and test shows a cost of around 4000 but on dev the cost is 20000. Statistics were collected on three instances 2 days ago and the objects are also same.
    My question is what else should I look for this optimizer behaviour? the database version is 10.2.0.3.
    Please help.
    Thanks
    Clinpost both EXPLAIN PLAN here

  • How to find Explain Plan for a large querry which has multiple sub querries

    Hi All,
    I have a Package which has many procedures and one of the procedure has a cursor which is like 2000 lines. This cursor has a main select statement which again has many select statements in it.
    Now how do I do the explain plan for the main select statement?
    If it can be done easier way in toad(or SQLPLUS), please tell me...

    When your query takes too long ...

  • Explain Plan for Materialized Views in 10g

    I am verifying explain plan for few queries on 10g as compared to 9i I was wondering in Materialized Views queries MAT_VIEW ACCESS instead of TABLE ACCESS is it expected behaviour or am missing something?
    Couldn't find information in 10g documentation
    thanks in advance

    I've put together a query for the v$sql_plan in 9iR2.
    Depending on what you use, you can probably drop some columns (eg OTHER and partition columns) and you could drive it from the v$session by getting the hash_value from there for the sid you are interested in :
    (select * from v$sql_plan where hash_value =
    (select sql_hash_value from v$session where sid=:sid))
    select level, optimizer, lpad('_',1*(level-1),'_')||operation operation,
    options, object_owner||'.'||object_name obj_name, search_columns,
    ltrim(to_char(cardinality,'999,999,999')) no_rows,
    ltrim(to_char(bytes/1024,'999,999')) kbytes, cost tot_cost,
    object_node link, id, parent_id, other_tag||':'||other other,
    partition_start, partition_stop, cpu_cost, io_cost,
    access_predicates, filter_predicates,
    round(temp_space/(1024*1024),2) temp_space_mb
    from (select * from v$sql_plan where hash_value = :hash_val)
    start with id=0
    connect by prior id = parent_id and prior child_number = child_number
    order by child_number, id, position;

  • Explain plan for query with variables

    Trying to Explain plan for some sql in sql*plus. The query has a variable in it. How do I do this ?
    I did look into explain plan and dbms_xplan but could not find anything with variables

    use sqlplus bind variables:
    SQL> --define variable
    SQL> var x varchar2
    SQL> -- notice the colon prefixing the variable
    SQL> explain plan for select * from customer where cid = :x;
    Explained.
    SQL> select * from table( dbms_xplan.display );
    PLAN_TABLE_OUTPUT
    Plan hash value: 1709312366
    | Id  | Operation                   | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |          |     1 |    67 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| CUSTOMER |     1 |    67 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | CID      |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CID"=:X)
    14 rows selected.the variable does not need to be set to explain the query, since explain does not actually execute.
    Edited by: shoblock on Nov 6, 2008 4:51 PM

  • Explain plan for Procedures

    Hi,
    I know we can generate explain plan for queries using "Explain plan" statement or "Autotrace option". I would like to know how can we generate explain plan for oracle procedures.
    Thanks in Advance..

    Check this link very helpful info from Rob
    When your query takes too long ...
    There are no explain plan for procedures.
    MAy be you want to do DBMS_PROFILER for procedures execution

  • Explain plan for MVIEW....

    Hi All,
    please tell me how to invoke EXPLAIN PLAN for CREATE MATERIALIZED VIEW.
    while i am trying to get plan i am getting following error
    ORA-00900: invalid SQL statement
    Thanks in advance.

    Thanks for reply.
    I need it for estimation and solution design. so all
    parameters are necessary. second thing is DDL and
    simple SELECT statements plan are differ. I can get
    explain plan for CREATE TABLE AS SELECT but not for
    CREATE MV.
    Regards,
    Santosh.In case you didn't notice: Create table as select (CTAS) is also DDL.
    There is nothing additionally from point of the execution plan that is added by the CREATE MV command.

  • Explain plan for Query performance

    Hi Gurus,
    I need to improve the performance of a procedure. The procedure has the below QUery. I dont have Idea on how to imrpove the perf by seeing the explain plan. Can anyone please help me to explain where I need to change the code.
    The below are the code and Explain plan for the same.
    -----------Code----------------------------
    SELECT IV_STORECODE AS STORECODE,
                                   TO_CHAR(RD.ITEMCODE) AS ITEMCODE,
                                   C.ITEMCATEGORYNAME,
                                   ISUB.ITEMSUBCATEGORY1NAME
                              FROM RECEIPTS R
                             INNER JOIN RECEIPTDETAILS RD
                                ON R.RECEIPTID = RD.RECEIPTID
                             INNER JOIN ITEMCOMPANY IC
                                ON IC.ITEMCODE = RD.ITEMCODE
                             INNER JOIN ITEMCATEGORY C
                                ON IC.ITEMCATEGORY = C.ITEMCATEGORYID
                             LEFT OUTER JOIN ITEMSUBCATEGORY1 ISUB
                                ON ISUB.ITEMSUBCATEGORY1ID = IC.ITEMSUBCATEGORY1
                               AND ISUB.ITEMSUBCATEGORY1ID IN
                                   (SELECT ITEMSUBCATEGORY1ID
                                      FROM ITEMSUBCATEGORY1
                                     WHERE ITEMCATEGORYID = IV_ITEMCATEGORY)
                             INNER JOIN STORE SE
                                ON SE.STORECODE = R.STORECODE
                             WHERE R.STORECODE = IV_STORECODE
                               AND SE.HOSPITALID = IV_HOSPITALID
                               AND TRUNC(R.CREATEDDATE) BETWEEN V_FROMDATE AND
                                   V_TODATE
                               AND R.STATUSID NOT IN (99, 5)
                                  AND
                                   (IV_DRUGTYPE IS NULL OR
                                   IC.DRUGTYPECATEGORYID = IV_DRUGTYPE)
                            UNION
                            SELECT IV_STORECODE AS STORECODE,
                                   TO_CHAR(STD.ITEMCODE) AS ITEMCODE,
                                   C.ITEMCATEGORYNAME,
                                   ISUB.ITEMSUBCATEGORY1NAME
                              FROM STOCKTRANSACTION ST
                             INNER JOIN STOCKTRANSACTIONDETAILS STD
                                ON ST.STOCKTRANSACTIONID = STD.STOCKTRANSACTIONID
                             INNER JOIN ITEMCOMPANY IC
                                ON IC.ITEMCODE = STD.ITEMCODE
                             INNER JOIN ITEMCATEGORY C
                                ON IC.ITEMCATEGORY = C.ITEMCATEGORYID
                              LEFT OUTER JOIN ITEMSUBCATEGORY1 ISUB
                                ON ISUB.ITEMSUBCATEGORY1ID = IC.ITEMSUBCATEGORY1
                               AND ISUB.ITEMSUBCATEGORY1ID IN
                                   (SELECT ITEMSUBCATEGORY1ID
                                      FROM ITEMSUBCATEGORY1
                                     WHERE ITEMCATEGORYID = IV_ITEMCATEGORY)
                             INNER JOIN STORE SE
                                ON SE.STORECODE = ST.STORECODE
                             WHERE ST.STORECODE = IV_STORECODE
                               AND SE.HOSPITALID = IV_HOSPITALID
                               AND TRUNC(ST.CREATEDDATE) BETWEEN V_FROMDATE AND
                                   V_TODATE
                               AND ST.STATUS <> 99
                               AND STD.ITEMCODE NOT LIKE '%#%'
                               AND                   
                                   (IV_DRUGTYPE IS NULL OR
                                   IC.DRUGTYPECATEGORYID = IV_DRUGTYPE)
                            UNION
                            SELECT D.STORECODE,
                                   TO_CHAR(D.ITEMCODE) AS ITEMCODE,
                                   C.ITEMCATEGORYNAME,
                                   ISUB.ITEMSUBCATEGORY1NAME
                              FROM DAILYINVENTORY D
                             INNER JOIN ITEMCOMPANY IC
                                ON IC.ITEMCODE = D.ITEMCODE
                             INNER JOIN ITEMCATEGORY C
                                ON IC.ITEMCATEGORY = C.ITEMCATEGORYID
                              LEFT OUTER JOIN ITEMSUBCATEGORY1 ISUB
                                ON ISUB.ITEMSUBCATEGORY1ID = IC.ITEMSUBCATEGORY1
                               AND ISUB.ITEMSUBCATEGORY1ID IN
                                   (SELECT ITEMSUBCATEGORY1ID
                                      FROM ITEMSUBCATEGORY1
                                     WHERE ITEMCATEGORYID = IV_ITEMCATEGORY)
                             INNER JOIN STORE SE
                                ON SE.STORECODE = D.STORECODE
                             WHERE D.STORECODE = IV_STORECODE
                               AND SE.HOSPITALID = IV_HOSPITALID
                               AND TRUNC(D.UPDATEDDATE) <= V_TODATE
                               AND D.QTY > 0
                               AND D.ITEMCODE NOT LIKE '%#%'
                               AND C.ITEMCATEGORYID = IV_ITEMCATEGORY
                                  AND (IV_DRUGTYPE IS NULL OR
                                   IC.DRUGTYPECATEGORYID = IV_DRUGTYPE)
                               AND (IV_SUBITEMCATEGORY IS NULL OR
                                   ISUB.ITEMSUBCATEGORY1ID = IV_SUBITEMCATEGORY) Will post the explain plan ..
    Thanks in advance..

    Ensure you also include all the other information people will need to help you, e.g. database version, table structures/relationships and cardinalities, row counts etc.
    See the two threads linked to in the FAQ: {message:id=9360003}

Maybe you are looking for

  • Airport Extreme set up with Time Warner

    OK. I am experiencing a similar problem as mentioned in a differnt thread, but a bit different. First my Airport Utlility is 6.3.1 so the graphics for settings are completely different.  I have an ATV2, Black Mccbook and Ipad2. My problem is when I t

  • Web template - Drop Down Box options - Issue

    <b>Requirement:</b> We need drop downboxes for Fiscal Period and Version in our web template. When the query is run, users will choose one fiscal period and one budget version (there are multiple budget versions - 1. Original Budget, 2. Revised Budge

  • Data recovery after hard reset???

    My Z22 crashed and wouldn't respond to screen taps. Soft resets didn't help, so I had to do a hard reset. The device still does not work. Before I throw it away, does anyone know of a data recovery app that will recover my data? thanks, david Post re

  • How do I install Leopard on MacBook Pro Retina Partition

    I am trying to install either Leopard or Snow Leopard on a partition of my MBP Retina. I can set up the partition but how do I load a new OS on that Partition with an external Super Drive. I also have VMWare Fusion and am trying to do it that way or

  • Mac OS 10.4.3 Sleep, Powerbook G4, Airport, External Display Problems

    I am running Mac OS 10.4.3 on my G4 Powerbook, system spec as follows Machine Model: PowerBook5,6 CPU Type: PowerPC G4 (1.2) Number Of CPUs: 1 CPU Speed: 1.67 GHz L2 Cache (per CPU): 512 KB Memory: 1 GB Bus Speed: 167 MHz Boot ROM Version: 4.9.1f1 Se