Update of a table, but involving a join

Hello,
I have a problem that I have not run into before, but it seems to be something commonplace and I thought I would post it here.
I have a source table and a target table, and want to copy out only the changes in the source table to the target table. I divided it into three parts, with a unique row being identified by the primary key columns.
- rows in the source not present in the target - these I simply insert into the target table
- rows in the target that have been deleted in the source - these I set a status flag to mean inactive
- rows that are common, but have had one or more non-key columns changed - these I copy out the non-key column values
I have run into problems with the last one. Perhaps it is my knowledge of Oracle syntax that inadequate, though one person told me that it could not be done.
I have tried some SQL variations, and here is something like what I tried. I have removed proprietary information.
update target
set target.column1 = common_rows_with_changes.column1, target.column2 = common_rows_with_changes.column2
from target,
select source.* from target, source
where target.primary_key_column = source.primary_key_column
and (target.column1 <> source.column1 or target.column2 <> source.column2 )
) common_rows_with_changes
where target.primary_key_column = common_rows_with_changes.primary_key_column
Thanks,
Regards,
Srini

update target
set ( target.column1 , target.column2 ) = (
select source.column1, source.column2
from source
where target.primary_key_column = source.primary_key_column
and (target.column1 <> source.column1 or target.column2 <> source.column2 )
where exists (
select null
from source
where target.primary_key_column = source.primary_key_column
and (target.column1 <> source.column1 or target.column2 <> source.column2 )
)

Similar Messages

  • Data is not getting updated in DB table

    hi all
    i am doing IDOC to jdbc scenario
    i am triggering idoc from R/3 and the data is going into DB table
    sender side:       ZVendorIdoc
    receiver side:
    DT_testVendor
      Table
        tblVendor
          action       UPDATE_INSERT
          access      1:unbounded
            cVendorName 1
            cVendorCode 1
         fromdate    1
         todate      1
          Key
            cVendorName  1
    if i trigger idoc for example vendor 2005,2006 and 2010 data is getting updated in the table
    but again if i trigger idoc for same vendor nos data does not get updated in DB table while message is successfull in moni and RWB both
    plz suggest if any change need to be done to update the data
    Regards
    sandeep sharma

    Hi Ravi
    you are right, vendor no is my key field . problem is when i send data again then it should Update the data but it's not updating the data again
    i did on exp with this : i deleted all the record from the table and then  triggered idoc for vendor 2005 , 2006,2010 after this data is updated in the table i deleted the rows for vendor no 2006 and 2010 and kept the row for vendor 2005
    then i again trigered the idoc for vendor no 2005,2006 and 2010 now this should update and it should insert rows for vendor no 2006 and 2010 but i am surprised its not updating the data
    Thanks
    sandeep

  • Update openquery remote table with join

    Hi All,
    I have a problem with OPENQUERY update on remote table. I've googled for days, and can't solve the problem.
    Here is the problem:
    Local server MS SQL 2005.
    Remote server: MySQL.
    The linked server is communicating through MySQL ODBC 5.1
    I created the following code for update (tried many other version too, this is the last one):
    update openquery(Remoteserver,'select products_id, products_price, products_last_modified, products_stock from products1')
    set
    products_price=A.products_price,
    products_stock=A.products_stock,
    products_last_modified=getdate()
    FROM
    (select * from vi_products_update) AS A INNER JOIN
    openquery(octopus, 'select products_id from products1')AS B
    ON A.products_id=B.products_id
    When I run the query the columns are updated with the same value, for each record. It looks the value is the first which match the criteria. Each (remote and local) table has as primary key products_id. In this example I used as result set for local a view, but I have the same result if I use a table.
    the products_last_modified column is updated in order, and if I update for e.g. the products_price with a constant that is ok too. The problem should be somewhere with join, but I can' get it where.
    THX for any help
    ab

    Hi
    Did you ever solve this problem
    I have the same issue trying to update many rown in a MySQL table from SQL2005 using the syntax below,
    UPDATE
    openquery(DEV,'select id, `desc` from todLocationGroups')
    SET [desc] = V.Destination_Group FROM
    (select * from VTM_TOD_Rate) as V inner join
    openquery(DEV,'select id, `desc` from todLocationGroups') as K
    ON K.id = V.TOD_LG_ID
    but i get this error
    OLE DB provider "MSDASQL" for linked server "KAYOTE_DEV" returned message "Row cannot be located for updating. Some values may have been changed since it was last read.".
    Msg 7343, Level 16, State 4, Line 1
    The OLE DB provider "MSDASQL" for linked server "KAYOTE_DEV" could not UPDATE table "[MSDASQL]". The rowset was using optimistic concurrency and the value of a column has been changed after the containing row was last fetched or resynchronized.

  • Need to update column in table from joining the two tables

    Hi
    i want to update a table by joining two table but i m getting the below error
    single row subquery returns more than one value.
    i m using following query
    update table2
    set deposite_date=(select a.deposit_date from table1 a,table2 b
    where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
    table2
    ban due_date cy_start_date deposite_date
    100 5/6/2011 22/05/2011
    101 7/11/2011 22/05/2011
    102 5/25/2011 22/05/2011
    table1
    ban      deposit_date
    100      04/12/2011
    100      04/15/2011
    102      03/25/2011
    101      04/26/2011
    101      05/06/2011
    101      07/26/2011
    can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_date
    Thanks

    Hi,
    Welcome to the forum!
    876466 wrote:
    Hi
    i want to update a table by joining two table but i m getting the below error
    single row subquery returns more than one value.Exactly!
    (   SELECT  a.deposit_date
        FROM    ...returns all deposit_dates.
    (   SELECT  MAX (a.deposit_date)
        FROM    ...would return only the latest one.
    Also, you need to correlate the sub-query to the main query, so that it only looks for rows with the same ban.
    i m using following query
    update table2
    set deposite_date=(select a.deposit_date from table1 a,table2 b
    where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
    table2
    ban due_date cy_start_date deposite_date
    100 5/6/2011 22/05/2011
    101 7/11/2011 22/05/2011
    102 5/25/2011 22/05/2011
    table1
    ban      deposit_date
    100      04/12/2011
    100      04/15/2011
    102      03/25/2011
    101      04/26/2011
    101      05/06/2011
    101      07/26/2011
    can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_datePerhaps you need something like this:
    UPDATE  table2     b
    SET     deposit_date     =
             (    SELECT  MAX (a.deposit_date)
                   FROM      table1           a
               WHERE      a.ban          = b.ban
               AND      a.deposit_date BETWEEN b.cy_start_date
                               AND     b.due_date
    ;Notice that table1 is the only table in the FROM clause of the sub-query, but the sub-query is correlated to table2, so we can reference columns from table2 in the sub-query.
    Whenever you have a problem, post CREATE TABLE and INSERT statements for your sample data.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using.
    Edited by: Frank Kulash on Aug 1, 2011 1:58 PM

  • I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work

    Hi,
    I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work
    (fault number -2147217900)
    I want to search for a value in a ms access table , if it exist i want to update it, if not i want to insert a new row.
    Working with LabView 7.1, database con. toolset.
    Who can HELP?
    Thanks a lot
    Marco

    Hello,
    I think that If exist is not a standar SQL command (I know it exists I think in Oracle and SQL server), MS access doesn't support it, so I think the best way to do it is first make a Select and then either an Update or an insert, sorry...
    Paulo

  • How to update zero to a column value when record does not exist in table but should display the column value when it exists in table?

    Hello Everyone,
    How to update zero to a column value when record does not exist in table  but should display the column value when it exists in table
    Regards
    Regards Gautam S

    As per my understanding...
    You Would like to see this 
    Code:
    SELECT COALESCE(Salary,0) from Employee;
    Regards
    Shivaprasad S
    Please mark as answer if helpful
    Shiv

  • Update Planning table but need to restart Web application server

    Hi All,
    We want to update the process state externally. After updating table, Windows services (Web application server) need to be restarted.
    However, the updating operation could be done frequently so that we can get real-time result. How to notify Planning application to refresh its data without restarting services ?
    Any ideas or suggestions will be appreciated.
    Edited by: kyhsu on 2009/11/24 下午 10:59

    Hi,
    Planning uses a caching system where it caches the current state of the relational tables. If changes are made in planning then the cache is updated and the tables.
    If you update the tables directly the cache will not be updated so planning will still hold its previous state. I don't think there is an easy way round this and there is no simple update cache procedure.
    If you do need to update tables directly then the only sure way of clearing the cache is to restart the web app.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Multiple row update of a table from another one

    Im trying to make a multiple row update with date from a different table, but it's giving me an error.
    update inv.mtl_system_items_b
    set attribute1 = t2.description,
        last_update_date = SYSDATE,
        last_updated_by = 3606
    from inv.mtl_system_items_b t2
         inner join TMP.TMP_INACTIVAR_PRODUCTOS t1
         on t2.segment2 = t1.inventory_item_id;Edited by: user8986013 on 21-may-2010 14:15

    Hi,
    Whenever you have a question involving an error message, post the complete error message, including line number. Don't you think that might help people solve your problem?
    Whneve you have any question, post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data. (In the case of a DM<L statement, like UPDATE, the INSERT statements show the tables before the change, and the results are the contents of the changed table after it.)
    Review the syntax of the UPDATE statement in the SQL Language manual:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10008.htm#sthref9598
    MERGE may be more efficient and easier to use than UPDATE.

  • Update of a table from a select query with aggregate functions.

    Hello All,
    I have problem here:
    I have 2 tables A(a1, a2, a3, a4, a4....... ) and B( a1, a2, b1, b2, b3). I need to calculate the avg(a4-a3), Max(a4-a3) and Min(a4-a3) and insert it into table B. If the foreign keys a1, a2 already exist in table B, I need to do an update of the computed values into column b1, b2 and b3 respectively, for a1, a2.
    Q1. Is it possible to do this with a single query ? I would prefer not to join A with B because the table A is very large. Also columns b1, b2 and b3 are non-nullable.
    Q2. Also if a4 and a3 are timestamps what is the best way to find the average? A difference of timestamps yields INTERVAL DAY TO SECOND over which the avg function doesn't seem to work. The averages, max and min in my case would be less than a day and hence all I need is to get the data in the hh:mm:ss format.
    As of now I'm using :
    TO_CHAR(TO_DATE(ABS(MOD(TRUNC(AVG(extract(hour FROM (last_modified_date - created_date))*3600 +
    extract( minute FROM (last_modified_date - created_date))*60 +
    extract( second FROM (last_modified_date - created_date)))
    ),86400)),'sssss'),'hh24":"mi":"ss') AS avg_time,
    But this is very long drawn. Something more compact and efficient would be nice.
    Thanks in advance for your inputs.
    Edited by: 847764 on Mar 27, 2011 5:35 PM

    847764 wrote:
    Hi,
    Thanks everyone for such fast replies. Malakshinov's example worked fine for me as far as updating the table goes. As for the timestamp computations, I'm posting additional info: Sorry, I don't understand.
    If Malakshinov's example worked for updating the table, but you still have problems, does that mean you have to do something else besides update the table? If so, what?
    Oracle version : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
    Here are the table details :
    DESC Table A
    Name Null Type
    ID               NOT NULL NUMBER
    A1               NOT NULL VARCHAR2(4)
    A2               NOT NULL VARCHAR2(40)
    A3               NOT NULL VARCHAR2(40)
    CREATED_DATE NOT NULL TIMESTAMP(6)
    LAST_MODIFIED_DATE TIMESTAMP(6) DESCribing the tables can help clarify some things, but it's no substitute for posting CREATE TABLE and INSERT statements. With only a description of the table, nobody can re-create the problem or test their ideas. Please post CREATE TABLE and INSERT statements for both tables as they exist before the MERGE. If table b doen't contain any rows before the MERGE, then just say so, but you still need to post a CREATE TABLE statement for both tables, and INSERT statements for table a.
    The objective is to compute the response times : avg (LAST_MODIFIED_DATE - CREATED_DATE), max (LAST_MODIFIED_DATE - CREATED_DATE) and min (LAST_MODIFIED_DATE - CREATED_DATE) grouped by A1 and A2 and store it in table B under AVG_T, MAX_T and MIN_T. Since AVG_T, MAX_T and MIN_T are only used for reporting purposes we have kept it as Varchar (though I think keeping it as timestamp would make more sense). I think a NUMBER would make more sense (the number of minutes, for example), or perhaps an INTERVAL DAY TO SECOND. If you stored a NUMBER, it would be easy to compute averages.
    In table B the times are stored in the format : hh:mm:ss. We don't need milliseconds precision. If you don;'t need milliseconds, then you should use DATE instead of TIMESTAMP. The functions for manipulating DATEs are much better.
    Hence I was calculating is as follows:
    -- Avg Time
    TO_CHAR(TO_DATE(ABS(MOD(TRUNC(AVG(extract(hour FROM (last_modified_date - created_date))*3600 +
    extract( minute FROM (last_modified_date - created_date))*60 +
    extract( second FROM (last_modified_date - created_date)))
    ),86400)),'sssss'),'hh24":"mi":"ss') AS avg_time,
    --Max Time
    extract (hour FROM MAX(last_modified_date - created_date))||':'||extract (minute FROM MAX(last_modified_date - created_date))||':'||TRUNC(extract (second FROM MAX(last_modified_date - created_date))) AS max_time,
    --Min Time
    extract (hour FROM MIN(last_modified_date - created_date))||':'||extract (minute FROM MIN(last_modified_date - created_date))||':'||TRUNC(extract (second FROM MIN(last_modified_date - created_date))) AS min_timeIs this something that has to be done before or after the MERGE?
    Post the complete statement.
    Is this part of a query? Where's the SELECT keyword?
    Is this part of a DML operation? Where's the INSERT, or UPDATE, or MERGE keyword?
    What are the exact results you want from this? Explain how you get those results.
    Is the code above getting the right results? Are you just asking if there's a better way to get the same results?
    You have to explain things very carefully. None of the people who want to help you are familiar with your application, or your needs.
    I just noticed that my reply is horribly formatted - apologies! I'm just getting the hang of it.Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Update columns in Table A based on columns in Table B for more than 500K rows

    Guys,
    I need to update 9 columns in table A based on value from table B for for more than 500K rows.
    So what is best way to achieve this. I am thinking of writing a Procedure with cursor to update the rows of table A.
    When i googled about it, they say cursor will decrease the performance. So i have no clue how to go for this.
    Rough code which i though
    1) Procedure  with no parameter
    2) Will declare 9 variable to store value from cursor
    3) cursor will fetch row by row based on join condition between table a and table b
    4) i will pass column values from table B to variables
    5) will make an update statement for table A
    Please let me know if above method is correct or is there any other way to do this without using cursor.

    Guys,
    Below is the rough code i wrote as per my requirement. Does it look correct? As of now i dont have any platform to test it so any help with the below code is highly appreciated.  As i said i need to update more than 500K rows by matching Table
    A and Table B.  One more thing which i would like to add in below code, is to get log of all the rows that are in table B but not exist in table A.  Table A already has more than million data in it.
    Also not sure how the loop in below code willl run when @rowcount is become to zero?
    Please let me know if i need to consider performance related impact while running the script.
    GO
    SET SERVEROUTPUT ON
    CREATE PROCEDURE ONETIMEUPDATE
     DECLARE @cnt INT;
     SET @cnt = 1;
     DECLARE @MSG varchar(255);
     DECLARE @COUNT_VAR INT;
     SET @COUNT_VAR=0;
     WHILE @cnt > 0
        BEGIN
      Update TOP (50000) A
      Set A.Col1=B.Col1,
          A.COL2=B.COL2,
          A.COL3=B.COL3,
          A.COL4=B.COL4,
          A.COL5=B.COL5,
          A.COL6=B.COL6,
          A.COL7=B.COL7
      From TableA A
             Inner Join TableB B
             on A.ID = B.ID--ID
             WHERE A.Col1 <> B.Col1
                    OR A.Col2 <> B.Col2;
              SET @cnt = @@ROWCOUNT;
             IF @@ROWCOUNT=25000
               @COUNT_VAR=@COUNT_VAR + @@ROWCOUNT
               SELECT @MSG = CONVERT(varchar, @COUNT_VAR) + "Rows Updated" -- I WANT TO DISPLAY UPDATE after EVERY 25000 ROWS
              PRINT @MSG
      IF @@ROWCOUNT=0
         BEGIN    
               COMMIT
                       END
                    WAITFOR DELAY '00:00:01'  --wait for a second before the next update
                END;
     END;

  • Invalid combinations of joins involving outer joins

    Hi all, I have the following problem
    Scenario: I created 6 custom folders:
    Tasks (with measures)
    Type
    Criticity
    Status
    Owners
    Assignees
    The first folder is used to retrieve how many tasks (COUNT(tasks)) have a particular type or status or a combination between them, and the others 5 are dimensions.
    I create 6 joins starting always from the dimensions in this way (radio buttons):
    Detail item values always exist in master folder (Typical)
    Outer join on detail
    where the master is always a dimension and the detail is always the custom folder with the measures.
    I put the outer join on the custom folder with the measures because I want to show '0' in case I don't have any record on this folder for a specific attribute on a dimension (the join fails).
    I saw that if I put the outer join on the master (dimensions), when the join fails I don't see at all the information regarding that particular dimension.
    For example
    I select 2 folder: Tasks and Assignee
    join: Tasks.task_id (+) = Assignee.task_id
    Result:
    TASK ASSIGNEE
    10 Mr. A
    20 Mr. B
    30 Mr. C
    0 Mr. D
    Just to make a test, If I change the join on Administrator putting :
    Detail item values might not exist in master folder
    Outer join on master
    ...the result is this
    TASK ASSIGNEE
    10 Mr. A
    20 Mr. B
    30 Mr. C
    ...I don't see the last record.
    The customer asked to see always the record with task =0 (if exists), so I joined all the custom folders as I expalned above, but when I try to link (on Discoverer Plus) more than two tasks I have the following error:
    Invalid combinations of joins involving outer joins
    So, my question is this: how can I avoid this error ? Does it exist any trick or another way to link the custom folders (showing always the records with '0' when the join doesn't retrieve nothing ) ?
    Thanks in advance
    Alex

    Well I will take a stab at answering this. The problem is not knowing what is in your custom folders. Also not knowing the specifics on your Discoverer Join definitions. On something like this you may be better going to Oracle support, since they can start a Web Conference and see exactly what you see, and can check out the various possibilities. All we here can do is make guesses, and the guesses could be wrong.
    You do have to be careful in your join definitions in Discoverer. You have to pick the correct table as the Master table, and the correct table as the Detail table. Mess that up and you can mess yourself up. So my first though is check your join definition. Sounds like you want assigned to be the master table. Then tasks would be the detail table.
    Then you want to pick the option that detail items might not exist in master. Which it looks like you have done.
    Then for the other options, Oracle, in my mind, does the opposite of what I would think to pick. If you pick OUTER JOIN ON DETAIL, that will include the Master items with no detail items. So that is what you need to pick.
    Looks like you did the OUTER JOIN ON MASTER, which means will include detail items with no master. Since you had a master with no detail, it will not show, and that is why the Mr. D does not show.
    I always have to do the help on this because it is opposite of what I would expect - my mind thinks outer join on master should include all masters. Nope, it has to be the outer join on detail to do that.
    The master with no detail will probably show a NULL value in the column for the detail, instead of 0. You could convert the null value to display as a 0.
    Hope this helps a bit. Just remember that I am guessing/speculating on a possible cause.
    John Dickey

  • Updating/Inserting multiple tables

    Hi,
    I've been trying to figure out how to update/insert multiple fields in 2 different tables with one RowSet. im new to java and have been using Creator for about 2 weeks
    basically there are 3 tables: one containing user info(USER), one containing department info (DEPT), and one table relating the two (USER_DEPT). my form lets uers update, among others, their NAME in table USER, and DEPT_NAME in table DEPT.
    These are all VARCHAR types.
    I used the Clips provided by Creator to initialize and do the updating. i am using updateRow() to do the updating. the fields are bound to specific database fields. the RowSet is updatable.
    in my app i chose some specific fields, but for the sake of avoiding pasting very long SQL queries lets just say i chose everything. some of the queries i tried:
    SELECT *
    FROM USER WHERE USER.USERNAME = ?This one works.
    SELECT *
    FROM USER, DEPT, USER_DEPT
    where USER.ID = USER_DEPT.USER_ID
    and DEPT.ID = USER_DEPT.DEPT_ID AND USER.USERNAME = ?this one gives me a Conversion Error message. i have no conversion going on whatsoever. i havent even learned how to use conversion yet.
    another query i tried:
    SELECT * FROM USER
    INNER JOIN USER_DEPT ON USER.ID = USER_DEPT.USER_ID
    INNER JOIN DEPT ON DEPT.ID = USER_DEPT.DEPT_ID
    WHERE USER.USERNAME=?this one gives me no error. the app works except the database doesnt get updated. i have determined that when using this query updateRow() is skipped. i dont know why. the app keeps running in that it goes to the next page as defined by the XML, but updateRow() is never called.
    so can anyone please tell me how to update/insert multiple fields in multiple tables using one RowSet PLEASE?
    THANKS!

    The only way this can be done with a single rowset is if you do your query against a view (instead of a join), and if your JDBC driver supports updates to multiple tables through a view. Otherwise, you're going to need to update the underlying tables individually.
    Craig

  • Jython error while updating a oracle table based on file count

    Hi,
    i have jython procedure for counting counting records in a flat file
    Here is the code(took from odiexperts) modified and am getting errors, somebody take a look and let me know what is the sql exception in this code
    COMMAND on target: Jython
    Command on source : Oracle --and specified the logical schema
    Without connecting to the database using the jdbc connection i can see the output successfully, but i want to update the oracle table with count. any help is greatly appreciated
    ---------------------------------Error-----------------------------
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 45, in ?
    java.sql.SQLException: ORA-00936: missing expression
    ---------------------------------------Code--------------------------------------------------
    import java.sql.Connection
    import java.sql.Statement
    import java.sql.DriverManager
    import java.sql.ResultSet
    import java.sql.ResultSetMetaData
    import os
    import string
    import java.sql as sql
    import java.lang as lang
    import re
    filesrc = open('c:\mm\xyz.csv','r')
    first=filesrc.readline()
    lines = 0
    while first:
    #get the no of lines in the file
    lines += 1
    first=filesrc.readline()
    #print lines
    ## THE ABOVE PART OF THE PROGRAM IS TO COUNT THE NUMBER OF LINES
    ## AND STORE IT INTO THE VARIABLE `LINES `
    def intWithCommas(x):
    if type(x) not in [type(0), type(0L)]:
    raise TypeError("Parameter must be an integer.")
    if x < 0:
    return '-' + intWithCommas(-x)
    result = ''
    while x >= 1000:
    x, r = divmod(x, 1000)
    result = ",%03d%s" % (r, result)
    return "%d%s" % (x, result)
    ## THE ABOVE PROGRAM IS TO DISPLAY THE NUMBERS
    sourceConnection = odiRef.getJDBCConnection("SRC")
    sqlstring = sourceConnection.createStatement()
    sqlstmt="update tab1 set tot_coll_amt = to_number( "#lines ") where load_audit_key=418507"
    sqlstring.executeQuery(sqlstmt)
    sourceConnection.close()
    s0=' \n\nThe Number of Lines in the File are ->> '
    s1=str(intWithCommas(lines))
    s2=' \n\nand the First Line of the File is ->> '
    filesrc.seek(0)
    s3=str(filesrc.readline())
    final=s0 + s1 + s2 + s3
    filesrc.close()
    raise final

    i changed as you adviced ankit
    am getting the following error now
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 37, in ?
    java.sql.SQLException: ORA-00911: invalid character
    here is the modified code
    sourceConnection = odiRef.getJDBCConnection("SRC")
    sqlstring = sourceConnection.createStatement()
    sqlstmt="update tab1 set tot_coll_amt = to_number('#lines') where load_audit_key=418507;"
    result=sqlstring.executeUpdate(sqlstmt)
    sourceConnection.close()
    Any ideas
    Edited by: Sunny on Dec 3, 2010 1:04 PM

  • Update Statement Simply hanged but doing db file sequential read

    Hi,
    Last night we had issue with one of the prod server where we updating one of table which contains large number records in millions.Same identical machine completed in1 hour and other box never completed but doing db file sequential read but in the long ops the last statement it was done 20:16 after that nothing is happening but i ran few trace on that user.
    /u01/app/oracle/admin/SURV2/udump/surv2_ora_10048.trc
    Oracle Database 10g Release 10.2.0.4.0 - Production
    ORACLE_HOME = /u01/app/oracle/product/10.2.0/db
    System name:     SunOS
    Node name:     prdfa001
    Release:     5.10
    Version:     Generic_139556-08
    Machine:     i86pc
    Instance name: SURV2
    Redo thread mounted by this instance: 1
    Oracle process number: 18
    Unix process pid: 10048, image: oracle@prdfa001
    *** 2010-09-09 23:37:07.484
    *** ACTION NAME:() 2010-09-09 23:37:07.473
    *** MODULE NAME:(SQL*Plus) 2010-09-09 23:37:07.473
    *** SERVICE NAME:(SURV2) 2010-09-09 23:37:07.473
    *** SESSION ID:(289.54) 2010-09-09 23:37:07.473
    Received ORADEBUG command 'unlimit' from process Unix process pid: 3983, image:
    *** 2010-09-09 23:37:20.315
    Received ORADEBUG command 'event 10046 trace name context forever, level 12' from process Unix process pid: 3983, image:
    WAIT #7: nam='db file sequential read' ela= 11160 file#=13 block#=2252349 blocks=1 obj#=166421 tim=12499462835161
    WAIT #7: nam='db file sequential read' ela= 2857 file#=13 block#=2249751 blocks=1 obj#=166421 tim=12499462838137
    WAIT #7: nam='db file sequential read' ela= 3810 file#=13 block#=2251361 blocks=1 obj#=166421 tim=12499462842048
    WAIT #7: nam='db file sequential read' ela= 4459 file#=13 block#=2247059 blocks=1 obj#=166421 tim=12499462846564
    WAIT #7: nam='db file sequential read' ela= 2841 file#=13 block#=2247507 blocks=1 obj#=166421 tim=12499462849468
    WAIT #7: nam='db file sequential read' ela= 427 file#=13 block#=2247568 blocks=1 obj#=166421 tim=12499462850032
    WAIT #7: nam='db file sequential read' ela= 1187 file#=13 block#=2248264 blocks=1 obj#=166421 tim=12499462851327
    WAIT #7: nam='db file sequential read' ela= 2687 file#=13 block#=2250707 blocks=1 obj#=166421 tim=12499462854178
    WAIT #7: nam='db file sequential read' ela= 3657 file#=13 block#=2249697 blocks=1 obj#=166421 tim=12499462857896
    WAIT #7: nam='db file sequential read' ela= 4139 file#=13 block#=2247074 blocks=1 obj#=166421 tim=12499462862093
    WAIT #7: nam='db file sequential read' ela= 4180 file#=47 block#=3649690 blocks=1 obj#=166421 tim=12499509270445
    WAIT #7: nam='db file sequential read' ela= 4802 file#=47 block#=3649309 blocks=1 obj#=166421 tim=12499509275327
    WAIT #7: nam='db file sequential read' ela= 2459 file#=47 block#=3652697 blocks=1 obj#=166421 tim=12499509277859
    WAIT #7: nam='db file sequential read' ela= 4015 file#=47 block#=3652826 blocks=1 obj#=166421 tim=12499509281948
    WAIT #7: nam='db file sequential read' ela= 2248 file#=47 block#=3651610 blocks=1 obj#=166421 tim=12499509284269
    WAIT #7: nam='db file sequential read' ela= 4824 file#=47 block#=3654297 blocks=1 obj#=166421 tim=12499509289166
    WAIT #7: nam='db file sequential read' ela= 2008 file#=47 block#=3652312 blocks=1 obj#=166421 tim=12499509291248
    WAIT #7: nam='db file sequential read' ela= 1925 file#=47 block#=3654490 blocks=1 obj#=166421 tim=12499509293246
    WAIT #7: nam='db file sequential read' ela= 2859 file#=47 block#=3648458 blocks=1 obj#=166421 tim=12499509296178
    WAIT #7: nam='db file sequential read' ela= 1740 file#=47 block#=3648212 blocks=1 obj#=166421 tim=12499509297991
    WAIT #7: nam='db file sequential read' ela= 2566 file#=47 block#=3648411 blocks=1 obj#=166421 tim=12499509300631
    WAIT #7: nam='db file sequential read' ela= 50772 file#=5 block#=480749 blocks=1 obj#=166421 tim=12499509351477
    WAIT #7: nam='db file sequential read' ela= 12928 file#=5 block#=477177 blocks=1 obj#=166421 tim=12499509364482
    WAIT #7: nam='db file sequential read' ela= 11116 file#=5 block#=479412 blocks=1 obj#=166421 tim=12499509375672
    WAIT #7: nam='db file sequential read' ela= 4803 file#=5 block#=483440 blocks=1 obj#=166421 tim=12499509380549
    WAIT #7: nam='db file sequential read' ela= 6900 file#=5 block#=481454 blocks=1 obj#=166421 tim=12499509387522
    Received ORADEBUG command 'event 10046 trace name context off' from process Unix process pid: 3983, image:
    /u01/app/oracle/admin/SURV2/udump/surv2_ora_1545.trc
    Oracle Database 10g Release 10.2.0.4.0 - Production
    ORACLE_HOME = /u01/app/oracle/product/10.2.0/db
    System name:     SunOS
    Node name:     prdfa001
    Release:     5.10
    Version:     Generic_139556-08
    Machine:     i86pc
    Instance name: SURV2
    Redo thread mounted by this instance: 1
    Oracle process number: 22
    Unix process pid: 1545, image: oracle@prdfa001 (TNS V1-V3)
    *** ACTION NAME:() 2010-09-09 23:20:13.485
    *** MODULE NAME:(sqlplus@prdfa001 (TNS V1-V3)) 2010-09-09 23:20:13.485
    *** SERVICE NAME:(SYS$USERS) 2010-09-09 23:20:13.485
    *** SESSION ID:(290.697) 2010-09-09 23:20:13.485
    ===================================================
    SYSTEM STATE
    System global information:
         processes: base 47819b480, size 300, cleanup 4781a5638
         allocation: free sessions 47f1d6148, free calls 0
         control alloc errors: 0 (process), 0 (session), 0 (call)
         PMON latch cleanup depth: 0
         seconds since PMON's last scan for dead processes: 20
         system statistics:
    1171 logons cumulative
    19 logons current
    89219 opened cursors cumulative
    86 opened cursors current
    15095069 user commits
    5 user rollbacks
    58632904 user calls
    44023255 recursive calls
    224311 recursive cpu usage
    201424173 session logical reads
    0 session stored procedure space
    901812 CPU used when call started
    995437 CPU used by this session
    6814196 DB time
    0 cluster wait time
    22542300822 concurrency wait time
    3095 application wait time
    16479074661 user I/O wait time
    1284052668 session connect time
    1284067190 process last non-idle time
    189018343568 session uga memory
    1249667216 session uga memory max
    26059216 messages sent
    26059220 messages received
    239739 background timeouts
    162399896 session pga memory
    189662872 session pga memory max
    4 enqueue timeouts
    901146 enqueue waits
    0 enqueue deadlocks
    32122711 enqueue requests
    17819 enqueue conversions
    32122676 enqueue releases
    0 global enqueue gets sync
    0 global enqueue gets async
    0 global enqueue get time
    0 global enqueue releases
    2865667 physical read total IO requests
    262620 physical read total multi block requests
    270093476864 physical read total bytes
    select SYS_CONTEXT('USERENV', 'SERVER_HOST'), SYS_CONTEXT('USERENV', 'DB_UNIQUE_NAME'), SYS_CONTEXT('USERENV', 'INSTANCE_NAME'), SYS_CONTEXT('USERENV', 'SERVICE_NAME'), INSTANCE_NUMBER, STARTUP_TIME, SYS_CONTEXT('USERENV', 'DB_DOMAIN') from v$instance where INSTANCE_NAME=SYS_CONTEXT('USERENV', 'INSTANCE_NAME')
          hash=550c95f3d0cfa8290e60ea8382d3a2ca timestamp=09-09-2010 04:24:19
          namespace=CRSR flags=RON/KGHP/TIM/PN0/LRG/KST/DBN/MTX/[100100d1]
          kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=9 hpc=0582 hlc=0582
          lwt=47df576e8[47df576e8,47df576e8] ltm=47df576f8[47df576f8,47df576f8]
          pwt=47df576b0[47df576b0,47df576b0] ptm=47df576c0[47df576c0,47df576c0]
          ref=47df57718[47df57718,47df57718] lnd=47df57730[47df57730,47df57730]
            LIBRARY OBJECT: object=471ee1d38
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            CHILDREN: size=16
            child#    table reference   handle
                 0 471ee1800 471ee1470 47df7dce0
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 47df7de48 471ee1e50 I/P/A/-/-    0 NONE   00
          SO: 473691d60, type: 53, owner: 47924e810, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=473691d60 handle=47bb22fa0 mode=N
          call pin=0 session pin=0 hpc=0000 hlc=0000
          htl=473691de0[4735dbcb8,476cfbf58] htb=476cfbf58 ssga=476cfb6a0
          user=47924e810 session=47f2310f0 count=1 flags=[0000] savepoint=0x0
          LIBRARY OBJECT HANDLE: handle=47bb22fa0 mtx=47bb230d0(0) cdp=0
          namespace=CRSR flags=RON/KGHP/PN0/EXP/[10010100]
          kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=3 hpc=fd84 hlc=fd84
          lwt=47bb23048[47bb23048,47bb23048] ltm=47bb23058[47bb23058,47bb23058]
          pwt=47bb23010[47bb23010,47bb23010] ptm=47bb23020[47bb23020,47bb23020]
          ref=47bb23078[472f8de18,472f8de18] lnd=47bb23090[47bb23090,47bb23090]
            LIBRARY OBJECT: object=472f8d9d8
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            DEPENDENCIES: count=1 size=16
            AUTHORIZATIONS: count=1 size=16 minimum entrysize=16
            ACCESSES: count=1 size=16
            TRANSLATIONS: count=1 size=16
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 47bb22ee0 472f8daf0 I/P/A/-/-    0 NONE   00
                6 472f8e508 46be86250 I/-/A/-/E    0 NONE   00
          SO: 4735dbc38, type: 53, owner: 47924e810, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=4735dbc38 handle=47bb231c8 mode=N
          call pin=0 session pin=0 hpc=0000 hlc=0000
          htl=4735dbcb8[476cfbf58,473691de0] htb=476cfbf58 ssga=476cfb6a0
          user=47924e810 session=47f2310f0 count=1 flags=[0000] savepoint=0x4c894f8b
          LIBRARY OBJECT HANDLE: handle=47bb231c8 mtx=47bb232f8(1) cdp=1
          name=select value$ from props$ where name = 'GLOBAL_DB_NAME'
          hash=4bb432d65c5a391a42a5c3fa74472c7a timestamp=09-09-2010 04:24:12
          namespace=CRSR flags=RON/KGHP/TIM/PN0/SML/KST/DBN/MTX/[120100d0]
          kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=3 hpc=0584 hlc=0584
          lwt=47bb23270[47bb23270,47bb23270] ltm=47bb23280[47bb23280,47bb23280]
          pwt=47bb23238[47bb23238,47bb23238] ptm=47bb23248[47bb23248,47bb23248]
          ref=47bb232a0[47bb232a0,47bb232a0] lnd=47bb232b8[47bb232b8,47bb232b8]
            LIBRARY OBJECT: object=472f8e6e0
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            CHILDREN: size=16
            child#    table reference   handle
                 0 472f8e1a8 472f8de18 47bb22fa0
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 47bb23108 472f8e7f8 I/P/A/-/-    0 NONE   00
          SO: 473644348, type: 53, owner: 47924e810, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=473644348 handle=47bbde418 mode=N
          call pin=0 session pin=0 hpc=0000 hlc=0000
          htl=4736443c8[476cfc0b8,476cfc0b8] htb=476cfc0b8 ssga=476cfb6a0
          user=47924e810 session=47924e810 count=1 flags=[0000] savepoint=0x4c894f8b
          LIBRARY OBJECT HANDLE: handle=47bbde418 mtx=47bbde548(0) cdp=0
          name=ALTER SESSION SET TIME_ZONE='+02:00'
          hash=3878dff8839e71e3dd05a2e75fbd6390 timestamp=09-09-2010 04:24:04
          namespace=CRSR flags=RON/KGHP/TIM/PN0/SML/DBN/[12010040]
          kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=11 hpc=04e8 hlc=04e8
          lwt=47bbde4c0[47bbde4c0,47bbde4c0] ltm=47bbde4d0[47bbde4d0,47bbde4d0]
          pwt=47bbde488[47bbde488,47bbde488] ptm=47bbde498[47bbde498,47bbde498]
          ref=47bbde4f0[47bbde4f0,47bbde4f0] lnd=47bbde508[47bbde508,47bbde508]
            LIBRARY OBJECT: object=472fffc08
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 47bbde320 472fffd20 I/P/A/-/-    0 NONE   00
          SO: 47aecf9e8, type: 41, owner: 47924e810, flag: INIT/-/-/0x00
          (dummy) nxc=0, nlb=0  
        SO: 47f290540, type: 11, owner: 4781a7dc0, flag: INIT/-/-/0x00
        (broadcast handle) flag: (2) ACTIVE SUBSCRIBER, owner: 4781a7dc0,
                           event: 1132, last message event: 1132,
                           last message waited event: 1132,                        next message: 0(0), messages read: 0
                           channel: (47a2df4f8) system events broadcast channel
                                    scope: 2, event: 1132, last mesage event: 18,
                                    publishers/subscribers: 0/17,
                                    messages published: 1
        SO: 47826b228, type: 3, owner: 4781a7dc0, flag: INIT/-/-/0x00
        (call) sess: cur 47924e810, rec 0, usr 47924e810; depth: 0
        SO: 476c52968, type: 16, owner: 4781a7dc0, flag: INIT/-/-/0x00
        (osp req holder)
    PSEUDO PROCESS for group DEFAULT:
      SO: 47a1eb7d0, type: 2, owner: 0, flag: INIT/-/-/0x00
      (process) Oracle pid=0, calls cur/top: 0/0, flag: (20) PSEUDO
                int error: 0, call error: 0, sess error: 0, txn error 0
      (post info) last post received: 0 0 0
                  last post received-location: No post
                  last process to post me: none
                  last post sent: 0 0 0
                  last post sent-location: No post
                  last process posted by me: none
        (latch info) wait_event=0 bits=0
        Process Group: DEFAULT, pseudo proc: 47a1eb7d0
        O/S info: user: , term: , ospid:  (DEAD)
        OSD pid info: Unix process pid: 0, image: PSEUDO
    Dump of memory from 0x00000004791BF538 to 0x00000004791BF740
    4791BF530                   00000000 00000000          [........]
    4791BF540 00000000 00000000 00000000 00000000  [................]
      Repeat 31 times
    NO DETACHED BRANCHES.
    NO DETACHED NETWORK CONNECTIONS.
    CLEANUP STATE OBJECTS:
    SO: 47f0cd038, type: 1, owner: 0, flag: INIT/-/-/0x00
    (cleanup state object) description: instance enqueue anchor state
    latch: 0x380009890
      SO: 4782cf080, type: 5, owner: 47f0cd038, flag: INIT/-/-/0x00
      (enqueue) TA-00000006-00000001     DID: 0001-000F-0000000B
      lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  res_flag: 0x2
      res: 0x47a28d020, mode: X, lock_flag: 0x0
      own: 0x0, sess: 0x0, prv: 0x47a28d030
    SO: 47f0cd098, type: 1, owner: 0, flag: INIT/-/-/0x00
    (cleanup state object) description: switchable channel handle anch
    latch: 0x38000ac98
      SO: 47f28f868, type: 11, owner: 47f0cd098, flag: INIT/-/-/0x00
      (broadcast handle) flag: (c2) ACTIVE SUBSCRIBER, owner: 0,
                         event: 1, last message event: 1,
                         last message waited event: 1,                      next message: 0(0), messages read: 0
                         channel: (47a2e4190) KPON channel
                                  scope: 2, event: 1, last mesage event: 0,
                                  publishers/subscribers: 0/1,
                                  messages published: 0
    SO: 47f0cd0f8, type: 1, owner: 0, flag: INIT/-/-/0x00
    (cleanup state object) description: TT shared object cleanup SO
    latch: 0x38001c6b8
    SO: 47f0cd158, type: 1, owner: 0, flag: INIT/-/-/0x00
    (cleanup state object) description: SS shared object cleanup SO
    latch: 0x38001cd48
    END OF SYSTEM STATE
    Top 5 Timed Events                                         Avg %Total
    ~~~~~~~~~~~~~~~~~~                                        wait   Call
    Event                                 Waits    Time (s)   (ms)   Time Wait Class
    db file sequential read           2,347,652       9,215      4   64.5   User I/O
    db file scattered read              245,687       4,199     17   29.4   User I/O
    CPU time                                            974           6.8
    db file parallel write               50,082         408      8    2.9 System I/O
    log file parallel write               6,963          52      7    0.4 System I/O
    Time Model Statistics                DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> Total time in database user-calls (DB Time): 14286.4s
    -> Statistics including the word "background" measure background process
       time, and so do not contribute to the DB time statistic
    -> Ordered by % or DB time desc, Statistic name
    Statistic Name                                       Time (s) % of DB Time
    sql execute elapsed time                             14,280.3        100.0
    DB CPU                                                  974.5          6.8
    PL/SQL execution elapsed time                           531.8          3.7
    parse time elapsed                                       30.5           .2
    hard parse elapsed time                                  27.1           .2
    connection management call elapsed time                  14.9           .1
    hard parse (sharing criteria) elapsed time                3.4           .0
    hard parse (bind mismatch) elapsed time                   3.1           .0
    PL/SQL compilation elapsed time                           2.4           .0
    failed parse elapsed time                                 0.0           .0
    repeated bind elapsed time                                0.0           .0
    sequence load elapsed time                                0.0           .0
    DB time                                              14,286.4          N/A
    background elapsed time                                 670.2          N/A
    background cpu time                                     186.1          N/A
    Wait Class                            DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> s  - second
    -> cs - centisecond -     100th of a second
    -> ms - millisecond -    1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc
                                                                      Avg
                                           %Time       Total Wait    wait     Waits
    Wait Class                      Waits  -outs         Time (s)    (ms)      /txn
    User I/O                    2,593,484     .0           13,415       5     150.0
    System I/O                     87,506     .0              515       6       5.1
    Other                             839   11.4                6       7       0.0
    Commit                          3,225     .1                6       2       0.2
    Concurrency                     1,033     .0                5       5       0.1
    Configuration                   2,514   99.4                0       0       0.1
    Network                        47,559     .0                0       0       2.8
    Application                         7     .0                0       0       0.0
    Wait Events                          DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> s  - second
    -> cs - centisecond -     100th of a second
    -> ms - millisecond -    1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc (idle events last)
                                                                       Avg
                                                 %Time  Total Wait    wait     Waits
    Event                                 Waits  -outs    Time (s)    (ms)      /txn
    db file sequential read           2,347,652     .0       9,215       4     135.8
    db file scattered read              245,687     .0       4,199      17      14.2
    db file parallel write               50,082     .0         408       8       2.9
    log file parallel write               6,963     .0          52       7       0.4
    control file parallel write           6,203     .0          44       7       0.4
    control file sequential read         24,242     .0          11       0       1.4
    log file sync                         3,225     .1           6       2       0.2
    latch free                               84     .0           4      47       0.0
    os thread startup                        25     .0           3     120       0.0
    latch: session allocation                39     .0           1      33       0.0
    db file parallel read                    12     .0           1      92       0.0
    enq: TX - index contention              186     .0           1       3       0.0
    latch: shared pool                       47     .0           1      11       0.0
    LGWR wait for redo copy                 319    3.1           0       1       0.0
    library cache load lock                   2     .0           0     172       0.0
    buffer busy waits                       590     .0           0       0       0.0
    log file switch completion                6     .0           0      29       0.0
    SGA: allocation forcing comp             11   54.5           0      14       0.0
    latch: library cache lock                50     .0           0       3       0.0
    read by other session                    38     .0           0       4       0.0
    direct path read                         42     .0           0       3       0.0
    SQL*Net message to client            44,807     .0           0       0       2.6
    rdbms ipc reply                         207     .0           0       0       0.0
    SQL*Net more data from clien          1,014     .0           0       0       0.1
    latch: cache buffers chains              24     .0           0       1       0.0
    latch: library cache                     29     .0           0       1       0.0
    log file sequential read                  8     .0           0       3       0.0
    direct path write                        50     .0           0       0       0.0
    SQL*Net more data to client             398     .0           0       0       0.0
    latch: object queue header o             12     .0           0       1       0.0
    latch: In memory undo latch              78     .0           0       0       0.0
    undo segment extension                2,507   99.7           0       0       0.1
    latch: cache buffers lru cha              4     .0           0       1       0.0
    log file single write                     8     .0           0       0       0.0
    local write wait                          3     .0           0       1       0.0
    enq: RO - fast object reuse               3     .0           0       1       0.0
    buffer deadlock                          87   92.0           0       0       0.0
    enq: JS - queue lock                      1     .0           0       1       0.0
    cursor: pin S                            70     .0           0       0       0.0
    latch: row cache objects                  2     .0           0       1       0.0
    SQL*Net message to dblink             1,338     .0           0       0       0.1
    latch: checkpoint queue latc              2     .0           0       0       0.0
    reliable message                          3     .0           0       0       0.0
    log buffer space                          1     .0           0       1       0.0
    SQL*Net break/reset to clien              4     .0           0       0       0.0
    SQL*Net more data from dblin              2     .0           0       0       0.0
    SQL*Net message from client          44,949     .0     155,701    3464       2.6
    virtual circuit status                  621  100.0      18,156   29237       0.0
    Streams AQ: qmn slave idle w            664     .0      18,127   27299       0.0
    Streams AQ: qmn coordinator           1,339   50.4      18,099   13517       0.1
    Streams AQ: waiting for time             12  100.0       8,741  728394       0.0
    jobq slave wait                         130  100.0         380    2927       0.0
    PL/SQL lock timer                         1  100.0           1     978       0.0
    SQL*Net message from dblink           1,338     .0           0       0       0.1
    single-task message                       1     .0           0      38       0.0
    class slave wait                         11     .0           0       1       0.0
    SQL ordered by Elapsed Time          DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> Resources reported for PL/SQL code includes the resources used by all SQL
       statements called by the code.
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
      Elapsed      CPU                  Elap per  % Total
      Time (s)   Time (s)  Executions   Exec (s)  DB Time    SQL Id
        13,664        906            0        N/A    95.6 gr2cx6athc5j5
    Module: SQL*Plus
    BEGIN DBMS_OUTPUT.PUT_LINE(equiduct.eod(NULL,NULL)); END;
         8,792        195            0        N/A    61.5 986fzxtzr52u5
    Module: SQL*Plus
    UPDATE TIBEX_ORDER SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"SYS_B_1"
         2,524        368            1     2524.1    17.7 c4uf0x6hdgnwq
    Module: SQL*Plus
    UPDATE TIBEX_FIXSESSIONSTATE SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"
    SYS_B_1"
         1,414        177            1     1414.4     9.9 cbg09ma34kq8w
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_ORDER WHERE INSTRUMENTID=:"SYS_B_0"
           742        137            1      742.2     5.2 g0sg6v994wssq
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_FIXSESSIONSTATE WHERE INSTRUMENTID=:"SYS_B_0"
           274         11            1      274.2     1.9 6mcpb06rctk0x
    Module: DBMS_SCHEDULER
    call dbms_space.auto_space_advisor_job_proc ( )
           264          8           27        9.8     1.8 8szmwam7fysa3
    Module: DBMS_SCHEDULER
    insert into wri$_adv_objspace_trend_data select timepoint, space_usage, space_a
    lloc, quality from table(dbms_space.object_growth_trend(:1, :2, :3, :4, NULL, N
    ULL, NULL, 'FALSE', :5, 'FALSE'))
            99          1            1       99.4     0.7 1z0x41f66nvjr
    Module: SQL*Plus
    UPDATE TIBEX_INSTRUMENTADMIN SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"
    SYS_B_1"
            21         10            1       21.5     0.2 bbc1ck8594kvj
    Module: SQL*Plus
    UPDATE TIBEX_INSTRUMENTDAILYHIST SET ADJOPEN=NVL(ADJOPEN,OPEN), ADJHIGH=NVL(ADJH
    IGH,HIGH), ADJLOW=NVL(ADJLOW,LOW), ADJMID=NVL(ADJMID,MID), ADJCLOSE=NVL(ADJCLOSE
    ,CLOSE), ADJVOLUME=NVL(ADJVOLUME,VOLUME), ADJCLOSINGBID=NVL(ADJCLOSINGBID,CLOSIN
    GBID), ADJCLOSINGOFFER=NVL(ADJCLOSINGOFFER,CLOSINGOFFER)
            12          0            1       12.5     0.1 6xm9p9uy5kaap
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_INSTRUMENTSTATE WHERE INSTRUMENTID=:"SYS_B_0"
    SQL ordered by CPU Time              DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> Resources reported for PL/SQL code includes the resources used by all SQL
       statements called by the code.
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
        CPU      Elapsed                  CPU per  % Total
      Time (s)   Time (s)  Executions     Exec (s) DB Time    SQL Id
           906     13,664            0         N/A    95.6 gr2cx6athc5j5
    Module: SQL*Plus
    BEGIN DBMS_OUTPUT.PUT_LINE(equiduct.eod(NULL,NULL)); END;
           368      2,524            1      367.51    17.7 c4uf0x6hdgnwq
    Module: SQL*Plus
    UPDATE TIBEX_FIXSESSIONSTATE SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"
    SYS_B_1"
           195      8,792            0         N/A    61.5 986fzxtzr52u5
    Module: SQL*Plus
    UPDATE TIBEX_ORDER SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"SYS_B_1"
           177      1,414            1      176.93     9.9 cbg09ma34kq8w
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_ORDER WHERE INSTRUMENTID=:"SYS_B_0"
           137        742            1      137.38     5.2 g0sg6v994wssq
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_FIXSESSIONSTATE WHERE INSTRUMENTID=:"SYS_B_0"
            11        274            1       10.82     1.9 6mcpb06rctk0x
    Module: DBMS_SCHEDULER
    call dbms_space.auto_space_advisor_job_proc ( )
            10         21            1        9.65     0.2 bbc1ck8594kvjEdited by: NM on 10-Sep-2010 07:39

    Hi,
    Last night we had issue with one of the prod server where we updating one of table which contains large number records in millions.Same identical machine completed in1 hour and other box never completed but doing db file sequential read but in the long ops the last statement it was done 20:16 after that nothing is happening but i ran few trace on that user.
    /u01/app/oracle/admin/SURV2/udump/surv2_ora_10048.trc
    Oracle Database 10g Release 10.2.0.4.0 - Production
    ORACLE_HOME = /u01/app/oracle/product/10.2.0/db
    System name:     SunOS
    Node name:     prdfa001
    Release:     5.10
    Version:     Generic_139556-08
    Machine:     i86pc
    Instance name: SURV2
    Redo thread mounted by this instance: 1
    Oracle process number: 18
    Unix process pid: 10048, image: oracle@prdfa001
    *** 2010-09-09 23:37:07.484
    *** ACTION NAME:() 2010-09-09 23:37:07.473
    *** MODULE NAME:(SQL*Plus) 2010-09-09 23:37:07.473
    *** SERVICE NAME:(SURV2) 2010-09-09 23:37:07.473
    *** SESSION ID:(289.54) 2010-09-09 23:37:07.473
    Received ORADEBUG command 'unlimit' from process Unix process pid: 3983, image:
    *** 2010-09-09 23:37:20.315
    Received ORADEBUG command 'event 10046 trace name context forever, level 12' from process Unix process pid: 3983, image:
    WAIT #7: nam='db file sequential read' ela= 11160 file#=13 block#=2252349 blocks=1 obj#=166421 tim=12499462835161
    WAIT #7: nam='db file sequential read' ela= 2857 file#=13 block#=2249751 blocks=1 obj#=166421 tim=12499462838137
    WAIT #7: nam='db file sequential read' ela= 3810 file#=13 block#=2251361 blocks=1 obj#=166421 tim=12499462842048
    WAIT #7: nam='db file sequential read' ela= 4459 file#=13 block#=2247059 blocks=1 obj#=166421 tim=12499462846564
    WAIT #7: nam='db file sequential read' ela= 2841 file#=13 block#=2247507 blocks=1 obj#=166421 tim=12499462849468
    WAIT #7: nam='db file sequential read' ela= 427 file#=13 block#=2247568 blocks=1 obj#=166421 tim=12499462850032
    WAIT #7: nam='db file sequential read' ela= 1187 file#=13 block#=2248264 blocks=1 obj#=166421 tim=12499462851327
    WAIT #7: nam='db file sequential read' ela= 2687 file#=13 block#=2250707 blocks=1 obj#=166421 tim=12499462854178
    WAIT #7: nam='db file sequential read' ela= 3657 file#=13 block#=2249697 blocks=1 obj#=166421 tim=12499462857896
    WAIT #7: nam='db file sequential read' ela= 4139 file#=13 block#=2247074 blocks=1 obj#=166421 tim=12499462862093
    WAIT #7: nam='db file sequential read' ela= 4180 file#=47 block#=3649690 blocks=1 obj#=166421 tim=12499509270445
    WAIT #7: nam='db file sequential read' ela= 4802 file#=47 block#=3649309 blocks=1 obj#=166421 tim=12499509275327
    WAIT #7: nam='db file sequential read' ela= 2459 file#=47 block#=3652697 blocks=1 obj#=166421 tim=12499509277859
    WAIT #7: nam='db file sequential read' ela= 4015 file#=47 block#=3652826 blocks=1 obj#=166421 tim=12499509281948
    WAIT #7: nam='db file sequential read' ela= 2248 file#=47 block#=3651610 blocks=1 obj#=166421 tim=12499509284269
    WAIT #7: nam='db file sequential read' ela= 4824 file#=47 block#=3654297 blocks=1 obj#=166421 tim=12499509289166
    WAIT #7: nam='db file sequential read' ela= 2008 file#=47 block#=3652312 blocks=1 obj#=166421 tim=12499509291248
    WAIT #7: nam='db file sequential read' ela= 1925 file#=47 block#=3654490 blocks=1 obj#=166421 tim=12499509293246
    WAIT #7: nam='db file sequential read' ela= 2859 file#=47 block#=3648458 blocks=1 obj#=166421 tim=12499509296178
    WAIT #7: nam='db file sequential read' ela= 1740 file#=47 block#=3648212 blocks=1 obj#=166421 tim=12499509297991
    WAIT #7: nam='db file sequential read' ela= 2566 file#=47 block#=3648411 blocks=1 obj#=166421 tim=12499509300631
    WAIT #7: nam='db file sequential read' ela= 50772 file#=5 block#=480749 blocks=1 obj#=166421 tim=12499509351477
    WAIT #7: nam='db file sequential read' ela= 12928 file#=5 block#=477177 blocks=1 obj#=166421 tim=12499509364482
    WAIT #7: nam='db file sequential read' ela= 11116 file#=5 block#=479412 blocks=1 obj#=166421 tim=12499509375672
    WAIT #7: nam='db file sequential read' ela= 4803 file#=5 block#=483440 blocks=1 obj#=166421 tim=12499509380549
    WAIT #7: nam='db file sequential read' ela= 6900 file#=5 block#=481454 blocks=1 obj#=166421 tim=12499509387522
    Received ORADEBUG command 'event 10046 trace name context off' from process Unix process pid: 3983, image:
    /u01/app/oracle/admin/SURV2/udump/surv2_ora_1545.trc
    Oracle Database 10g Release 10.2.0.4.0 - Production
    ORACLE_HOME = /u01/app/oracle/product/10.2.0/db
    System name:     SunOS
    Node name:     prdfa001
    Release:     5.10
    Version:     Generic_139556-08
    Machine:     i86pc
    Instance name: SURV2
    Redo thread mounted by this instance: 1
    Oracle process number: 22
    Unix process pid: 1545, image: oracle@prdfa001 (TNS V1-V3)
    *** ACTION NAME:() 2010-09-09 23:20:13.485
    *** MODULE NAME:(sqlplus@prdfa001 (TNS V1-V3)) 2010-09-09 23:20:13.485
    *** SERVICE NAME:(SYS$USERS) 2010-09-09 23:20:13.485
    *** SESSION ID:(290.697) 2010-09-09 23:20:13.485
    ===================================================
    SYSTEM STATE
    System global information:
         processes: base 47819b480, size 300, cleanup 4781a5638
         allocation: free sessions 47f1d6148, free calls 0
         control alloc errors: 0 (process), 0 (session), 0 (call)
         PMON latch cleanup depth: 0
         seconds since PMON's last scan for dead processes: 20
         system statistics:
    1171 logons cumulative
    19 logons current
    89219 opened cursors cumulative
    86 opened cursors current
    15095069 user commits
    5 user rollbacks
    58632904 user calls
    44023255 recursive calls
    224311 recursive cpu usage
    201424173 session logical reads
    0 session stored procedure space
    901812 CPU used when call started
    995437 CPU used by this session
    6814196 DB time
    0 cluster wait time
    22542300822 concurrency wait time
    3095 application wait time
    16479074661 user I/O wait time
    1284052668 session connect time
    1284067190 process last non-idle time
    189018343568 session uga memory
    1249667216 session uga memory max
    26059216 messages sent
    26059220 messages received
    239739 background timeouts
    162399896 session pga memory
    189662872 session pga memory max
    4 enqueue timeouts
    901146 enqueue waits
    0 enqueue deadlocks
    32122711 enqueue requests
    17819 enqueue conversions
    32122676 enqueue releases
    0 global enqueue gets sync
    0 global enqueue gets async
    0 global enqueue get time
    0 global enqueue releases
    2865667 physical read total IO requests
    262620 physical read total multi block requests
    270093476864 physical read total bytes
    select SYS_CONTEXT('USERENV', 'SERVER_HOST'), SYS_CONTEXT('USERENV', 'DB_UNIQUE_NAME'), SYS_CONTEXT('USERENV', 'INSTANCE_NAME'), SYS_CONTEXT('USERENV', 'SERVICE_NAME'), INSTANCE_NUMBER, STARTUP_TIME, SYS_CONTEXT('USERENV', 'DB_DOMAIN') from v$instance where INSTANCE_NAME=SYS_CONTEXT('USERENV', 'INSTANCE_NAME')
          hash=550c95f3d0cfa8290e60ea8382d3a2ca timestamp=09-09-2010 04:24:19
          namespace=CRSR flags=RON/KGHP/TIM/PN0/LRG/KST/DBN/MTX/[100100d1]
          kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=9 hpc=0582 hlc=0582
          lwt=47df576e8[47df576e8,47df576e8] ltm=47df576f8[47df576f8,47df576f8]
          pwt=47df576b0[47df576b0,47df576b0] ptm=47df576c0[47df576c0,47df576c0]
          ref=47df57718[47df57718,47df57718] lnd=47df57730[47df57730,47df57730]
            LIBRARY OBJECT: object=471ee1d38
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            CHILDREN: size=16
            child#    table reference   handle
                 0 471ee1800 471ee1470 47df7dce0
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 47df7de48 471ee1e50 I/P/A/-/-    0 NONE   00
          SO: 473691d60, type: 53, owner: 47924e810, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=473691d60 handle=47bb22fa0 mode=N
          call pin=0 session pin=0 hpc=0000 hlc=0000
          htl=473691de0[4735dbcb8,476cfbf58] htb=476cfbf58 ssga=476cfb6a0
          user=47924e810 session=47f2310f0 count=1 flags=[0000] savepoint=0x0
          LIBRARY OBJECT HANDLE: handle=47bb22fa0 mtx=47bb230d0(0) cdp=0
          namespace=CRSR flags=RON/KGHP/PN0/EXP/[10010100]
          kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=3 hpc=fd84 hlc=fd84
          lwt=47bb23048[47bb23048,47bb23048] ltm=47bb23058[47bb23058,47bb23058]
          pwt=47bb23010[47bb23010,47bb23010] ptm=47bb23020[47bb23020,47bb23020]
          ref=47bb23078[472f8de18,472f8de18] lnd=47bb23090[47bb23090,47bb23090]
            LIBRARY OBJECT: object=472f8d9d8
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            DEPENDENCIES: count=1 size=16
            AUTHORIZATIONS: count=1 size=16 minimum entrysize=16
            ACCESSES: count=1 size=16
            TRANSLATIONS: count=1 size=16
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 47bb22ee0 472f8daf0 I/P/A/-/-    0 NONE   00
                6 472f8e508 46be86250 I/-/A/-/E    0 NONE   00
          SO: 4735dbc38, type: 53, owner: 47924e810, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=4735dbc38 handle=47bb231c8 mode=N
          call pin=0 session pin=0 hpc=0000 hlc=0000
          htl=4735dbcb8[476cfbf58,473691de0] htb=476cfbf58 ssga=476cfb6a0
          user=47924e810 session=47f2310f0 count=1 flags=[0000] savepoint=0x4c894f8b
          LIBRARY OBJECT HANDLE: handle=47bb231c8 mtx=47bb232f8(1) cdp=1
          name=select value$ from props$ where name = 'GLOBAL_DB_NAME'
          hash=4bb432d65c5a391a42a5c3fa74472c7a timestamp=09-09-2010 04:24:12
          namespace=CRSR flags=RON/KGHP/TIM/PN0/SML/KST/DBN/MTX/[120100d0]
          kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=3 hpc=0584 hlc=0584
          lwt=47bb23270[47bb23270,47bb23270] ltm=47bb23280[47bb23280,47bb23280]
          pwt=47bb23238[47bb23238,47bb23238] ptm=47bb23248[47bb23248,47bb23248]
          ref=47bb232a0[47bb232a0,47bb232a0] lnd=47bb232b8[47bb232b8,47bb232b8]
            LIBRARY OBJECT: object=472f8e6e0
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            CHILDREN: size=16
            child#    table reference   handle
                 0 472f8e1a8 472f8de18 47bb22fa0
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 47bb23108 472f8e7f8 I/P/A/-/-    0 NONE   00
          SO: 473644348, type: 53, owner: 47924e810, flag: INIT/-/-/0x00
          LIBRARY OBJECT LOCK: lock=473644348 handle=47bbde418 mode=N
          call pin=0 session pin=0 hpc=0000 hlc=0000
          htl=4736443c8[476cfc0b8,476cfc0b8] htb=476cfc0b8 ssga=476cfb6a0
          user=47924e810 session=47924e810 count=1 flags=[0000] savepoint=0x4c894f8b
          LIBRARY OBJECT HANDLE: handle=47bbde418 mtx=47bbde548(0) cdp=0
          name=ALTER SESSION SET TIME_ZONE='+02:00'
          hash=3878dff8839e71e3dd05a2e75fbd6390 timestamp=09-09-2010 04:24:04
          namespace=CRSR flags=RON/KGHP/TIM/PN0/SML/DBN/[12010040]
          kkkk-dddd-llll=0000-0001-0001 lock=N pin=0 latch#=11 hpc=04e8 hlc=04e8
          lwt=47bbde4c0[47bbde4c0,47bbde4c0] ltm=47bbde4d0[47bbde4d0,47bbde4d0]
          pwt=47bbde488[47bbde488,47bbde488] ptm=47bbde498[47bbde498,47bbde498]
          ref=47bbde4f0[47bbde4f0,47bbde4f0] lnd=47bbde508[47bbde508,47bbde508]
            LIBRARY OBJECT: object=472fffc08
            type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
            DATA BLOCKS:
            data#     heap  pointer    status pins change whr
                0 47bbde320 472fffd20 I/P/A/-/-    0 NONE   00
          SO: 47aecf9e8, type: 41, owner: 47924e810, flag: INIT/-/-/0x00
          (dummy) nxc=0, nlb=0  
        SO: 47f290540, type: 11, owner: 4781a7dc0, flag: INIT/-/-/0x00
        (broadcast handle) flag: (2) ACTIVE SUBSCRIBER, owner: 4781a7dc0,
                           event: 1132, last message event: 1132,
                           last message waited event: 1132,                        next message: 0(0), messages read: 0
                           channel: (47a2df4f8) system events broadcast channel
                                    scope: 2, event: 1132, last mesage event: 18,
                                    publishers/subscribers: 0/17,
                                    messages published: 1
        SO: 47826b228, type: 3, owner: 4781a7dc0, flag: INIT/-/-/0x00
        (call) sess: cur 47924e810, rec 0, usr 47924e810; depth: 0
        SO: 476c52968, type: 16, owner: 4781a7dc0, flag: INIT/-/-/0x00
        (osp req holder)
    PSEUDO PROCESS for group DEFAULT:
      SO: 47a1eb7d0, type: 2, owner: 0, flag: INIT/-/-/0x00
      (process) Oracle pid=0, calls cur/top: 0/0, flag: (20) PSEUDO
                int error: 0, call error: 0, sess error: 0, txn error 0
      (post info) last post received: 0 0 0
                  last post received-location: No post
                  last process to post me: none
                  last post sent: 0 0 0
                  last post sent-location: No post
                  last process posted by me: none
        (latch info) wait_event=0 bits=0
        Process Group: DEFAULT, pseudo proc: 47a1eb7d0
        O/S info: user: , term: , ospid:  (DEAD)
        OSD pid info: Unix process pid: 0, image: PSEUDO
    Dump of memory from 0x00000004791BF538 to 0x00000004791BF740
    4791BF530                   00000000 00000000          [........]
    4791BF540 00000000 00000000 00000000 00000000  [................]
      Repeat 31 times
    NO DETACHED BRANCHES.
    NO DETACHED NETWORK CONNECTIONS.
    CLEANUP STATE OBJECTS:
    SO: 47f0cd038, type: 1, owner: 0, flag: INIT/-/-/0x00
    (cleanup state object) description: instance enqueue anchor state
    latch: 0x380009890
      SO: 4782cf080, type: 5, owner: 47f0cd038, flag: INIT/-/-/0x00
      (enqueue) TA-00000006-00000001     DID: 0001-000F-0000000B
      lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  res_flag: 0x2
      res: 0x47a28d020, mode: X, lock_flag: 0x0
      own: 0x0, sess: 0x0, prv: 0x47a28d030
    SO: 47f0cd098, type: 1, owner: 0, flag: INIT/-/-/0x00
    (cleanup state object) description: switchable channel handle anch
    latch: 0x38000ac98
      SO: 47f28f868, type: 11, owner: 47f0cd098, flag: INIT/-/-/0x00
      (broadcast handle) flag: (c2) ACTIVE SUBSCRIBER, owner: 0,
                         event: 1, last message event: 1,
                         last message waited event: 1,                      next message: 0(0), messages read: 0
                         channel: (47a2e4190) KPON channel
                                  scope: 2, event: 1, last mesage event: 0,
                                  publishers/subscribers: 0/1,
                                  messages published: 0
    SO: 47f0cd0f8, type: 1, owner: 0, flag: INIT/-/-/0x00
    (cleanup state object) description: TT shared object cleanup SO
    latch: 0x38001c6b8
    SO: 47f0cd158, type: 1, owner: 0, flag: INIT/-/-/0x00
    (cleanup state object) description: SS shared object cleanup SO
    latch: 0x38001cd48
    END OF SYSTEM STATE
    Top 5 Timed Events                                         Avg %Total
    ~~~~~~~~~~~~~~~~~~                                        wait   Call
    Event                                 Waits    Time (s)   (ms)   Time Wait Class
    db file sequential read           2,347,652       9,215      4   64.5   User I/O
    db file scattered read              245,687       4,199     17   29.4   User I/O
    CPU time                                            974           6.8
    db file parallel write               50,082         408      8    2.9 System I/O
    log file parallel write               6,963          52      7    0.4 System I/O
    Time Model Statistics                DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> Total time in database user-calls (DB Time): 14286.4s
    -> Statistics including the word "background" measure background process
       time, and so do not contribute to the DB time statistic
    -> Ordered by % or DB time desc, Statistic name
    Statistic Name                                       Time (s) % of DB Time
    sql execute elapsed time                             14,280.3        100.0
    DB CPU                                                  974.5          6.8
    PL/SQL execution elapsed time                           531.8          3.7
    parse time elapsed                                       30.5           .2
    hard parse elapsed time                                  27.1           .2
    connection management call elapsed time                  14.9           .1
    hard parse (sharing criteria) elapsed time                3.4           .0
    hard parse (bind mismatch) elapsed time                   3.1           .0
    PL/SQL compilation elapsed time                           2.4           .0
    failed parse elapsed time                                 0.0           .0
    repeated bind elapsed time                                0.0           .0
    sequence load elapsed time                                0.0           .0
    DB time                                              14,286.4          N/A
    background elapsed time                                 670.2          N/A
    background cpu time                                     186.1          N/A
    Wait Class                            DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> s  - second
    -> cs - centisecond -     100th of a second
    -> ms - millisecond -    1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc
                                                                      Avg
                                           %Time       Total Wait    wait     Waits
    Wait Class                      Waits  -outs         Time (s)    (ms)      /txn
    User I/O                    2,593,484     .0           13,415       5     150.0
    System I/O                     87,506     .0              515       6       5.1
    Other                             839   11.4                6       7       0.0
    Commit                          3,225     .1                6       2       0.2
    Concurrency                     1,033     .0                5       5       0.1
    Configuration                   2,514   99.4                0       0       0.1
    Network                        47,559     .0                0       0       2.8
    Application                         7     .0                0       0       0.0
    Wait Events                          DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> s  - second
    -> cs - centisecond -     100th of a second
    -> ms - millisecond -    1000th of a second
    -> us - microsecond - 1000000th of a second
    -> ordered by wait time desc, waits desc (idle events last)
                                                                       Avg
                                                 %Time  Total Wait    wait     Waits
    Event                                 Waits  -outs    Time (s)    (ms)      /txn
    db file sequential read           2,347,652     .0       9,215       4     135.8
    db file scattered read              245,687     .0       4,199      17      14.2
    db file parallel write               50,082     .0         408       8       2.9
    log file parallel write               6,963     .0          52       7       0.4
    control file parallel write           6,203     .0          44       7       0.4
    control file sequential read         24,242     .0          11       0       1.4
    log file sync                         3,225     .1           6       2       0.2
    latch free                               84     .0           4      47       0.0
    os thread startup                        25     .0           3     120       0.0
    latch: session allocation                39     .0           1      33       0.0
    db file parallel read                    12     .0           1      92       0.0
    enq: TX - index contention              186     .0           1       3       0.0
    latch: shared pool                       47     .0           1      11       0.0
    LGWR wait for redo copy                 319    3.1           0       1       0.0
    library cache load lock                   2     .0           0     172       0.0
    buffer busy waits                       590     .0           0       0       0.0
    log file switch completion                6     .0           0      29       0.0
    SGA: allocation forcing comp             11   54.5           0      14       0.0
    latch: library cache lock                50     .0           0       3       0.0
    read by other session                    38     .0           0       4       0.0
    direct path read                         42     .0           0       3       0.0
    SQL*Net message to client            44,807     .0           0       0       2.6
    rdbms ipc reply                         207     .0           0       0       0.0
    SQL*Net more data from clien          1,014     .0           0       0       0.1
    latch: cache buffers chains              24     .0           0       1       0.0
    latch: library cache                     29     .0           0       1       0.0
    log file sequential read                  8     .0           0       3       0.0
    direct path write                        50     .0           0       0       0.0
    SQL*Net more data to client             398     .0           0       0       0.0
    latch: object queue header o             12     .0           0       1       0.0
    latch: In memory undo latch              78     .0           0       0       0.0
    undo segment extension                2,507   99.7           0       0       0.1
    latch: cache buffers lru cha              4     .0           0       1       0.0
    log file single write                     8     .0           0       0       0.0
    local write wait                          3     .0           0       1       0.0
    enq: RO - fast object reuse               3     .0           0       1       0.0
    buffer deadlock                          87   92.0           0       0       0.0
    enq: JS - queue lock                      1     .0           0       1       0.0
    cursor: pin S                            70     .0           0       0       0.0
    latch: row cache objects                  2     .0           0       1       0.0
    SQL*Net message to dblink             1,338     .0           0       0       0.1
    latch: checkpoint queue latc              2     .0           0       0       0.0
    reliable message                          3     .0           0       0       0.0
    log buffer space                          1     .0           0       1       0.0
    SQL*Net break/reset to clien              4     .0           0       0       0.0
    SQL*Net more data from dblin              2     .0           0       0       0.0
    SQL*Net message from client          44,949     .0     155,701    3464       2.6
    virtual circuit status                  621  100.0      18,156   29237       0.0
    Streams AQ: qmn slave idle w            664     .0      18,127   27299       0.0
    Streams AQ: qmn coordinator           1,339   50.4      18,099   13517       0.1
    Streams AQ: waiting for time             12  100.0       8,741  728394       0.0
    jobq slave wait                         130  100.0         380    2927       0.0
    PL/SQL lock timer                         1  100.0           1     978       0.0
    SQL*Net message from dblink           1,338     .0           0       0       0.1
    single-task message                       1     .0           0      38       0.0
    class slave wait                         11     .0           0       1       0.0
    SQL ordered by Elapsed Time          DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> Resources reported for PL/SQL code includes the resources used by all SQL
       statements called by the code.
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
      Elapsed      CPU                  Elap per  % Total
      Time (s)   Time (s)  Executions   Exec (s)  DB Time    SQL Id
        13,664        906            0        N/A    95.6 gr2cx6athc5j5
    Module: SQL*Plus
    BEGIN DBMS_OUTPUT.PUT_LINE(equiduct.eod(NULL,NULL)); END;
         8,792        195            0        N/A    61.5 986fzxtzr52u5
    Module: SQL*Plus
    UPDATE TIBEX_ORDER SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"SYS_B_1"
         2,524        368            1     2524.1    17.7 c4uf0x6hdgnwq
    Module: SQL*Plus
    UPDATE TIBEX_FIXSESSIONSTATE SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"
    SYS_B_1"
         1,414        177            1     1414.4     9.9 cbg09ma34kq8w
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_ORDER WHERE INSTRUMENTID=:"SYS_B_0"
           742        137            1      742.2     5.2 g0sg6v994wssq
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_FIXSESSIONSTATE WHERE INSTRUMENTID=:"SYS_B_0"
           274         11            1      274.2     1.9 6mcpb06rctk0x
    Module: DBMS_SCHEDULER
    call dbms_space.auto_space_advisor_job_proc ( )
           264          8           27        9.8     1.8 8szmwam7fysa3
    Module: DBMS_SCHEDULER
    insert into wri$_adv_objspace_trend_data select timepoint, space_usage, space_a
    lloc, quality from table(dbms_space.object_growth_trend(:1, :2, :3, :4, NULL, N
    ULL, NULL, 'FALSE', :5, 'FALSE'))
            99          1            1       99.4     0.7 1z0x41f66nvjr
    Module: SQL*Plus
    UPDATE TIBEX_INSTRUMENTADMIN SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"
    SYS_B_1"
            21         10            1       21.5     0.2 bbc1ck8594kvj
    Module: SQL*Plus
    UPDATE TIBEX_INSTRUMENTDAILYHIST SET ADJOPEN=NVL(ADJOPEN,OPEN), ADJHIGH=NVL(ADJH
    IGH,HIGH), ADJLOW=NVL(ADJLOW,LOW), ADJMID=NVL(ADJMID,MID), ADJCLOSE=NVL(ADJCLOSE
    ,CLOSE), ADJVOLUME=NVL(ADJVOLUME,VOLUME), ADJCLOSINGBID=NVL(ADJCLOSINGBID,CLOSIN
    GBID), ADJCLOSINGOFFER=NVL(ADJCLOSINGOFFER,CLOSINGOFFER)
            12          0            1       12.5     0.1 6xm9p9uy5kaap
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_INSTRUMENTSTATE WHERE INSTRUMENTID=:"SYS_B_0"
    SQL ordered by CPU Time              DB/Inst: SURV2/SURV2  Snaps: 19172-19178
    -> Resources reported for PL/SQL code includes the resources used by all SQL
       statements called by the code.
    -> % Total DB Time is the Elapsed Time of the SQL statement divided
       into the Total Database Time multiplied by 100
        CPU      Elapsed                  CPU per  % Total
      Time (s)   Time (s)  Executions     Exec (s) DB Time    SQL Id
           906     13,664            0         N/A    95.6 gr2cx6athc5j5
    Module: SQL*Plus
    BEGIN DBMS_OUTPUT.PUT_LINE(equiduct.eod(NULL,NULL)); END;
           368      2,524            1      367.51    17.7 c4uf0x6hdgnwq
    Module: SQL*Plus
    UPDATE TIBEX_FIXSESSIONSTATE SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"
    SYS_B_1"
           195      8,792            0         N/A    61.5 986fzxtzr52u5
    Module: SQL*Plus
    UPDATE TIBEX_ORDER SET INSTRUMENTID=:"SYS_B_0" WHERE INSTRUMENTID=:"SYS_B_1"
           177      1,414            1      176.93     9.9 cbg09ma34kq8w
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_ORDER WHERE INSTRUMENTID=:"SYS_B_0"
           137        742            1      137.38     5.2 g0sg6v994wssq
    Module: SQL*Plus
    SELECT count(*) FROM TIBEX_FIXSESSIONSTATE WHERE INSTRUMENTID=:"SYS_B_0"
            11        274            1       10.82     1.9 6mcpb06rctk0x
    Module: DBMS_SCHEDULER
    call dbms_space.auto_space_advisor_job_proc ( )
            10         21            1        9.65     0.2 bbc1ck8594kvjEdited by: NM on 10-Sep-2010 07:39

  • Mat doc not getting updated in AFRU table

    Hi All,
      While doing the confirmation cancellation for the rework order the referance material document is not getting updated in the AFRU table.
      The referance operation set is used for the rework production order and there are no component assigned ,the components to be issued are  entered at the time of confirmation.
    The material document is getting updated in case of confirmation in AFRU table but the same is not getting updated in WABLNR field in case of cancellation of confirmation.
    When I checked MSEG all the material documents are observed with referance to the order number but the same are not displayed in AUFM and AFRU table.
    This behaviour is not obeserved in case of normal production orders. what can be the reason behind the same?
    Regards
    Ankush

    Dear Ankush
    please see FAQ note 540392 question 11.
    11.        Question:
    Despite successful goods movements, the material document is not
    updated in field AFRU-WABLNR. Where do I find the document number?
    Answer:
    As of Release 3.1H, the system provides the reference from
    confirmation to material document via table AFWI. The system still
    only uses AFRU-WABLNR in the case of header confirmations or
    confirmations for an individual operation. With milestone
    confirmations or with separate goods movements, in other words goods
    movements that are posted in the update program or via requests
    (BAPIs, collective entry, mass processing, BDC/PDC), table AFWI is
    always supplied due to technical reasons.
    BR Sabine

Maybe you are looking for

  • Unable to delete delivery schedule lines in MD04

    Hello All, In an intercompany process, plant A (receiving plant) placed an order through Schedule Agreement on plant B (sending plant). Accordingly schedule lines are released. Plant A received material but schedule lines are still reflecting in plan

  • IPod Shuffle Service Request Error???!!!

    Hey all, I'm sending my iPod Shuffle back to apple because it's no longer recognized by iTunes of my PC and it no longer charges either. So I entered all my info on the onlince service request page, credit card, shipping address, etc. Then after I hi

  • 2 different relations between MX_PERSON and MX_ROLE

    Hi all, For MX_PERSON I created a new attribute ZMXREF_HCM_ROLE. This attribute is a reference to MX_ROLE. In this attribute I store all the roles that are assigned via the HCM-system. I don't want the user to change these settings, but a user must b

  • Can't print to HP LaserJet Prof. P1102w_1 wireless printer with my iPad.

    I cannot print to HP LaserJet Prof. P1102w_1 wireless printer with my iPad although it appears that this is a compatible printer.  My computer prints to this printer.  All other components of my wireless options and router are working.

  • Dataguard switchover & failover testing

    i want to build new physical & logical dbs just for testing & learning, as per menalink notes 736863.1 & 748595.1 wondering that configuration will let me test switchover & failover testing?