Sql query hangs..

Hi,
the below query is getting hanged repetedly although the update is happening but its very slow(taking more than 12 hrs )
Please tell the issue.the indexes are prope and table Test1 is going for full table scan.
update Test1 t1 set t1.A =
select t2.ID from Test2 t2 where t1.A = t2.c and t2.c is not null
and t1.d = 58 and t1.e ='Text' and t1.f=t2.g
)where exists
select t2.ID from Test2 t2 where t1.A = t2.c and t2.c is not null
and t1.d = 58 and t1.ORIG_OU_ID ='Text' and t1.f=t2.g
Thanks.

Welcome to the forums !
When your query takes too long:
HOW TO: Post a SQL statement tuning request - template posting
When your query takes too long ...
HTH
Srini

Similar Messages

  • Sql query hangs close to the end

    Hi:
    I am on 10.2.0.3.
    My rather simple query hangs for a few minutes close to the end. It's supposed to return 288 rows and it immediately returns 285, then hangs for 4-5 min, than returns the remaining 3 rows. Kind of similar behavior to using "First_rows" hint - which I'm not using...
    The table has about 100,000 rows.
    Some relevant info is below.
    Any ides appreciated.
    TIA
    PLAN_TABLE_OUTPUT
    Plan hash value: 2481764356
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 30 | 3 (0)| 00:00:01 |
    |* 1 | INDEX RANGE SCAN| PSACOMBO_DATA_TBL | 1 | 30 | 3 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - access("SETID"='GLOBL' AND "PROCESS_GROUP"='100ACDTPRJ' AND
    "COMBINATION"='100ACDTPRJ' AND "VALID_CODE"='V')
    optimizer_dynamic_sampling integer 6
    optimizer_features_enable string 10.2.0.3
    optimizer_index_caching integer 25
    optimizer_index_cost_adj integer 75
    optimizer_mode string ALL_ROWS
    optimizer_secure_view_merging boolean TRUE
    unnestsubquery boolean FALSE

    You said the query is supposed to return 288 rows, but from the explain plan, Oracle "see" only 1 row to be returned. Are the stats up-to-date ? What's the actual query ?
    Please, on the forum side, use tags before and after your code to keep it readable (preserve blanks and tabs).
    Nicolas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Getting session hang When calling Function from SQL query

    Hi All,
    I am using Oracle 8.1.7.4.0. I have a fucntion in a Package and I am calling it from the SQL query. When I am firing the query my oracle session is going to hang position and I am not able to any thing. I have to kill the session.
    But this same thing is working fine in Oracle 9.i.
    There are no out parameter and no DML, DDL and DCL statement in this fucntion.
    Could you please get back me what is the problem on it.
    Regards
    SUN

    Check why your session hangs.
    Just a few ideas:
    * Blocking locks?
    * Endless loop?
    * Performance (maybe it is just slow in orac8i and you have to wait a bit longer). Check the execution plans of the SQL statements in your function.
    * Don't use a function, but direct SQL, it is faster in both versions.

  • SQL Query Editor Hangs Completely!

    Hi,
    I am working on Dell Precision 360,Windows XP with 512MB RAM.
    Problem is Studio creator works almost well with the 512MB RAM(esp. by increasing the process priority),
    but whenever I open the SQL Query Editor to edit a query it hangs completely.
    I don't think it hangs due to memory shoratge problem.
    what could be the reason or is their some other alternative ,coz whenever it hangs i have to manually kill the process due to which sometime some files get corrupted.

    Hi,
    The system requirements for Creator 2 can be found at:
    ttp://developers.sun.com/prodtech/javatools/jscreator/features/sysreqs/index.html
    As can be seen 1 GB RAM is required. At 512 MB the performance will be affected.
    Cheers
    Giri

  • Sql Query Editor hangs

    Hi after attaching a table component in a jsp.....and the selecting the table from the datasource...... the Sql Query editor hangs when trying to click on the table-nameRowset entry in the outline..
    could anybody tell me what might be wrong

    Hi,
    The system requirements for Creator 2 can be found at:
    ttp://developers.sun.com/prodtech/javatools/jscreator/features/sysreqs/index.html
    As can be seen 1 GB RAM is required. At 512 MB the performance will be affected.
    Cheers
    Giri

  • SQL query execution in DB02 hangs if record set is more than 50000

    Hi,
    We are facing issue in a report performance. The return is using native SQL query.
    There are custom views created ar database level for pricing/maetrial and stock. The native sql query is written on these views. The report takes around 15 mins to run in background .
    We are trying to analyse the native SQL query through DB02. I tried fetching records for one particular
    custom view to make out if its indexing issue or something else.When i using TOP 35000 records with select query runs fine with this dataset or less than this . If i increase it to 40000 system doesn;t show anything in SQL ouptut. And above one lakh records system gives timeout.
    The count in this view gives some 10 lakh records which I don't feel is v.v.huge that query that too native sql takes so much time.
    Any help on this will be highly appreciated.
    Regards
    Madhu

    what do you expect from that poor information.
    do you change data or onyl select.
    If you use SAP and ABAP, then you should also use Open SQL.
    Otherwise it is possible to run the SQL Trace with Native SQL, it is anyway only Native SQL, what the trace sees.
    Use package size and it will probably work fine.
    Siegfried

  • Oracle 9.2.0.6; query hangs if partition doesn't exist

    Hallo all,
    this is the first time I post on this forum.
    I work in a group of PL\SQL developers in Italy. Few day ago we had a problem with a query and like to find out what the problem is.
    We have an Oracle DB version 9.2.0.6 (old I know) in a production environment. Linux OS.
    The query was made to extract data from a partitined table, on a partioned field, in our casa one Year. By mistake we have serced for the wrong year, 2013. There where no data for that year and therefor no partition.
    So, happened that the query hangs and after 24 hours was terminated.
    What we expected indeed was a zero records retirned in, at the most, few minutes, see that the table, in severa partition contains about 16 million records.
    The we tested the same query but in a different enviroment, Oracle 11gr2, same table structure, same partitioning, without partition 2013, and the query completed in less tha 1 minute with zero records in output.
    At this point we thought of a bug, but can't find any reference.
    Has anyone had a similar experience or can give some indication of possible bug report.
    Thanks for any help.

    Hi Rob,
    thank you for your answer.
    Sorry if this is not the best forum. I am not very practical.
    I try to answer to your questions.
    At a first time we thought the query did a full scan on the table. Yes. But even to full scan 16.000.000 records split in no more than 8 partition (at this time) shouldn't take up to 24 hours and never stop running. I think.
    We don't have a DBA role so we do not have full control over what is running. And take too long time to open a ticket and ask the DBA to check.
    What we did is testing the same query in a pre-prod environment, which is an Oracle 11gr2.
    I understand that it is not very usual to have a pre-production environment with a latest version of oracle but this is the way we have to work.
    Anyway, the test in pre-production worked very well. Without 2013 partition the return was very fast and we had zero records as expected.
    Then we found a workaround for production, ora 9. Call it work around maybe is too much ........
    We created the 2013 partition and run the query. The respons was then succesfull in about the same time than in pre-prod. Less than one minute and zero records.
    And this is fine for us.
    What we don't understand is why this different behavior with two different version of DB. Thats why we think it is due to a bug. We only want to find out whether it is this or if there is a different reason.
    Some other response or help would help.
    Thank you.

  • SQL*Plus hangs when connecting to remote DB (Solaris, 10gR2)

    First of all the particulars:
    Local System:
    Solaris 8, Oracle 10.2.0.4, October CPU
    Remote System:
    Solaris 10, Oracle 10.2.0.4, July CPU
    We are trying to initiate a connection from our local system to our remote system using a DB Link. After opening SQL*Plus, we log in with <user>@<dblink>, are asked for a password, and after entering the password, SQL Plus hangs indefinitely (we typically have to kill the sqlplus process to regain our session). Also, logging into the local system with a local account, and then querying using the db link (select * from dual@<link>) gives the same result.
    From the remote system, we CAN log into the local system using the same process, and we can also query the local system. in other words, it works in one direction, but not the other.
    We have checked all the usual suspects: tnsnames, sqlnet, db_domain, global_names, and all are set correct for our setup (although I of course welcome suggestions to check something else in the files). Also have confirmed validity of /etc/hosts entries, and permissions on those files for the 'oracle' user. A 'tnsping' and 'ping' are both successful in both directions, though I understand these only check the listener and hardware layer.
    Our Sys Admin has checked firewall connections between the two systems, and stated that they're open on the listener port (1521).
    Listener log files on the remote host, when the hang happens, show an established connection from the local host.
    Does anyone have any suggestions as to what to check for next?
    Thank you in advance for the assist!

    Whew, that truss output is enough to make your eyes bleed!
    This system is on a closed network, so I cannot post the files here, nor would I wish reading those things on anyone nice enough to spend a minute here helping me out!@
    But comparing the truss from the "broken" system, and the working one, the sqlplus that hangs returns a:
    ERR #134 ENOTCONN on a getpeernam() thread.
    The other truss (working side), does not throw that particular line, and the truss output varies widely after that line in the output fille.
    After a few moments letting the sqlplus process "hang", I get:
    ERR #62 ETIME
    Outside of that, lust a lot of hex values!

  • Problem with SQL query never completing

    Right I have a piece of code which executes an SQL query but no matter what I do the program always hangs whenever it gets to the SQL execute line, I have tried using stmt.execute, executeUpdate and executeQuery and none work.
    I can however connect to the database directly and run the same query and it works fine, would be really grateful for some help.
    Code snippet is below, and works is never printed to the command line.
           SQLString = "INSERT INTO TH.OUTPUT_DATA_SNAPSHOT_HDR_TH " +
                    "( EXEC_DATE, USER_ID, OUTPUT_STYLE, OUTPUT_DATE, " +
                    "OUTPUT_FILENAME, SPARE_CHAR_01, SPARE_CHAR_02, " +
                    "SPARE_CHAR_03, SPARE_CHAR_04, SPARE_CHAR_05, " +
                    "SPARE_CHAR_06, SPARE_CHAR_07, SPARE_CHAR_08, " +
                    "SPARE_CHAR_09, SPARE_CHAR_10, SPARE_DATE_01, " +
                    "SPARE_DATE_02, SPARE_DATE_03, SPARE_DATE_04, " +
                    "SPARE_DATE_05, SPARE_DATE_06) " +
                    "VALUES " +
                    "('" + OutExec_Date + "', '" +                     // Exec_Date
                    String.valueOf(DatabaseProperties.AppUserID) +     // User ID
                    "', '" + OutputStyle + "', " +                     // Output_Style
                    "'" + OutputDate + "', " +                         // Output_Date
                    "'" + GlobVarStore.CopyInvDirectory + "', "+       // Output_Filename
                    "'', " +                                           // Spare_Char_01
                    "'', " +                                           // Spare_Char_02
                    "'', " +                                           // Spare_Char_03
                    "'', " +                                           // Spare_Char_04
                    "'', " +                                           // Spare_Char_05
                    "'', " +                                           // Spare_Char_06
                    "'', " +                                           // Spare_Char_07
                    "'', " +                                           // Spare_Char_08
                    "'', " +                                           // Spare_Char_09
                    "'', " +                                           // Spare_Char_10
                    "'" + OutputDate + "', " +                         // Spare_Date_01  - Must not be null
                    "'" + OutputDate + "', " +                         // Spare_Date_02
                    "'" + OutputDate + "', " +                         // Spare_Date_03
                    "'" + OutputDate + "', " +                         // Spare_Date_04
                    "'" + OutputDate + "', " +                         // Spare_Date_05
                    "'" + OutputDate + "'" +                           // Spare_Date_06
           Statement stmt = DatabaseProperties.DBConnection.createStatement();
           System.out.println(SQLString);
           stmt.executeQuery(SQLString);
           System.out.println("works");

    Right I didn't know what a prepared statement was so have done a bit of research and come up with the following code, seems to give same error.
    I know the connection is working because other SQL code is executing in program before it gets to this point, have included the actual SQL statement as well.
    Cheers for your help
           try
              PreparedStatement prepStmt = DatabaseProperties.DBConnection.prepareStatement("INSERT INTO TH.OUTPUT_DATA_SNAPSHOT_HDR_TH ( EXEC_DATE, USER_ID, OUTPUT_STYLE, OUTPUT_DATE, OUTPUT_FILENAME, SPARE_CHAR_01, SPARE_CHAR_02,SPARE_CHAR_03, SPARE_CHAR_04, SPARE_CHAR_05,SPARE_CHAR_06, SPARE_CHAR_07, SPARE_CHAR_08,SPARE_CHAR_09, SPARE_CHAR_10, SPARE_DATE_01,SPARE_DATE_02, SPARE_DATE_03, SPARE_DATE_04, SPARE_DATE_05, SPARE_DATE_06) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ?, ?, ?)");
              prepStmt.setString(1,OutExec_Date);
              prepStmt.setString(2, String.valueOf(DatabaseProperties.AppUserID));
              prepStmt.setString(3,OutputStyle);
              prepStmt.setString(4,OutputDate);
              prepStmt.setString(5,GlobVarStore.CopyInvDirectory);
              prepStmt.setString(6,"");
              prepStmt.setString(7,"");
              prepStmt.setString(8,"");
              prepStmt.setString(9,"");
              prepStmt.setString(10,"");
              prepStmt.setString(11,"");
              prepStmt.setString(12,"");
              prepStmt.setString(13,"");
              prepStmt.setString(14,"");
              prepStmt.setString(15,"");
              prepStmt.setString(16,OutputDate);
              prepStmt.setString(17,OutputDate);
              prepStmt.setString(18,OutputDate);
              prepStmt.setString(19,OutputDate);
              prepStmt.setString(20,OutputDate);
              prepStmt.setString(21,OutputDate);
              System.out.println(prepStmt.toString());
              prepStmt.executeUpdate();
              System.out.println("works");
           catch(SQLException SQLe)
              SQLe.printStackTrace();
    INSERT INTO TH.OUTPUT_DATA_SNAPSHOT_HDR_TH ( EXEC_DATE, USER_ID, OUTPUT_STYLE, OUTPUT_DATE, OUTPUT_FILENAME, SPARE_CHAR_01, SPARE_CHAR_02, SPARE_CHAR_03, SPARE_CHAR_04, SPARE_CHAR_05, SPARE_CHAR_06, SPARE_CHAR_07, SPARE_CHAR_08, SPARE_CHAR_09, SPARE_CHAR_10, SPARE_DATE_01, SPARE_DATE_02, SPARE_DATE_03, SPARE_DATE_04, SPARE_DATE_05, SPARE_DATE_06) VALUES ('09/09/2009', '200', 'INVOICE', '16/09/2009', 'C:\Users\aaronh\DOC20090916163456.txt', '', '', '', '', '', '', '', '', '', '', '16/09/2009', '16/09/2009', '16/09/2009', '16/09/2009', '16/09/2009', '16/09/2009')

  • [4.0] Production SQL Developer hangs when attempting to expand Java in the Connection Navigator

    Folks,
    I'm running production SQL Developer on Oracle Linux 5.8 and whenever I click the Java link in the Connections Navigator with a SYS AS SYSDBA connection SQL Developer hangs.
    Oracle Enterprise Edition 11.2.0.1.0
    SQLDeveloper 4.0.0.13.80
    Oracle Linux 6
    JDK Version 1.7.0_45
    Doing the same thing with user SCOTT (no SYSDBA) works fine (although there are not any Java objects).
    Thanks,
    Rich

    This has been logged as a bug.
    The bad plan/performance has been logged as a bug. SQL Developer didn't hang for me - I was able to cancel the query using the Task Progress panel.

  • SQL Developer hangs periodically

    Hi,
    I'm connecting to my test instance (Oracle XE) and each 5mins-10mins SQL Developer hangs. It doesn't matter what I'm doing, I can be executing a big query or I wasn't doing anything for a while and then simply consulting Columns of a table and hangs...
    I saw the underlying error is:
    oracle.javatools.util.CanceledException
         at oracle.dbtools.raptor.utils.Connections.getConnection(Connections.java:568)
         at oracle.dbtools.raptor.utils.DBObject.getConnection(DBObject.java:323)
         at oracle.dbtools.raptor.utils.DBObject.getConnection(DBObject.java:435)
         at oracle.dbtools.raptor.oviewer.base.ViewerEditorAddin.getEditorWeight(...
    What may I check?
    Any help will be appreciated.
    Josep

    Is this what you mean?
    bq. Oracle SQL Developer \\ +     Copyright (c) 2008, Oracle. All rights reserved.+ \\ +     Locking assertion failure. Backtrace:+ \\ +     #0 /usr/lib/libxcb-xlib.so.0 [0x8c900767]+ \\ +     #1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0x8c9008b1]+ \\ +     #2 /usr/lib/libX11.so.6(_XReply+0xfd) [0x8bdb31bd]+ \\ +     #3 /opt/middleware/jdk160_05/jre/lib/i386/xawt/libmawt.so [0x8c0738ce]+ \\ +     #4 /opt/middleware/jdk160_05/jre/lib/i386/xawt/libmawt.so [0x8c050067]+ \\ +     #5 /opt/middleware/jdk160_05/jre/lib/i386/xawt/libmawt.so [0x8c050318]+ \\ +     #6 /opt/middleware/jdk160_05/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x2f) [0x8c05061f]+ \\ +     #7 [0xb4d413aa]+ \\ +     #8 [0xb4d39f0d]+ \\ +     #9 [0xb4d39f0d]+ \\ +     #10 [0xb4d37249]+ \\ +     #11 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so [0x637338d]+ \\ +     #12 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so [0x64fd168]+ \\ +     #13 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so [0x6373220]+ \\ +     #14 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so(JVM_DoPrivileged+0x363) [0x63c90d3]+ \\ +     #15 /opt/middleware/jdk160_05/jre/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb7d5296d]+ \\ +     #16 [0xb4d413aa]+ \\ +     #17 [0xb4d39da7]+ \\ +     #18 [0xb4d37249]+ \\ +     #19 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so [0x637338d]+ \\ +     Locking assertion failure. Backtrace:+ \\ +     #0 /usr/lib/libxcb-xlib.so.0 [0x8c900767]+ \\ +     #1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0x8c90081e]+ \\ +     #2 /usr/lib/libX11.so.6 [0x8bdb2518]+ \\ +     #3 /usr/lib/libX11.so.6(XGetVisualInfo+0x26) [0x8bda90a6]+ \\ +     #4 /opt/middleware/jdk160_05/jre/lib/i386/xawt/libmawt.so [0x8c04f319]+ \\ +     #5 /opt/middleware/jdk160_05/jre/lib/i386/xawt/libmawt.so [0x8c04f565]+ \\ +     #6 /opt/middleware/jdk160_05/jre/lib/i386/xawt/libmawt.so [0x8c0503c9]+ \\ +     #7 /opt/middleware/jdk160_05/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x2f) [0x8c05061f]+ \\ +     #8 [0xb4d413aa]+ \\ +     #9 [0xb4d39f0d]+ \\ +     #10 [0xb4d39f0d]+ \\ +     #11 [0xb4d37249]+ \\ +     #12 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so [0x637338d]+ \\ +     #13 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so [0x64fd168]+ \\ +     #14 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so [0x6373220]+ \\ +     #15 /opt/middleware/jdk160_05/jre/lib/i386/server/libjvm.so(JVM_DoPrivileged+0x363) [0x63c90d3]+ \\ +     #16 /opt/middleware/jdk160_05/jre/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb7d5296d]+ \\ +     #17 [0xb4d413aa]+ \\ +     #18 [0xb4d39da7]+ \\ +     #19 [0xb4d37249]+ \\ +     Parse time = 258+ \\ +     Incremental Parse time = 99+ \\ +     Incremental Parse time = 7+ \\ +     InsightableOracleDatabase.fetch() time = 49+
    Thanks
    Josep

  • Query Hangs while Parsing

    In one of our databases, one of the Select query hangs at the parsing stage. The query was working fine few days back. How and what can be traced to see the cause of this hang. Database is in 10.2.0.3 and statistics has been gathered for all the affected tables.

    Thanks for the info. The SEQ# is not changing in the v$session_waits. I have found a workaround for this problem. If I delete the statistics for CS_MEASUREMENT table, the query gets executed in .35 secs! If i collect stats again and runs, it hangs.
    The session trace below.
    TKPROF: Release 10.2.0.3.0 - Production on Fri May 30 11:43:02 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Trace file: css1cldr_ora_10134.trc
    Sort options: default
    count = number of times OCI procedure was executed
    cpu = cpu time in seconds executing
    elapsed = elapsed time in seconds executing
    disk = number of physical reads of buffers from disk
    query = number of buffers gotten for consistent read
    current = number of buffers gotten in current mode (usually for update)
    rows = number of rows processed by the fetch or execute call
    select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags,i.property,
    i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey,i.lblkkey,
    i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
    nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
    i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
    nvl(i.spare1,i.intcols),i.spare4,i.spare2,i.spare6,decode(i.pctthres$,null,
    null,mod(trunc(i.pctthres$/256),256)),ist.cachedblk,ist.cachehit,
    ist.logicalread
    from
    ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols,
    min(to_number(bitand(defer,1))) deferrable#,min(to_number(bitand(defer,4)))
    valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where
    i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1 order by i.obj#
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.00 0 0 0 0
    Execute 3 0.01 0.01 0 0 0 0
    Fetch 10 0.00 0.00 0 33 0 7
    total 14 0.02 0.02 0 33 0 7
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    2 SORT ORDER BY (cr=10 pr=0 pw=0 time=2852 us)
    2 HASH JOIN OUTER (cr=10 pr=0 pw=0 time=2741 us)
    2 NESTED LOOPS OUTER (cr=7 pr=0 pw=0 time=102 us)
    2 TABLE ACCESS CLUSTER IND$ (cr=5 pr=0 pw=0 time=73 us)
    1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=29 us)(object id 3)
    0 TABLE ACCESS BY INDEX ROWID IND_STATS$ (cr=2 pr=0 pw=0 time=22 us)
    0 INDEX UNIQUE SCAN I_IND_STATS$_OBJ# (cr=2 pr=0 pw=0 time=18 us)(object id 711)
    2 VIEW (cr=3 pr=0 pw=0 time=361 us)
    2 SORT GROUP BY (cr=3 pr=0 pw=0 time=356 us)
    2 TABLE ACCESS CLUSTER CDEF$ (cr=3 pr=0 pw=0 time=58 us)
    1 INDEX UNIQUE SCAN I_COBJ# (cr=2 pr=0 pw=0 time=25 us)(object id 30)
    select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#,
    sample_size, minimum, maximum, distcnt, lowval, hival, density, col#,
    spare1, spare2, avgcln
    from
    hist_head$ where obj#=:1 and intcol#=:2
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 50 0.01 0.00 0 0 0 0
    Fetch 50 0.00 0.00 0 150 0 50
    total 101 0.01 0.01 0 150 0 50
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: RULE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID HIST_HEAD$ (cr=3 pr=0 pw=0 time=81 us)
    1 INDEX RANGE SCAN I_HH_OBJ#_INTCOL# (cr=2 pr=0 pw=0 time=57 us)(object id 257)
    select /*+ rule */ bucket, endpoint, col#, epvalue
    from
    histgrm$ where obj#=:1 and intcol#=:2 and row#=:3 order by bucket
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 60 0.03 0.01 0 0 0 0
    Fetch 60 0.01 0.00 0 206 0 973
    total 121 0.04 0.02 0 206 0 973
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: RULE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    3 SORT ORDER BY (cr=3 pr=0 pw=0 time=130 us)
    3 TABLE ACCESS CLUSTER HISTGRM$ (cr=3 pr=0 pw=0 time=66 us)
    1 INDEX UNIQUE SCAN I_OBJ#_INTCOL# (cr=2 pr=0 pw=0 time=27 us)(object id 252)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 10.13 10.13
    select pos#,intcol#,col#,spare1,bo#,spare2
    from
    icol$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 7 0.01 0.00 0 0 0 0
    Fetch 25 0.00 0.00 0 50 0 18
    total 33 0.01 0.00 0 50 0 18
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    2 TABLE ACCESS BY INDEX ROWID ICOL$ (cr=6 pr=0 pw=0 time=36 us)
    2 INDEX RANGE SCAN I_ICOL1 (cr=4 pr=0 pw=0 time=38 us)(object id 40)
    select name,intcol#,segcol#,type#,length,nvl(precision#,0),decode(type#,2,
    nvl(scale,-127/*MAXSB1MINAL*/),178,scale,179,scale,180,scale,181,scale,182,
    scale,183,scale,231,scale,0),null$,fixedstorage,nvl(deflength,0),default$,
    rowid,col#,property, nvl(charsetid,0),nvl(charsetform,0),spare1,spare2,
    nvl(spare3,0)
    from
    col$ where obj#=:1 order by intcol#
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 3 0.00 0.01 0 0 0 0
    Fetch 87 0.00 0.00 0 11 0 84
    total 91 0.00 0.01 0 11 0 84
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    12 SORT ORDER BY (cr=3 pr=0 pw=0 time=157 us)
    12 TABLE ACCESS CLUSTER COL$ (cr=3 pr=0 pw=0 time=79 us)
    1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=24 us)(object id 3)
    select col#, grantee#, privilege#,max(mod(nvl(option$,0),2))
    from
    objauth$ where obj#=:1 and col# is not null group by privilege#, col#,
    grantee# order by col#, grantee#
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 3 0.00 0.00 0 0 0 0
    Fetch 3 0.00 0.00 0 6 0 0
    total 7 0.00 0.00 0 6 0 0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 SORT GROUP BY (cr=2 pr=0 pw=0 time=57 us)
    0 TABLE ACCESS BY INDEX ROWID OBJAUTH$ (cr=2 pr=0 pw=0 time=34 us)
    0 INDEX RANGE SCAN I_OBJAUTH1 (cr=2 pr=0 pw=0 time=31 us)(object id 103)
    select grantee#,privilege#,nvl(col#,0),max(mod(nvl(option$,0),2))
    from
    objauth$ where obj#=:1 group by grantee#,privilege#,nvl(col#,0) order by
    grantee#
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 3 0.00 0.00 0 0 0 0
    Fetch 18 0.00 0.00 0 12 0 15
    total 22 0.00 0.00 0 12 0 15
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    5 SORT GROUP BY (cr=4 pr=0 pw=0 time=107 us)
    5 TABLE ACCESS BY INDEX ROWID OBJAUTH$ (cr=4 pr=0 pw=0 time=43 us)
    5 INDEX RANGE SCAN I_OBJAUTH1 (cr=2 pr=0 pw=0 time=16 us)(object id 103)
    select con#,obj#,rcon#,enabled,nvl(defer,0)
    from
    cdef$ where robj#=:1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 3 0.01 0.00 0 0 0 0
    Fetch 3 0.00 0.00 0 3 0 0
    total 7 0.01 0.00 0 3 0 0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID CDEF$ (cr=1 pr=0 pw=0 time=22 us)
    0 INDEX RANGE SCAN I_CDEF3 (cr=1 pr=0 pw=0 time=20 us)(object id 52)
    select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),
    rowid,cols,nvl(defer,0),mtime,nvl(spare1,0)
    from
    cdef$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 3 0.00 0.00 0 0 0 0
    Fetch 34 0.00 0.00 0 42 0 31
    total 38 0.00 0.00 0 42 0 31
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    5 TABLE ACCESS CLUSTER CDEF$ (cr=9 pr=0 pw=0 time=17 us)
    1 INDEX UNIQUE SCAN I_COBJ# (cr=2 pr=0 pw=0 time=10 us)(object id 30)
    select intcol#,nvl(pos#,0),col#,nvl(spare1,0)
    from
    ccol$ where con#=:1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 31 0.01 0.00 0 0 0 0
    Fetch 70 0.00 0.00 0 140 0 39
    total 102 0.01 0.00 0 140 0 39
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    2 TABLE ACCESS BY INDEX ROWID CCOL$ (cr=6 pr=0 pw=0 time=49 us)
    2 INDEX RANGE SCAN I_CCOL1 (cr=4 pr=0 pw=0 time=45 us)(object id 54)
    select condition
    from
    cdef$ where rowid=:1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 2 0 1
    total 3 0.00 0.00 0 2 0 1
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 TABLE ACCESS BY USER ROWID CDEF$ (cr=1 pr=0 pw=0 time=18 us)
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call count cpu elapsed disk query current rows
    Parse 0 0.00 0.00 0 0 0 0
    Execute 0 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 0 0.00 0.00 0 0 0 0
    Misses in library cache during parse: 0
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 10.13 10.13
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call count cpu elapsed disk query current rows
    Parse 11 0.01 0.01 0 0 0 0
    Execute 167 0.08 0.07 0 0 0 0
    Fetch 361 0.01 0.01 0 655 0 1218
    total 539 0.10 0.10 0 655 0 1218
    Misses in library cache during parse: 10
    Misses in library cache during execute: 10
    0 user SQL statements in session.
    167 internal SQL statements in session.
    167 SQL statements in session.
    Trace file: css1cldr_ora_10134.trc
    Trace file compatibility: 10.01.00
    Sort options: default
    1 session in tracefile.
    0 user SQL statements in trace file.
    167 internal SQL statements in trace file.
    167 SQL statements in trace file.
    11 unique SQL statements in trace file.
    3548 lines in trace file.
    0 elapsed seconds in trace file.

  • Join Query hanging

    hi experts,
    please help on this, we have migrated database from 10g to 11.2.0.3 , Everything went sccessful but one of the simple join query hanging occasionally in new upgraded database. is there any known issue or anything need to add after migration for sqls?,also before migration its was executed without any issues. that query is joining and fetching from two more tables . is there any generic reason please provide that would be helpful to analyze, Thanks in Advance.

    why wasn't this discovered during testing prior to the upgrade?
    does new DB have current statistics?
    How do I ask a question on the forums?
    https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360002

  • Query hangs with outer query

    Hi,
    OS: SPARC 64 bit
    Oracle Version: 10.2.0.3.0 64 bit
    My query hangs when I include the outer query. When I execute without outer query It comes out in a fraction of second but when I includes outer query it starts hang
    Below is my original query which hangs
    select * from (select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
    AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
    ('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000) WHERE raw_rnum_ > 0;
    when I execute this it will come out immediately
    select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
    AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
    ('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000
    select * from (select raw_sql_.**, rownum raw_rnum_ from (SELECT /*+ FIRST_ROWS */ NETWORK_ID||'","'||CALLER_NUMBER||'","'||CALLED_NUMBER FROM CDR FROM CDR WHERE 1 = 1
    AND day_of_year = 99 AND INTERFACE = 'TRAFIC' AND TIME_STAMP BETWEEN to_date('2009/04/08 00:00:00','yyyy/mm/dd hh24:mi:ss') AND to_date
    ('2009/04/09 00:00:00','yyyy/mm/dd hh24:mi:ss') AND NETWORK_ID IN (1025,1026) order by id desc) raw_sql_ WHERE rownum <= 10000) WHERE raw_rnum_ > 0;
    but when I includes outer query I hangs it is really very weird for me?
    Here is the explain plan for that query
    Execution Plan
    Plan hash value: 3493649369
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1 | 2015 | 1 (0)| 00:00:01 | | |
    |* 1 | VIEW | | 1 | 2015 | 1 (0)| 00:00:01 | | |
    |* 2 | COUNT STOPKEY | | | | | | | |
    | 3 | PARTITION RANGE SINGLE | | 1 | 5894 | 1 (0)| 00:00:01 | 99 | 99 |
    | 4 | PARTITION LIST ALL | | 1 | 5894 | 1 (0)| 00:00:01 | 1 | 48 |
    |* 5 | TABLE ACCESS BY LOCAL INDEX ROWID| CDR | 1 | 5894 | 1 (0)| 00:00:01 | 4705 | 4752 |
    | 6 | BITMAP CONVERSION TO ROWIDS | | | | | | | |
    |* 7 | BITMAP INDEX SINGLE VALUE | IX_CDR_INTERFACE | | | | | 4705 | 4752 |
    Predicate Information (identified by operation id):
    1 - filter("RAW_RNUM_">0)
    2 - filter(ROWNUM<=10000)
    5 - filter("DAY_OF_YEAR"=99 AND "TIME_STAMP">=TO_DATE('2009-04-08 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND
    "TIME_STAMP"<=TO_DATE('2009-04-09 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND ("NETWORK_ID"=1025 OR
    "NETWORK_ID"=1026))
    7 - access("INTERFACE"='TRAFIC')
    can one explain why it happen? what could be the reason? Is it a bug or something? what should I do now? Issue is critical in the production enviromentent
    Waiting for your Valuable Reply
    Thanks In Advance
    With Regards
    Boo

    user454189 wrote:
    I suspect the issue with the where clause (raw_rnum_ > 0)
    Actually I using bitmap index on ' INTERFACE' column. Does it causing a prob or raw_rnum_ causing a problem?Boo,
    a couple of comments:
    1. Why do you use the deprecated FIRST_ROWS hint? From 9i on the FIRST_ROWS_n mode should be used instead, and since you're using a top-N query format the hint should be superfluous anyway since the optimizer should switch to FIRST_ROWS_n mode automatically.
    2. Why do you use a BITMAP index and not a conventional b*tree index? Let me hazard a guess: Because the INTERFACE column has a small number of distinct values? That would be in most cases a bad idea.
    3. What seems to be odd that you're accessing the data via the BITMAP index on INTERFACE, but request an ORDER BY ID DESC. But there is no order by in the execution plan posted. I wonder where the order should come from? Can you show us the DDL of the bitmap index?
    4. What does the plan look like if you run only the inner query without the outer query?
    You can always gain more information by tracing the statement execution or using the GATHER_PLAN_STATISTICS hint together with the DBMS_XPLAN.DISPLAY_CURSOR function.
    Please read this HOW TO: Post a SQL statement tuning request - template posting that explains what you should provide if you have SQL statement tuning question and how to format it here so that the posted information is readable by others.
    This accompanying blog post shows step-by-step instructions how to obtain that information.
    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/

  • How to delete last user session from backend SQL query?

    Sometimes user session gets closed between some work by any reason.
    When next time that user logs to P6, he gets some error or particular functionaly dosen't work for that user or system hangs.
    In that case if i decided to clear last session history of that user from database, how to write SQL query?
    I don't want to delete all user sessions from table USESSION and USESSAUD, i simply want to delete last user session of particular user (E.g XYZ).

    I am quoting this from MOS Doc Id "Why would multiple session records be present in the User Sessions screen in P6 Web, and why might some of them have different IP addresses? (Doc ID 1600172.1)"
    Multiple sessions show up for users since different sections of P6 Web have their own sessions associated with them. If a user is authorized to use multiple areas of the software they will have multiple sessions each time they log in. Additionally, if users are closing their browsers before logging out of P6 Web Access you might see some past sessions still appearing in the list. These will eventually be cleared out by background jobs, however you can also reset the sessions in the software by clicking the "Reset User" link (Administer > User Sessions > Manage User Sessions), or by choosing the "Reset All Users" link (Administer > User Sessions > Manage User Sessions) to do this for all past sessions.
    Multiple IP addresses for sessions can happen when a user logs in from different machines. For example, a person may login at their desk, but then go to a colleagues workstation to discuss a project, and log in from there. Doing so will leave them with multiple IP addresses in the session records.
    Hope this helps
    Regards,
    Sachin Gupta

Maybe you are looking for

  • Error While assigning points

    I am getting the following error for the past 2 days, while assigning point and closing the tread. An error has occured while assigning points. Please refresh the thread view and try again a®

  • Using Bind Variables in Parameter Form's Query

    I want to use bind variables in the query of Parameter form. But it does not allows. What is the other way out. The structure of my Parameter form is as under: State: Customer: Now I want that I want to list only those customer in the Customer LOV wh

  • Last Question, I promise...  :-)

    I am sooooo stuck... :-( I think the answer is B, but I am not sure... Consider the following pseudocode. Print "Hooray" J = 4 D = 2 While J >= 3 and D < 4 For N = 1 to 2 Print " and Yippee!" Next N J = J - 1 D = D + 1 End While Print "We survived, c

  • Seconds and Milliseconds

    Hello all, I am creating a timer program that, right now, seems to work ok, except for a few small bugs. First off, I need to know if there is any way to make a thread sleep for 1000 milliseconds (I can do this) but also have another thread that will

  • Is the fourth generation ipod touch, the only ipod touch that has a camera?

    I was wondering if the only ipod touch that has a camera is the fourth generation?, and if so why is that?