Pstop in solaris to stop query

This is just question for curiosity. May be i am wrong but please help me in understanding this.
Below is the details where i am using one test table created from dba_objects.
What i did is i ran first select * from test and the other one with pstop that pid from different session.
Both are almost same. Also i had flushed shared/buffer cache 2-3 time before each test. So, both are doing same.
DB Version : 10.2.0.3 Solaris SPARC 64
SEGMENT_NAME                       BYTES      BLOCKS
TEST                               6291456    384
Statistics (From select * from test without pstop)
        504  recursive calls
          0  db block gets
       3714  consistent gets
        341  physical reads
          0  redo size
    2611800  bytes sent via SQL*Net to client
      36512  bytes received via SQL*Net from client
       3277  SQL*Net roundtrips to/from client
          4  sorts (memory)
          0  sorts (disk)
      49128  rows processed
Statistics (From select * from test with 2 times pstop)
        504  recursive calls
          0  db block gets
       3714  consistent gets
        343  physical reads
          0  redo size
    2611800  bytes sent via SQL*Net to client
      36512  bytes received via SQL*Net from client
       3277  SQL*Net roundtrips to/from client
          4  sorts (memory)
          0  sorts (disk)
      49128  rows processed
But from mystat there is a difference. Here is how i had ran
set autotrace on;
alter system flush shared_pool;
alter system flush buffer_cache;
create table x1 as select sn.name, ms.value from v$mystat ms, v$statname sn where ms.statistic# = sn.statistic# ;
select * from test;
create table x2 as select sn.name, ms.value from v$mystat ms, v$statname sn where ms.statistic# = sn.statistic# ;
select y1.name,y1.value,y2.value,y2.value-y1.value from y1,y2 where y1.name=y2.name order by 1;
From 1st and 2nd result there is difference with(Run Difference).
                                                                 First     Second
physical read bytes                                             6504448     10633216
physical read total IO requests                                   84     332
physical read total bytes                                   6569984     10698752
physical read total multi block requests                    28     29
physical reads                                                       397     649
physical reads cache                                             397     649
physical reads cache prefetch                                   317     321
physical reads prefetch warmup                                   21     25
recursive calls                                                     4021     16397
sorts (memory)                                                       71     332
sorts (rows)                                                       420     2071
table fetch by rowid                                             862     1858
execute count                                                       299     1116So, is it saying that it's revisiting all blocks again but not showing in autotrace.

