Query analyzing in Oracle

Hi,
I use the execution plan in the PL/SQL for analyzing complex queries. There is evaluation of the queries and subqueries as "cost". Is this value reputable?
I have two views A and B which have the same purpose but have a different definition. The view A has costs of 280, and B 155. But a tests shows that the last view needs some milliseconds more.
What's that?

see: http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:313416745628

Similar Messages

  • Is the query analyzer part of SQL Server?

    Hey all,
    I have installed SQL Server 2005 on windows 2003 server. It did not install the query analyzer.
    Is the query analyzer part of SQL Server or do we need to install it separately?
    Thank you,
    Bye.

    Is there something about this question that is related to Oracle? It would appear that you'd want to ask this over in an appropriate Microsoft SQL Server forum...
    Justin

  • Query Analyzer

    Hi,
    Pls explain me what is query analyzer. our client is goint to ask us to implement the query analyzer before applying any sp or packages in our production setup. Kindly give some idea on how to configure, whether its any third party tool and how to work with.
    Thanks in advance
    Phani Kumar

    Phani  wrote:
    Hi,
    Pls explain me what is query analyzer. our client is goint to ask us to implement the query analyzer before applying any sp or packages in our production setup. Kindly give some idea on how to configure, whether its any third party tool and how to work with.
    Thanks in advance
    Phani KumarYes it is a third party tool.
    Query Analyzer allows you to connect to an Oracle database and create any query, see the results, and import results to text or excel files.
    HTH:-)

  • SQL Query Analyzer

    I use SQL server and Query Analyzer.
    What is the comparable/like "hopefully free" product that I can use with Oracle Database XE instead of the Run SQL command line program option?

    It gives you screen where you can execute SQL scripting/commands such as create database objects such as tables, stored procedures, functions, etc. and run select/update/insert sql statements against the database.

  • Query works in Oracle Client but not JDBC

    The query is as follows:
    SELECT COUNT(*) THE_COUNT FROM sentorders WHERE ordersentdate BETWEEN '15-JAN-01' and '15-JAN-03';When I run this query in the Oracle client (SQL+) it tells me that THE_COUNT is 4 which is correct but when I use the following JDBC code I get THE_COUNT is 0 which is incorrect.
    public ResultSet viewTotalSentOrdersByDate()
      throws SQLException, Exception {
          String beginDate = "15-JAN-01";
          String endDate = "15-JAN-03";
          ResultSet rs = null;
        try  {
          String queryString = ("SELECT COUNT(*) THE_COUNT FROM sentorders WHERE ordersentdate BETWEEN '" + beginDate + "' and '" + endDate + "'");
          System.out.println(queryString);
          Statement stmt = con.createStatement();
          rs = stmt.executeQuery(queryString);
          while(rs.next()) {
           System.out.println(rs.getString("THE_COUNT"))
        } catch (SQLException sqle) {
          error = "SQLException: Could not execute the query.";
          throw new SQLException(error);
        } catch (Exception e) {
          error = "An exception occured.";
          throw new Exception(error);               
        return rs;
      }Thanks for the help
    Zac

    The query is as follows:
    SELECT COUNT(*) THE_COUNT FROM sentorders WHERE ordersentdate BETWEEN '15-JAN-01' and '15-JAN-03';When I run this query in the Oracle client (SQL+) it tells me that THE_COUNT is 4 which is correct but when I use the following JDBC code I get THE_COUNT is 0 which is incorrect.
    public ResultSet viewTotalSentOrdersByDate()
    throws SQLException, Exception {
    String beginDate = "15-JAN-01";
    String endDate = "15-JAN-03";
    ResultSet rs = null;
    try {
    String queryString = ("SELECT COUNT(*) THE_COUNT FROM sentorders WHERE ordersentdate BETWEEN '" + beginDate + "' and '" + endDate + "'");
    System.out.println(queryString);
    Statement stmt = con.createStatement();
    rs = stmt.executeQuery(queryString);
    while(rs.next()) {
    System.out.println(rs.getString("THE_COUNT"))
    } catch (SQLException sqle) {
    error = "SQLException: Could not execute the query.";
    throw new SQLException(error);
    } catch (Exception e) {
    error = "An exception occured.";
    throw new Exception(error);
    return rs;
    }Thanks for the help
    Zac

  • How to create a Matrix table using this data in SQL Query Analyzer

    Hello all,
    I have a problem while I am trying to represent my Sql Table namely table1 in Matrix form
    my table Format is
    city1 city2 Distance--------------------------------------------------------
    Mumbai Delhi 100
    Delhi Banaras 50
    Mumbai Rajasthan 70
    Banaras haryana 40
    Mumbai Mumbai 0
    784 entries
    there are 784 cities each having link to other
    Now i want my output as
    Mumbai Delhi Banaras haryana
    Mumbai 0 100 -- --
    Delhi 100 0 50 --
    Banaras
    haryana
    respective distance from one city to other should be shown
    final Matrix would be 784*784
    I am using SQL Query Analyser for this
    Please help me in this regard

    I'm pretty much certain that you don't want to do this in pure SQL. So that means that you want to do it with a reporting tool. I'm not familiar with SQL Query Analyzer, but if it is in fact a reporting tool you'll want to consult its documentation looking for the terms "pivot" or perhaps "cross tab."

  • Query off of Oracle using WinSql - Need help with query

    I am trying to query off of Oracle using program WinSql.
    I have a table(tticpr200110) that has the following sample data:
    ITEM     CODE     T$AMNT
    23500076 ACL     .0049
    23500076 APM     0
    23500076 APO     .0093
    23500076 EXP     .0001
    23500076 RES     .0072
    and what I want it to look like is:
    ITEM     ACL     APM     APO     EXP     RES
    23500076     0.0049     0     0.0093     0.0001     0.0072
    (actually I need the last 2 columns added together to be MATL-but can deal with that down the road).
    Seems simple enough, but I don't know to put into the columns.
    Any help would be GREATLY appreciated as soon as possible would be even better.

    My table - tticpr200110 when it runs I get the following sample data for part number 23500076:
    The first coloumn ITEM is the part number.
    The second column CODE is 1 of 5 different cost codes
    The third column is the cost for that code for that part.
    ITEM CODE AMNT
    23500076 ACL 0.0049
    23500076 APM 0.0000
    23500076 APO 0.0093
    23500076 EXP 0.0001
    23500076 RES 0.0072
    I want to make a query that makes the data look like this:
    ITEM ACL APM APO EXP RES
    23500076 0.0049 0.0000 0.0093 0.0001 0.0072
    (similar to a pivot table in excel or acess)
    I hope this helps better.
    Thanks!

  • Why 0FISCVARNT is not shown in Query Analyzer?

    I have a cube, when I look at its dimensions from RSA1->Info provider under Time Dimension,
    I see Fiscal Year, Fiscal year Variant and Fiscal Year Period.
    But when I go to Query Analyzer and develop a query on it, under Dimensions Fiscal Year Variant is missing, why?

    Hi,
    Are you creating query on info cube or multiprovider? Have you included info cube in multiprovider and identified the fiscal year variant in the multiprovider or not? If you are creating query directly on Info cube it is not possible that you won't see it.
    Please check if you are creating queriy on proper info provider.
    Regards,
    Kams

  • Query based on Oracle and MS Access connections

    I hope this is in the correct spot.
    I am using Oracle SQL Developer to extract data from some Read Only tables in Oracle.
    What I would like to do it have a list of numbers in a MS Access database to select the same number from Oracle tables, then export the data out to Access or Excel. There may be several thousand numbers at a time.
    I asked if they would give me one table with one column in Oracle I could read/write to but the answer was no.
    I have my connection strings working to both the Oracle tables and to the Access database but i can not figure out how to build a query using both tables.
    If I build a query to the Access table can I use that query somehow in the query of the Oracle table?
    Thanks
    Steve

    Not real sure if this is doable or would help, but perhaps you can load the access table into an Oracle Global Temporary Table? See http://www.oracle-base.com/articles/8i/TemporaryTables.php (and google on it). I think I'm assuming your 11 hour query had something to do with shovelling a bucketload of data to the access side, perhaps if you could show us the plan on the Oracle side that access was generating to get the Oracle data there might be a different answer.
    Oftentimes cross-db tools won't use Oracle features like analytics, or do slow-by-slow row processing where a short procedure could do things within the Oracle sql engine and return data in larger arrays.
    Sometimes mass data cleansings benefit from using server side tools outside of the db. Do you have the data from before it was loaded to Oracle? What Oracle platform are you on?

  • Query Builder in Oracle 9i

    We use the tool Query Builder in our Oracle BD version 8.0.5.1. We have a development version of Oracle 9i and I don't see anything like Query Builder. What product is replacing Query Builer in Oracle 9i ??
    THANKS

    Version 1.5.1 Build MAIN-5440 for Mac OS X
    Update: It is actually selecting the columns. If I click a column and look in the Show SQL and View Results it's there but it's just not displaying it on the select columns screen.
    This must be a bug?

  • Problem about printing special character in bex query analyzer

    Hi,
    in bex query analyzer i have created one restricted key figure , in which i have substracted two date with the help of replacement path.
    So i got result.
    But i am facing one problem. when in both date, if one date is null or # then it is giving some big value like -734567.
    But i want some special character like X instead of this big values.
    So how can i do this?
    With the help of if and else it can be done.
    But how can we print special character in report.
    Please help me
    Thank you in advance

    hi,
    You cannot show X in a formula result. You can highlight the row using exception.
    Still if you want to show X in the result then you need to create a formula variable on a char which returns X value all the times.
    Then you can use the three formula variable to write a formula so that it shows the difference:
    date1 -- formula variable
    date2 -- formula variable
    charx -- formula variable.
    the formula will be
    Count(date1)Count(date2)(date1 - date2) + charx *(count (delta(date1) + delta(date2))).
    this would return the X value if any of the dates are empty otherwise their difference.
    regards.
    Arvind.

  • Sub-query problem on Oracle 10g

    The following query works on Oracle 10.2.0.1.0 on windows,but doesn't work on Oracle 10.2.0.2.0 on Linux.
    Error report: SQL Error: ORA-00904: "T"."AUDIT_USECS": invalid identifier 00904. 00000 - "%s: invalid identifier"
    It works after i remove the sub-query. I found that if use fields of T in sub-query,then error occurs. Is it saying that sub-query can't access the fields in main query?
    What's the problem?
    Is there any grammar erros?If so,what's the right likes?
    Thanks!
    CREATE TABLE AUDITHISTORY(
    CASENUM numeric(20, 0) NOT NULL,
    AUDIT_DATE date NOT NULL,
    USER_NAME varchar(255) NULL,
    AUDIT_USECS numeric(6, 0) NOT NULL,
    TYPE_ID INT NOT NULL )
    Query:
    SELECT T.CASENUM,
    T.USER_NAME,
    T.AUDIT_DATE AS STARTED,
    (SELECT *
    FROM (SELECT S.AUDIT_DATE
    FROM AUDITHISTORY S
    WHERE S.CASENUM=T.CASENUM AND TYPE_ID=2
    AND S.USER_NAME=T.USER_NAME
    AND (S.AUDIT_DATE > T.AUDIT_DATE OR (S.AUDIT_DATE = T.AUDIT_DATE AND S.AUDIT_USECS > T.AUDIT_USECS))
    ORDER BY S.AUDIT_DATE ASC,S.AUDIT_USECS ASC
    ) WHERE rownum <= 1) AS ENDED
    FROM AUDITHISTORY T WHERE TYPE_ID=1
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod PL/SQL Release 10.2.0.2.0 - Production
    CORE 10.2.0.2.0 Production
    TNS for Linux: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production

    Try this way:
    SQL> select * from AUDITHISTORY;
       CASENUM AUDIT_DAT USER_NAME            AUDIT_USECS    TYPE_ID
            10 12-MAR-10 USER                         100          1
            10 14-MAR-10 USER                         100          2
            10 16-MAR-10 USER                         100          2
    SQL> SELECT T.CASENUM,
      2  T.USER_NAME,
      3  T.AUDIT_DATE AS STARTED,
      4  (SELECT max(S.AUDIT_DATE) keep (dense_rank first order by S.AUDIT_DATE ASC,S.AUDIT_USECS ASC)
      5   from AUDITHISTORY S  WHERE S.CASENUM=T.CASENUM AND TYPE_ID=2
      6  AND S.USER_NAME=T.USER_NAME
      7  AND (S.AUDIT_DATE > T.AUDIT_DATE OR
      8       (S.AUDIT_DATE = T.AUDIT_DATE AND S.AUDIT_USECS > T.AUDIT_USECS))
      9  ) as ended
    10  FROM AUDITHISTORY T WHERE TYPE_ID=1;
       CASENUM USER_NAME            STARTED   ENDED
            10 USER                 12-MAR-10 14-MAR-10Max
    http://oracleitalia.wordpress.com

  • Report running very slow compared to Query Analyzer - high TimeDataRetrieval

    Hi,
    I have a report in SQL Reporting Services 2005 which calls a stored proc and the report takes a very long time to run and sometimes returns zero records. But when i run the stored proc in query analyzer it takes about 4 seconds!!
    I have checked the execution log on the RS using the below sql:
    Code Snippet
    use ReportServer
    Select * from ExecutionLog with (nolock) order by TimeStart DESC
    It shows that i have a large amount of time for the dataretrieval (601309ms, about 10mins) and does not return any records most likely because of a query timeout:
    TimeDataRetrieval  TimeProcessing  TimeRendering Source Status         ByteCount RowCount
      601309                      2227                     3                         1            rsSuccess 4916           0
    The weird thing is that when i run it in query analyzer, i get about 400 records in 4 seconds !!
    I dont understand what RS is doing to take up so much time like this to retrieve data.
    The report is very simple - it basically returns the records straight out into a table.
    The only thing I somewhat suspected was a parameter data type conflict between RS and SQL, specifically dates. I have a start and end date parameter in the report - i tried specifying this as date and string to see if it made any difference but it didn't.
    Any help would be greatly appreciated.

    Hi Mark,
    I didn't say it was an issue of parameter sniffing, and I didn't point you towards the good article about that <s>. I asked you whether you had read the article, described to you earlier in the thread.
    What I said was that it might be an issue of appropriate and dynamic query optimization, versus a cached query plan.  Parameter sniffing is only one of many ways that SQL Server tries to figure out how to optimize a query.  I thought the article did a good job of discussing some of what goes on during this process, and that by absorbing that you could think of ways to handle the wider issue that would be appropriate to your code.  I also pointed you to a thread in which I discussed this in more detail.
    While there are truly many issues with the date controls in the default parameter interface and how they behave, I don't think that what you're experiencing with the date format is implicated in the performance issue.  I guess it *might* be if (say) there is a non-default param value in your proc but your report parameter allows nulls. 
    Let's say the report server database has a different date default than your production database in your system. I have never sat down and tested this scenario and I guess it might cause problems, So we'll look at that first. 
    Whether the date format is at fault is really easy to prove one way or the other, and once proven can be pretty easy to fix:
    Create a test parameter that is of string type.  SQL Server is really good about dynamic conversion of string dates to date types as you probably know.
    place values (formatted however you want) into this version of the parameter instead of your date control parameter.  Use valid dates, in both formats.
    Does your performance change?
    Do you get the right results but bad performance with US format date strings versus right results with good performance with AU date values?
    Do you get the WRONG results with US format date strings, or with AU date strings?
    Try additional permutations involving casting/converting in your proc.
    FWIW, go ahead in the Query Analyzer and put the SAME values you see in the log into your tests there (in US format, I mean).  Do you get the CORRECT results?  Does performance change?  Hold this thought and see below.
    Another thing you can do is look at the query plan as presented by the Query Analyzer when you present the arguments different ways.  See #7 above -- try presenting the date in different formats.  Does the plan show the same path and the same indexes in use each time, or are some not possible because of the way the date has to be converted?  When this happens, the issue is usually that the conversion must be done for each line compared in the filter.  You can fix this really easily in most cases by cast/convert in the procedure so that your SELECT line is only doing that work once. 
    If the plans are different, and perhaps the indexes used are different and you *can't* fix it by fixing the date before the SELECT, do you need to add an index, or perhaps rebuild one?
    Moving on from the date format, as I said before it may be really important NOT to go by your interactive Query Analyzer performance because what you do there may not be used by SQL Server in determining a query plan to cache and re-use.  In case you haven't read the other discussion that I pointed you to at (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1827775&SiteID=1), think about using RECOMPILE or other options that will force a more dynamic investigation of the query.
     >L<

  • Create a query builder in oracle Apex

    Hi
    We have a request to create a query builder in oracle Apex particularly.But it provide the application builder and Utilities when we create the apex workspace.My question is any possibility are to make the application builder and utilizes as invisible
    regards
    apexuser

    hi scott,
    we no need to buid a report.we want generate a sql query using GUI drag and drop query builder.
    our suggestion is provide synonym for all objects and give to clinet,but in apex query builder only show view and table...
    it not show synonym thats the problem..
    simply we want oracle query browser.just want build a query.through synonym schema.
    we cerate a oracle user and provide synonym for live tables.then we provide the synonym user to client place,so they want build a query simpl.
    they dont have sql knowledge.
    regards
    apexuser

  • Query Interrupts w/ Oracle

    Hi,
    Any ideas on clean methods for interrupting long running queries to
    Oracle. Are any methods included in R3 for this.
    Thanks,
    Will

    Jennifer Medeiros@SUNLIFE
    09-18-97 01:20 PM
    Question:
    Are you using OCI (Oracle Call Interface) to access Oracle? If so, you
    want to look up two calls:
    OCAN
    -- Cancels current call
    OBREAK
    -- Breaks current call
    Of course, you still need to set some kind of alarm (to know when a call is
    going on "too long")
    If you're not using OCI, (if you're using embedded SQL to access Oracle)
    this won't work.
    Good Luck
    Jennifer Medeiros
    CSC Consulting
    One Newton Executive Park
    Newton Lower Falls, MA 02162 USA
    wshea @ uswest.com
    09/09/97 01:40 PM
    Please respond to [email protected]
    To: forte-users @ sagesoln.com
    cc: (bcc: Jennifer Medeiros/Group/CNO/SunLife)
    Subject: Query Interrupts w/ Oracle
    Hi,
    Any ideas on clean methods for interrupting long running queries to
    Oracle. Are any methods included in R3 for this.
    Thanks,
    Will

Maybe you are looking for

  • Lenovo 3000 H series computer boots up to a small blinking blue square on a black screen

    The computer powers on but after the Lenovo screen, the screen goes blank with a small blinking blue square on the left hand side and that's it? Anyone experienced this and know what could be the problem?  Message Edited by Bloome on 07-15-2009 12:39

  • How do I run HD Media from an External Hard Drive?

    I have a Macbook Pro, with Final Cut 7. I'm editing clips in HD shot with Canon 7d. I have a 250GB external Hard Drive. How do I set it up as my "Scratch Disk" and able to run all the media I'm editing from there too (for Playback, ect). And in the e

  • Difference between Oracle Enetrprise Manager 10.1.2. and 10.1.3

    We have J2EE application deployed on Oracle Application Server 10.1.2. For setting up and deploying application we use Enterprise manager. We are intending to upgrade onto version 10.1.3. At the beginning we tried new Enterprise manager. We are unple

  • Viewing SSMA report the next day

    This can't be hard, I just want to view an SSMA migration report after I save/close SSMA and logout. I can see the report directory and all of the XML, JScript, GIF images, etc in the save directory (e.g. report_2014_06_17T10_24_25). I just want to s

  • Download specific output fields to excel

    Hi All, We have a report program that downloads an excel file having about 60 output fields. The program has no ALV output. Everytime we do not require these 60 fields to be shown in output excel. we need specific output fields in excel and those spe