HI,
The button is in a diff. class, so i just can't close the connection straight away.
I tried it even using a flag, even then it's not closed.
void cmdCanel_actionPerformed(ActionEvent e)
isStop = true;
DataObj.isStop(isStop);
public boolean isStop(boolean isStop) {
stopCalled = isStop;
return stopCalled;
if(stopCalled) {
rs.close();
Even then the process is not getting stopped.
What could be done to stop that?

Similar Messages

  • Mail stopped querying other email address'

    without having changed anything (that I know of) my mail program suddenly stopped querying my home email server. I travel often between two states and have two internet companies and two email addresses which both always send email to my mac mail program with out any problem for months. suddenly yesterday it only feceived email for local server.
    i checked preferences, addresses still there, called internet companies, they said they weren't reporting any issues... any ideas? i can still go to a site online and grab this email but it is obviously more convienent to get your mail when you click mail! thanks~
    mail is 1.3.11, powerbook g4, OS 10.3.9

    thank you

  • Stop query on run on report startup

    Hi
    how to stop query on run on interactive report startup
    Thanks

    Hello,
    What do you mean exactly by "interactive report startup" ?
    Else, if you want to stop a running query you may kill the corresponding session.
    So with OEM or by querying the v$session you may identify the session (sid, serial#) of the query
    to stop. For instance:
    alter session set nls_date_format = 'DD-MM-YYYY HH24:MI:SS';
    select sid, serial#, status, schemaname, osuser, program, sql_id, logon_time
    from v$session;Then, you may execute the following statement so as to KILL the session:
    alter system kill session '<sid>,<serial#>';You may find some examples on the link below:
    [http://www.psoug.org/reference/kill_session.html]
    Hope this help.
    Best regards,
    Jean-Valentin

  • Stopping query in jdbc

    We gave basically a data mining application that can do unions over 12 dozen tables. If figures out what joins to do based on the columns being returned and the columns being searched on.
    So the user uses the UI in java to specify what data they want and causes the query to be started using jdbc. After 10 minutes of waiting, they still don't have their results and want to cancel the query. The thread is still in jdbc and won't return until the there is data to return.
    So how does the java application stop the query? You don't want to let it run another 12 hours, especially if the user is going to do start and abandon a dozen queries.

    chk this
    http://onjava.com/lpt/a/4938
    also this
    http://download.oracle.com/javase/1.4.2/docs/api/java/sql/Statement.html#cancel%28%29

  • Stop Query if it does not match with Condtions & Control the result count

    Dear All,
    I have requirement in my Environment, I have to stop the Queries which compromises these conditions
    1. If Query is running more than specified threshold (if it running more than 2 mins).
    2. If Query is fetching huge data (rows more than 1000 for example)
    Please note we have done enough study on resource governor, it works on compile time, we need to control the queries during run time. Also resource governor does not restrict the resources if they are free.
    Answers are appreciated.

    Hello,
    I would not advise you to do such things in your environment.2 mins is very less time how could you be so sure a 2 min query is bad. And your second point is totally baseless it wouldtake a query a fraction of secondto read 1000 rows.My answer would be please
    dont implement.
    If you want to test below query might achieve the first requirement, I have not tested it please treat this query as hint and optimize or add anything if required.
    If you schedule this query through agent for every 2 mins or 5 mins .It can achieve.But some query takes more time to rollback than to finish scheduling this would lead to unstable environment
    USE MASTER
    IF EXISTS (SELECT * FROM TEMPDB.SYS.ALL_OBJECTS WHERE NAME LIKE '#KILL_CONNECTION')
    BEGIN
    DROP TABLE #KILL_CONNECTION
    END
    CREATE TABLE #KILL_CONNECTION
    SESSION_ID INT
    ,TOTAL_ELAPSED_TIME BIGINT
    ,START_TIME DATETIME
    INSERT INTO #KILL_CONNECTION
    SELECT
    SESSION_ID
    ,TOTAL_ELAPSED_TIME
    ,START_TIME
    FROM SYS.DM_EXEC_REQUESTS
    WHERE TOTAL_ELAPSED_TIME > 7200 AND SESSION_ID > 50
    DECLARE @SESSION_ID BIGINT
    DECLARE @CMD VARCHAR(1000)
    DECLARE KILL_CONNECTION CURSOR FOR
    SELECT SESSION_ID
    FROM #KILL_CONNECTION
    OPEN KILL_CONNECTION
    FETCH NEXT FROM KILL_CONNECTION INTO @SESSION_ID
    WHILE @@FETCH_STATUS = 0
    BEGIN
    SET @CMD = 'KILL ' + @SESSION_ID
    EXECUTE (@CMD)
    END
    CLOSE KILL_CONNECTION
    DEALLOCATE KILL_CONNECTION godrop table #Kill_connection
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • /*   */ is a remark? Why deleting it stops query from working?

    Dear All,
    I recently got the SQL below from one expert and it worked perfecly.
    I am now wondering why he sent me this line in green?
    /*Select 1 from jdt1 t where t.duedate*/
    When I removed this line so that the code at the beginning now reads:
                Declare @d datetime
                set @d = [%1]
    the query stops working. Error Msg "Must specify table to select from'.
    What is happening here?
    I thought   /*   */   means remarks, which can be deleted without effect.
    It now seems they are an essential part of the query.
    Could you explain the meaning of the command, so that I can use it when building other queries?
    -  What does 'Select 1' mean and what is its effect?
    -  Why do we have to put this command to make query work?
    -  Why do you put it between /*   */?
    Thanks
    Leon Lai
    My previous thread is here:
    AR AGEING - Query works perfectly; stops working when changed into Subquery
    Declare @d datetime
    set @d
    /*Select 1 from jdt1 t where t.duedate*/=[%1]
    select * from
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number',
         CASE  WHEN T0.TransType=13 THEN 'Invoice'
              WHEN T0.TransType=14 THEN 'Credit Note'
              WHEN T0.TransType=30 THEN 'Journal'
              WHEN T0.TransType=24 THEN 'Receipt'
              END AS 'Document Type',
         T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,@d)<=-1),0) 'Future'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,@d)>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,@d)>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,@d)>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,@d)>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,@d)>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
    WHERE  T1.CardType = 'C'
    ) sub

    HI Leonlai
    Sorry for my english...I try explain you how work it
    This variables
    '[%0]' - '[%1]' Etc...
    Are from SAP. If you insert this variables in SQL management studio (for example)  doesn't work
    You must declare variables allowed in SQL, using the @, after insert variables of SAP into variables to SQL.
    DECLARE @DATES INT, @BEGIN DATETIME, @END DATETIME
    SET @DATES = (SELECT TOP 1 A.DocEntry FROM dbo.OINV A WHERE A.DocDate >= '[%0]' AND A.DocDate <= '[%1]') /*This variable is used for called SAP varibles*/
    SET @BEGIN = '[%0]' /*Here Insert SAP variables into SQL variables*/
    SET @END = '[%1]'
    NOW WRITE your query.
    Sometimes when uses variables of SAP into UDF, doesn't work. This is a method for replace it.
    Regards

  • Solaris Update Release Query

    As a requirement for Oracle 11g I need Solaris 10 to be on at least update 6.
    I am currently on update 4.
    Applying the patch bundle isn't an option as the 11g upgrade pre-req checks needs to see that /etc/release specificies u6 or greater.
    What I'd like to know is, will installing the Oracle Solaris OS Recommended Patchset achieve this or do I need to go for an Update Release?
    As far as I can see on this is that only the latest update release version is available through OTN which I can't use as our EMC software is not compatible with it and there is no fix yet. OTN points to MOS for older updates but I can only see Patch Bundles and Patch Sets.
    Many thanks in advance
    Paul

    I have not used these myself but did you try the instructions near the bottom:
    "Older Versions of Solaris
    Older versions of Solaris can also be requested by logging a Physical Media Request through My Oracle Support. Follow the instructions above. If a download is sufficient, please state this in the request."
    I have no idea how long it would take to get Physical Media but that maybe your best option.
    I do not have the details but I think some of the vendors have patches for the latest Solaris 10 update - maybe bugging them would be fruitful.
    GlenG

  • Stopping query results

    Hello,
    I have two queries. One returns details for a report viewed on the screen (Q1), the second returns strictly address label detail (Q2). I have put in the WHERE claus of:
    Q1:
    where :output = 'View on screen' ...
    Q2: where :output = 'Save as label file' ...
    In the Before Report trigger, I have put:
         if :output = 'Save as label file' then
              srw.set_maxrow('Q1', 0);
         else
              srw.set_maxrow('Q2', 0);
         end if;
    The problem is that when I create the label file, using Delimiteddata, I am getting headers from both queries.
    How can I suppress the headers of Q1? Am I being redundant in all of this code?
    Thank you for all your help!
    --KW

    I have finally cleared all names from the XML Tag property on all fields returned by Q1. This has stopped the second row of headers although I still get a blank row.
    I know it is still wanting to return something from Q1, even though there are no results to show.
    If there is some other way to suppress Q1 altogether, I would sure like to know what it is. : -)
    Thank you all for your posts. Alot of great info here!!
    --KW                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Solaris chopping off query string parameters

    I need to run my flex app on a headless server. It works but
    for some reason, I am losing much needed parameters in my URL by
    the time it gets to flex. What could be causing this?
    Command line args for app
    [/bin/sh, -c, /opt/sfw/bin/firefox
    http://dev.app.com/direct/Momentum.html?reportID=Rep1&channel=Y,
    :5]
    queryString.url in Flex:
    http://dev.app.com/direct/Momentum.html?reportID=Rep1
    So how can I get the channel=Y arg back?

    I figured out that I needed to put the url in quotes.

  • Query IDs in ORACLE_SEM_FS_NS : 32 or 64 bits?

    Hi,
    I have a question regarding query IDs used in ORACLE_SEM_FS_NS prefix definition and in Joseki / Oracle querymgt servlet.
    It seems that :
    * ORACLE_ORARDF_QUERY_MGT_TAB table apparently can hold longs
    * the querymgt servlet accepts longs and returns "No valid query ID specified." for anything over 64 bits.
    * running queries with long qid (either from a Joseki endpoint or from Jena) results in weird behaviour :
    ** qid < 2^32 : OK
    ** qid < 2^64 : returns either an exception (see below) or an empty result set immediately (with no exception)
    ** qid > 2^64 : query runs OK but qid cannot be used to stop query since it is over 64 bits
    Here is the exception shown if you use a qid between 32 and 64 bits :
    Exception in thread "AWT-EventQueue-0"
    java.lang.NumberFormatException: For input string: "8947349906"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:459)
    at java.lang.Integer.parseInt(Integer.java:497)
    at oracle.spatial.rdf.client.jena.OracleQueryContextParameters.getQID(OracleQueryContextParameters.java:83)
    My question: due to the discrepancies when using large values, I do not exactly understand : are the query ids meant to be 32 or 64 bits ? Moreover: I haven't checked whether the id was signed or unsigned. Could you please specify exactly the range of possible values that qid can be assigned ?
    Thanks
    Regards,
    Julien

    Hi Julien,
    My comments are inline.
    Cheers,
    Vlad
    Well, to be honest, I cannot reproduce the issue I faced yesterday. The weblogic server providing Joseki was overloaded for some other reason (out of memory) and was only responding to querymgt queries (the SPARQL queries themselves were stuck threads).
    Regarding the 4th point of your explanation : When you say that "the Jena Adapter" polls the DB regularly to check if any query needs to be killed, do you mean that the following would work ?
    Example : A user runs a SPARQL query via a load balancer that uses two instances of Joseki w/ querymgt. The same user then wants to kill the same long-running query via the same load balancer and hits the other instance of Joseki w/ querymgt.
    V: The two instances of Joseki are using the same datasource right? In that case, the kill request will be sent to both Joseki instances.
    If I understood what you said, the query management features are only available for queries ran through Joseki since they are stopped on the client side. In that case, is there a way to stop long-running queries that are sent directly through JDBC (using Jena adapter) ?
    V: If you submit a SPARQL query programmatically through the Jena Adapter against an Oracle-backed GraphOracleSem, and you specify a QID in the prefix, then the query is registered and you will still be able to kill it using the querymgt servlet. Let me know if this answered your question.
    Regarding the first question (available values for qid), do you plan to fix the fact that only less than half of all 32-bit values are available ? I am asking this because it is quite common to use 32-bit (or multiples of 32 anyway) IDs for instances / sessions of client applications and it seems to me that it would make it easier to use query IDs.
    V: We will look into allowing 64-bit query IDs in the next Jena Adapter release.

  • SSRS Report queries begin running slowly, have to stop and start report server to restore performance

    We have had a production issue crop up twice now where reports begin running slowly seemingly at random.  
    When this happens we can see from running SQL Profiler that the report queries are taking an extremely long time to execute.  The same queries when run directly in management studio run quickly.  
    Initially I suspected parameter sniffing, and tried using OPTION (RECOMPILE) in the reports, as well as clearing out the particular query from the plan cache and running the SQL in SSMS to try and get a better plan etc but no amount of jiggery pokery by
    me could get the queries to run any faster.
    The really weird thing - is that stopping and starting the report server via the reporting services configuration manager instantly cures the problem.  
    I'd really love to know - why this might be?  Is it something to do with the report server closing and re-opening its connections to the database? That's the only sort of thing I can think of...any ideas? Anyone? Any suggestions would be much appreciated.
    LucasF

    Hi LucasF,
    In your scenario, usually we can monitor the execution log in Report Database. If you run below query, you can get the results how long the report takes to render (TimeRendering), how long to process the report(TimeProcessing) and how long to retrieve data
    from Database(TimeData). You can check the starttime and endtime to know the total time for executing a report.
    SELECT TOP1000 *FROM[ReportServer].[dbo].[ExecutionLog2]
    More details information, please reference to similar thread below:
    Steps for troubleshooting a slow SSRS 2014 server
    Troubleshooting Reports: Report Performance
    In SQL Server Reporting Services, a job will be created by SQL Server Agent if any of the following processes is underway:
    query execution on a remote or local database server
    report processing
    report rendering
    To cancel a job that is running on the report server, we can cancel the job directly or reduce the report execution time-out value in the SQL Server Management Studio and then will stop query execution. Please refer to the steps below:
    Open SQL Server Management Studio, and connect to "Reporting Services".
    Under the Report Server node, right-click on the "Jobs" folder and select "Refresh". Then, right-click on "Jobs" again and click "Cancel All Jobs".
    Right-click on the Report Server node and open the "Server Properties" dialog.
    Click the "Execution" option, and set the "Limit report execution to the following number of seconds:" to a much smaller number. After this issue is resolved, this configuration should revert to the previous state.  
    Reference:
    Managing a Running Process
    Setting Time-out Values for Report and Shared Dataset Processing
    In addition, we can also use the KILL Transact-SQL statement to terminate a normal connection by terminating the transactions that are associated with the specified session ID. For the details information, you can refer to:
    KILL (Transact-SQL)
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Solaris 10: How do I get to the {ok} prompt from here?

    My Sparc box which is running Solaris 10 stopped working due (I think) to a power outage. Now I can't get it to boot up. I'm not interested in trying to recover the contents of the hard-disk. I just want to make the machine usable again. So I am trying to install the OS from the CD Rom drives. I have removed the hard drives so that it doesn't try to boot off them
    This is what I see on the serial connection:
    INIT: create: Permission denied
    create: Permission denied
    create: Permission denied
    create: Permission denied
    create: Permission denied
    create: Permission denied
    create: Permission denied
    create: Permission denied
    create: Permission denied
    create: Permission denied
    INIT:
    ->
    What I need to know is how do I get to the {Ok} prompt from here?
    How do I get to the Ok prompt from here?
    Edited by: 994606 on Mar 20, 2013 12:10 PM
    Edited by: 994606 on Mar 20, 2013 12:12 PM

    Use a serial cable to connect to the server, then with either putty or teraterm connected power on the server. When it displays something similar to this:
    Sun Fire V890, No Keyboard
    Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
    OpenBoot 4.30.4.c, 32768 MB memory installed, Serial etc
    etc.
    etc.
    Use the putty special command to send a break signal or use teraterm control --> send break. The server will drop to the ok prompt.
    This is how I do it on all our servers as required and works a treat.
    Thanks.

  • How to terminate the running query for a report?

    Hi,
    When I run a report, the SQL query takes too long.
    This causes an overload on database.
    How do I stop query from running after some time?

    It is NOT possible in OBIEE 10g.
    In OBIEE 11g, When a scheduled report job is in running status, you can now cancel the running job from the Report Job History page.
    Check this Section 6.9, ["Canceling a Running Job." |http://docs.oracle.com/cd/E23943_01/bi.1111/e22257/view_manage_rpt_his.htm#cancel_runj]
    And only possible since 11.1.1.5
    regards
    Jorge
    p.s If this answers your question then please mark my answer as "Correct" or "Helpful"

  • Ridiculous query

    Have you any heard contraints can change your query results? Here is the one which happened on my 10g database. We found a query with self-join returned a wrong result (in this case, it returns 254, the correct result is 253). But if I drop the associated pk constraint, I got a correct result, if I add back the constraint, the result is wrong again. If you see the execution plan, you'll find oracle use different plan. I don't see any corruption in my database also I didn't get any errors when I run these queries. I have rebuild the index for several times and run analyze table validate structure, but
    they are not helpful. Any thoughts about this?
    SQL> select count(*)
    2 from location.location room, location.location dorm, location.location campus, location.location school
    3 where room.location_active_yn_flag = 'Y'
    4 and room.parent_location_id = dorm.location_id
    5 and dorm.parent_location_id = campus.location_id
    6 and campus.parent_location_id = school.location_id
    7 and (room.location_type_id = 18 or room.location_id = 1)
    8 and (dorm.location_type_id = 17 or dorm.location_id = 1)
    9 --and (campus.location_type_id = 16 or campus.location_id = 1)
    10 --and (school.location_type_id = 6 or school.location_id = 1);
    COUNT(*)
    254
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=19 Card=1 Bytes=80
    1 0 SORT (AGGREGATE)
    2 1 HASH JOIN (Cost=19 Card=84 Bytes=6720)
    3 2 TABLE ACCESS (FULL) OF 'LOCATION' (TABLE) (Cost=9 Card
    =172 Bytes=6708)
    4 2 TABLE ACCESS (FULL) OF 'LOCATION' (TABLE) (Cost=9 Card
    =259 Bytes=10619)
    SQL> ALTER TABLE location.location
    drop CONSTRAINT pk_location;
    2
    Table altered.
    ### Run above query again
    COUNT(*)
    253
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=38 Card=1 Bytes=11
    9)
    1 0 SORT (AGGREGATE)
    2 1 HASH JOIN (Cost=38 Card=84 Bytes=9996)
    3 2 HASH JOIN (Cost=28 Card=84 Bytes=8904)
    4 3 HASH JOIN (Cost=19 Card=84 Bytes=6720)
    5 4 TABLE ACCESS (FULL) OF 'LOCATION' (TABLE) (Cost=9
    Card=172 Bytes=6708)
    6 4 TABLE ACCESS (FULL) OF 'LOCATION' (TABLE) (Cost=9
    Card=259 Bytes=10619)
    7 3 TABLE ACCESS (FULL) OF 'LOCATION' (TABLE) (Cost=9 Ca
    rd=1639 Bytes=42614)
    8 2 TABLE ACCESS (FULL) OF 'LOCATION' (TABLE) (Cost=9 Card
    =1639 Bytes=21307)
    SQL> SQL> ALTER TABLE location.location
    ADD CONSTRAINT pk_location PRIMARY KEY (location_id);
    2
    Table altered.
    ### Run above query again
    COUNT(*)
    254
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=19 Card=1 Bytes=80
    1 0 SORT (AGGREGATE)
    2 1 HASH JOIN (Cost=19 Card=84 Bytes=6720)
    3 2 TABLE ACCESS (FULL) OF 'LOCATION' (TABLE) (Cost=9 Card
    =172 Bytes=6708)
    4 2 TABLE ACCESS (FULL) OF 'LOCATION' (TABLE) (Cost=9 Card
    =259 Bytes=10619)

    Marcus,
    Thank you for your reply. I have checked the bug you mentioned, I think it doesn't fit my case. Here in my case, the primary key changed the execution plan and gave me wrong results. I have contacted oracle support regarding this issue and submitted the trace file, but they ask me to provide the database to build the test case. Although we have seen this problem on 10.1.0.2 (solaris), 10.1.0.3 (linux) and 10.1.0.4 (solaris) with same query, but expdp/impdp the only table doesn't reproduce the error. No any errors returned while this query ran, this makes me not feel so confident for all other queries in my database. I would like to get some inputs from experts to figure out exactly what exactly goes wrong here.

  • Tuning the sql query when we have 30 Million records

    Hi Friends,
    I have query which takes around 25 to 30 Minutes to retrieve 9 Million records.
    Oracle version=11.2.0.2
    OS=Solaris 10 64bit
    query details
    CREATE OR REPLACE VIEW TIBEX_ORDERSBYQSIDVIEW
    AS 
    SELECT  A."ORDERID", A."USERORDERID", A."ORDERSIDE", A."ORDERTYPE",
              A.ORDERSTATUS, A.BOARDID, A.TIMEINFORCE, A.INSTRUMENTID,
              A.REFERENCEID, A.PRICETYPE, A.PRICE, A.AVERAGEPRICE,
              A.QUANTITY, A.MINIMUMFILL, A.DISCLOSEDQTY, A.REMAINQTY,
              A.AON, A.PARTICIPANTID, A.ACCOUNTTYPE, A.ACCOUNTNO,
              A.CLEARINGAGENCY, A.LASTINSTRESULT, A.LASTINSTMESSAGESEQUENCE,
              A.LASTEXECUTIONID, A.NOTE, A.TIMESTAMP, A.QTYFILLED, A.MEID,
              A.LASTINSTREJECTCODE, A.LASTEXECPRICE, A.LASTEXECQTY,
              A.LASTINSTTYPE, A.LASTEXECUTIONCOUNTERPARTY, A.VISIBLEQTY,
              A.STOPPRICE, A.LASTEXECCLEARINGAGENCY, A.LASTEXECACCOUNTNO,
              A.LASTEXECCPCLEARINGAGENCY, A.MESSAGESEQUENCE,
              A.LASTINSTUSERALIAS, A.BOOKTIMESTAMP, A.PARTICIPANTIDMM,
              A.MARKETSTATE, A.PARTNEREXID, A.LastExecSETTLEMENTCYCLE,
              A.LASTEXECPOSTTRADEVENUETYPE, A.PRICELEVELPOSITION,
              A.PREVREFERENCEID, A.EXPIRYTIMESTAMP, matchType,
              a.lastExecutionRole, a.MDEntryID, a.PegOffset,
              a.haltReason, A.COMPARISONPRICE, A.ENTEREDPRICETYPE,
              A.ISPEX, A.CLEARINGHANDLING, B.qsid
        FROM  tibex_Order A,
              tibex_Participant b
        WHERE a.participantID = b.participantID
          AND (A.MessageSequence, A.OrderID) IN (
                SELECT  max(C.MessageSequence), C.OrderID
                  FROM  tibex_Order C
                  WHERE LastInstRejectCode = 'OK'
                  GROUP By C.OrderID
          AND a.OrderStatus IN (
                SELECT OrderStatus
                  FROM  tibex_orderStatusEnum
                  WHERE ShortDesc IN (
                          'ORD_OPEN', 'ORD_EXPIRE', 'ORD_CANCEL', 'ORD_FILLED','ORD_CREATE','ORD_PENDAMD','ORD_PENDCAN'
      UNION ALL
      SELECT  A.ORDERID, A.USERORDERID, A.ORDERSIDE, A.ORDERTYPE,
              A.ORDERSTATUS, A.BOARDID, A.TIMEINFORCE, A.INSTRUMENTID,
              A.REFERENCEID, A.PRICETYPE, A.PRICE, A.AVERAGEPRICE,
              A.QUANTITY, A.MINIMUMFILL, A.DISCLOSEDQTY, A.REMAINQTY,
              A.AON, A.PARTICIPANTID, A.ACCOUNTTYPE, A.ACCOUNTNO,
              A.CLEARINGAGENCY, A.LASTINSTRESULT, A.LASTINSTMESSAGESEQUENCE,
              A.LASTEXECUTIONID, A.NOTE, A.TIMESTAMP, A.QTYFILLED, A.MEID,
              A.LASTINSTREJECTCODE, A.LASTEXECPRICE, A.LASTEXECQTY,
              A.LASTINSTTYPE, A.LASTEXECUTIONCOUNTERPARTY, A.VISIBLEQTY,
              A.STOPPRICE, A.LASTEXECCLEARINGAGENCY, A.LASTEXECACCOUNTNO,
              A.LASTEXECCPCLEARINGAGENCY, A.MESSAGESEQUENCE,
              A.LASTINSTUSERALIAS, A.BOOKTIMESTAMP, A.PARTICIPANTIDMM,
              A.MARKETSTATE, A.PARTNEREXID, A.LastExecSETTLEMENTCYCLE,
              A.LASTEXECPOSTTRADEVENUETYPE, A.PRICELEVELPOSITION,
              A.PREVREFERENCEID, A.EXPIRYTIMESTAMP, matchType,
              a.lastExecutionRole, A.MDEntryID, a.PegOffset,
              a.haltReason, A.COMPARISONPRICE, A.ENTEREDPRICETYPE,
              A.ISPEX, A.CLEARINGHANDLING, B.qsid
        FROM  tibex_Order A,
              tibex_Participant b
        WHERE a.participantID = b.participantID
          AND orderstatus in (
                SELECT  orderstatus
                  FROM  tibex_orderStatusEnum
                  WHERE ShortDesc in ('ORD_REJECT')
          AND 1 IN (
                  SELECT count(*)
                    FROM tibex_order c
                    WHERE c.orderid=a.orderid
                      AND c.instrumentID=a.instrumentID
    /Tried by modifying the query but same result was not retrieved but it was Quicker 6 min.Can Somebody check where i am going wrong.
    CREATE OR REPLACE VIEW TIBEX_ORDERSBYQSIDVIEW
    AS   
    WITH REJ AS
    SELECT ROWID RID
    FROM   TIBEX_ORDER
    WHERE  ORDERSTATUS = (SELECT ORDERSTATUS
                          FROM   TIBEX_ORDERSTATUSENUM
                          WHERE  SHORTDESC = 'ORD_REJECT')
    REJ1 AS
    SELECT ROWID RID
    FROM   TIBEX_ORDER
    WHERE  ORDERSTATUS NOT IN (SELECT ORDERSTATUS
                               FROM   TIBEX_ORDERSTATUSENUM
                               WHERE  SHORTDESC = 'ORD_NOTFND'
                               OR     SHORTDESC = 'ORD_REJECT')
    SELECT O.*,
           P.QSID
    FROM   TIBEX_ORDER O,
           TIBEX_PARTICIPANT P
    WHERE  O.PARTICIPANTID = P.PARTICIPANTID
    AND    O.ROWID IN (
                       SELECT RID
                       FROM   (
                               SELECT   ROWID RID,
                                        ORDERSTATUS,
                                        RANK () OVER (PARTITION BY ORDERID ORDER BY MESSAGESEQUENCE ASC) R
                               FROM     TIBEX_ORDER
                       WHERE  R = 1
                       AND    RID IN (SELECT RID FROM REJ)
    UNION ALL
    SELECT O.*,
           P.QSID
    FROM   TIBEX_ORDER O,
           TIBEX_PARTICIPANT P
    WHERE  O.PARTICIPANTID = P.PARTICIPANTID
    AND    O.ROWID IN (
                       SELECT RID
                       FROM   (
                               SELECT   ROWID RID,
                                        ORDERSTATUS,
                                        RANK () OVER (PARTITION BY ORDERID ORDER BY MESSAGESEQUENCE DESC) R
                               FROM     TIBEX_ORDER
                       WHERE  R = 1
                       AND    RID IN (SELECT RID FROM REJ1)
                      );Regards
    NM

    Hi Satish,
    CREATE OR REPLACE VIEW TIBEX_ORDERSBYQSIDVIEW
    (ORDERID, USERORDERID, ORDERSIDE, ORDERTYPE, ORDERSTATUS,
    BOARDID, TIMEINFORCE, INSTRUMENTID, REFERENCEID, PRICETYPE,
    PRICE, AVERAGEPRICE, QUANTITY, MINIMUMFILL, DISCLOSEDQTY,
    REMAINQTY, AON, PARTICIPANTID, ACCOUNTTYPE, ACCOUNTNO,
    CLEARINGAGENCY, LASTINSTRESULT, LASTINSTMESSAGESEQUENCE, LASTEXECUTIONID, NOTE,
    TIMESTAMP, QTYFILLED, MEID, LASTINSTREJECTCODE, LASTEXECPRICE,
    LASTEXECQTY, LASTINSTTYPE, LASTEXECUTIONCOUNTERPARTY, VISIBLEQTY, STOPPRICE,
    LASTEXECCLEARINGAGENCY, LASTEXECACCOUNTNO, LASTEXECCPCLEARINGAGENCY, MESSAGESEQUENCE, LASTINSTUSERALIAS,
    BOOKTIMESTAMP, PARTICIPANTIDMM, MARKETSTATE, PARTNEREXID, LASTEXECSETTLEMENTCYCLE,
    LASTEXECPOSTTRADEVENUETYPE, PRICELEVELPOSITION, PREVREFERENCEID, EXPIRYTIMESTAMP, MATCHTYPE,
    LASTEXECUTIONROLE, MDENTRYID, PEGOFFSET, HALTREASON, COMPARISONPRICE,
    ENTEREDPRICETYPE, ISPEX, CLEARINGHANDLING, QSID)
    AS
    SELECT  A."ORDERID", A."USERORDERID", A."ORDERSIDE", A."ORDERTYPE",
              A.ORDERSTATUS, A.BOARDID, A.TIMEINFORCE, A.INSTRUMENTID,
              A.REFERENCEID, A.PRICETYPE, A.PRICE, A.AVERAGEPRICE,
              A.QUANTITY, A.MINIMUMFILL, A.DISCLOSEDQTY, A.REMAINQTY,
              A.AON, A.PARTICIPANTID, A.ACCOUNTTYPE, A.ACCOUNTNO,
              A.CLEARINGAGENCY, A.LASTINSTRESULT, A.LASTINSTMESSAGESEQUENCE,
              A.LASTEXECUTIONID, A.NOTE, A.TIMESTAMP, A.QTYFILLED, A.MEID,
              A.LASTINSTREJECTCODE, A.LASTEXECPRICE, A.LASTEXECQTY,
              A.LASTINSTTYPE, A.LASTEXECUTIONCOUNTERPARTY, A.VISIBLEQTY,
              A.STOPPRICE, A.LASTEXECCLEARINGAGENCY, A.LASTEXECACCOUNTNO,
              A.LASTEXECCPCLEARINGAGENCY, A.MESSAGESEQUENCE,
              A.LASTINSTUSERALIAS, A.BOOKTIMESTAMP, A.PARTICIPANTIDMM,
              A.MARKETSTATE, A.PARTNEREXID, A.LastExecSETTLEMENTCYCLE,
              A.LASTEXECPOSTTRADEVENUETYPE, A.PRICELEVELPOSITION,
              A.PREVREFERENCEID, A.EXPIRYTIMESTAMP, matchType,
              a.lastExecutionRole, a.MDEntryID, a.PegOffset,
              a.haltReason, A.COMPARISONPRICE, A.ENTEREDPRICETYPE,
              A.ISPEX, A.CLEARINGHANDLING, B.qsid
        FROM  tibex_Order A,
              tibex_Participant b
        WHERE a.participantID = b.participantID
          AND (A.MessageSequence, A.OrderID) IN ( SELECT MAX (C.MessageSequence), C.OrderID
               FROM tibex_Order C
                 WHERE c.LastInstRejectCode = 'OK'
                 and a.OrderID=c.OrderID
                   GROUP BY C.OrderID)
          AND a.OrderStatus IN (2,4,5,6,1,9,10)
      UNION ALL
      SELECT  A.ORDERID, A.USERORDERID, A.ORDERSIDE, A.ORDERTYPE,
              A.ORDERSTATUS, A.BOARDID, A.TIMEINFORCE, A.INSTRUMENTID,
              A.REFERENCEID, A.PRICETYPE, A.PRICE, A.AVERAGEPRICE,
              A.QUANTITY, A.MINIMUMFILL, A.DISCLOSEDQTY, A.REMAINQTY,
              A.AON, A.PARTICIPANTID, A.ACCOUNTTYPE, A.ACCOUNTNO,
              A.CLEARINGAGENCY, A.LASTINSTRESULT, A.LASTINSTMESSAGESEQUENCE,
              A.LASTEXECUTIONID, A.NOTE, A.TIMESTAMP, A.QTYFILLED, A.MEID,
              A.LASTINSTREJECTCODE, A.LASTEXECPRICE, A.LASTEXECQTY,
              A.LASTINSTTYPE, A.LASTEXECUTIONCOUNTERPARTY, A.VISIBLEQTY,
              A.STOPPRICE, A.LASTEXECCLEARINGAGENCY, A.LASTEXECACCOUNTNO,
              A.LASTEXECCPCLEARINGAGENCY, A.MESSAGESEQUENCE,
              A.LASTINSTUSERALIAS, A.BOOKTIMESTAMP, A.PARTICIPANTIDMM,
              A.MARKETSTATE, A.PARTNEREXID, A.LastExecSETTLEMENTCYCLE,
              A.LASTEXECPOSTTRADEVENUETYPE, A.PRICELEVELPOSITION,
              A.PREVREFERENCEID, A.EXPIRYTIMESTAMP, matchType,
              a.lastExecutionRole, A.MDEntryID, a.PegOffset,
              a.haltReason, A.COMPARISONPRICE, A.ENTEREDPRICETYPE,
              A.ISPEX, A.CLEARINGHANDLING, B.qsid
        FROM  tibex_Order A,
              tibex_Participant b
        WHERE a.participantID = b.participantID
          AND orderstatus=3
          AND 1 IN (
                  SELECT count(*)
                    FROM tibex_order c
                    WHERE c.orderid=a.orderid
                      AND c.instrumentID=a.instrumentID
    select * from TIBEX_ORDERSBYQSIDVIEW where participantid='NITE';
    Current SQL using Temp Segment and Look for Column TEMPSEG_SIZE_MB
           SID TIME                OPERATION                 ESIZE        MEM    MAX MEM       PASS TEMPSEG_SIZE_MB
           183 11/10/2011:13:38:44 HASH-JOIN                    43         43       1556          1            1024
           183 11/10/2011:13:38:44 GROUP BY (HASH)            2043       2072       2072          0            4541Edited by: NM on 11-Oct-2011 04:38

Maybe you are looking for

  • How to use previous year keyfigure data in current year for other keyfig

    Hi Expert, I have 1 requirement wherein I need to use previous year data for some keyfigure calculation. Details are as follows: I have designed query with CKFs Turnover & UVG (in rows) & Fiscal year period in columns. Suppose Keyfigure Turnover data

  • JDeveloper, Can not build schema - Help Required

    Hi everyone, I am facing a peculiar problem with Jdeveloper. (10.1.3.4.4270) I am developing an ESB project. When referring to a XSD from within a XSD using a URL i.e. import, It's giving me error. Here is the sample code:_ <?xml version="1.0" encodi

  • 2D Line Chart question

    I have Apex 3.1 . I have created a 2D Line chart with for different series (so there are 4 lines on one chart). I also have a Legend on the left side next to the chart to label whatr each line is for. In my query for those lines I have the Name for t

  • QUESTION abt "SQL_DML" of the Receiver JDBC Adapter

    HI ALL, i hav a doubt abt "SQL_DML" of the Receiver JDBC Adapter. i wanna use two SQL Statements in the "SQL_DML" structure to manipulate two tables. i.e. <root>   <stmt>     <Customers action="SQL_DML">       <access>                       INSERT IN

  • Call a method before Next operation to set selected values

    Use Case: I display a VO as a ADF Select Many Check Box. This VO is the detail of a master/detail. I managed to store the selection state in a managed bean on autoSubmit. Then the user navigate to the next master record, then goes back to the previou