HELP!!! the session hang with a merge into sql statement

This problem is due to merge into a bug caused it??
i have a product run on 10.2.0.4 . OS is aix 5.3 .
today i found the product running over 24,000 sec and the current sql have run 23,734.
Anomaly the sql Should be a quick end but run so long time.
the awrsql report sql plan is
Execution Plan
Id Operation Name Rows Bytes Cost (%CPU) Time
0 MERGE STATEMENT 4 (100)
1 MERGE TP_B_RB013_GL_MID
2 VIEW
3 NESTED LOOPS 1 4048 4 (50) 00:00:01
4 TABLE ACCESS BY INDEX ROWID TP_B_RB013_GL_MID 1 3549 0 (0)
5 INDEX RANGE SCAN IDX_GL_RB013_MID 1 0 (0)
6 VIEW PUSHED PREDICATE 1 499 4 (50) 00:00:01
7 WINDOW SORT PUSHED RANK 1 586 4 (50) 00:00:01
8 HASH JOIN 1 586 3 (34) 00:00:01
9 TABLE ACCESS BY INDEX ROWID GL_HIST_RB013 1 124 0 (0)
10 INDEX SKIP SCAN IDX_GL_RB013 1 0 (0)
11 TABLE ACCESS FULL GL_EVENT 1 462 2 (0) 00:00:01
sql_fulltext
MERGE INTO TP_B_RB013_GL_MID TP
USING (SELECT TRAN_NO,
B.EVENT_DEESC,
ROW_NUMBER () OVER (PARTITION BY TRAN_NO ORDER BY B.EVENT_DESC) I
FROM GL_HIST_RB013 A, GL_EVENT B
WHERE EVENT_TYPE IS NOT NULL AND A.EVENT_TYPE = B.EVENT_ID AND B.SDATE = :B1
) RES
ON ( RES.TRAN_NO = TP.BATCH_NO AND RES.I = 1 AND TP.REPORT_DATE = :B1 )
WHEN MATCHED THEN
UPDATE SET TP.EVENT_DESC = RES.EVENT_DESC
Focus is the table "GL_EVENT" have 0 row,the sql should do nothing.
This problem is due to merge into a bug caused it??
last is awrsqlrpt Please note cputime and buffer gets
WORKLOAD REPOSITORY SQL Report
Snapshot Period Summary
DB Name DB Id Instance Inst Num Release RAC Host
FTLPRD 3272430330 FTLPRD 1 10.2.0.4.0 NO bj1finteldb0
Snap Id Snap Time Sessions Curs/Sess
Begin Snap: 5022 26-11?-11 21:00:35 127 12.1
End Snap: 5030 27-11?-11 05:00:40 127 14.0
Elapsed: 480.09 (mins)
DB Time: 626.55 (mins)
SQL Summary DB/Inst: FTLPRD/FTLPRD Snaps: 5022-5030
Elapsed
SQL Id Time (ms)
a4j4qaqkvxr08 ##########
MERGE INTO TP_B_RB013_GL_MID TP USING (SELECT TRAN_NO, B.EVENT_DESC, ROW_NUMBER
() OVER (PARTITION BY TRAN_NO ORDER BY B.EVENT_DESC) I FROM GL_HIST_RB013 A, GL_
EVENT B WHERE EVENT_TYPE IS NOT NULL AND A.EVENT_TYPE = B.EVENT_ID AND B.SDATE =
:B1 ) RES ON ( RES.TRAN_NO = TP.BATCH_NO AND RES.I = 1 AND TP.REPORT_DATE = :B1
SQL ID: a4j4qaqkvxr08 DB/Inst: FTLPRD/FTLPRD Snaps: 5022-5030
-> 1st Capture and Last Capture Snap IDs
refer to Snapshot IDs witin the snapshot range
-> MERGE INTO TP_B_RB013_GL_MID TP USING (SELECT TRAN_NO, B.EVENT_DESC, R...
Plan Hash Total Elapsed 1st Capture Last Capture
# Value Time(ms) Executions Snap ID Snap ID
1 3274057091 23,733,870 0 5024 5030
Plan 1(PHV: 3274057091)
Plan Statistics DB/Inst: FTLPRD/FTLPRD Snaps: 5022-5030
-> % Total DB Time is the Elapsed Time of the SQL statement divided
into the Total Database Time multiplied by 100
Stat Name Statement Per Execution % Snap
Elapsed Time (ms) ########## N/A 63.1
CPU Time (ms) 23,734 N/A 94.7
Executions 0 N/A N/A
Buffer Gets 371,326,923 N/A 84.8
Disk Reads 16,740 N/A 0.2
Parse Calls 1 N/A 0.0
Rows 0 N/A N/A
User I/O Wait Time (ms) 145,938 N/A N/A
Cluster Wait Time (ms) 0 N/A N/A
Application Wait Time (ms) 0 N/A N/A
Concurrency Wait Time (ms) 2,348 N/A N/A
Invalidations 0 N/A N/A
Version Count 7 N/A N/A
Sharable Mem(KB) 435 N/A N/A
Execution Plan
Id Operation Name Rows Bytes Cost (%CPU) Time
0 MERGE STATEMENT 4 (100)
1 MERGE TP_B_RB013_GL_MID
2 VIEW
3 NESTED LOOPS 1 4048 4 (50) 00:00:01
4 TABLE ACCESS BY INDEX ROWID TP_B_RB013_GL_MID 1 3549 0 (0)
5 INDEX RANGE SCAN IDX_GL_RB013_MID 1 0 (0)
6 VIEW PUSHED PREDICATE 1 499 4 (50) 00:00:01
7 WINDOW SORT PUSHED RANK 1 586 4 (50) 00:00:01
8 HASH JOIN 1 586 3 (34) 00:00:01
9 TABLE ACCESS BY INDEX ROWID GL_HIST_RB013 1 124 0 (0)
10 INDEX SKIP SCAN IDX_GL_RB013 1 0 (0)
11 TABLE ACCESS FULL GL_EVENT 1 462 2 (0) 00:00:01
Full SQL Text
SQL ID SQL Text
a4j4qaqkvxr0 MERGE INTO TP_B_RB013_GL_MID TP USING (SELECT TRAN_NO, B.EVENT_DE
ESC, ROW_NUMBER () OVER (PARTITION BY TRAN_NO ORDER BY B.EVENT_DE
SC) I FROM GL_HIST_RB013 A, GL_EVENT B WHERE EVENT_TYPE IS NOT NU
LL AND A.EVENT_TYPE = B.EVENT_ID AND B.SDATE = :B1 ) RES ON ( RES
.TRAN_NO = TP.BATCH_NO AND RES.I = 1 AND TP.REPORT_DATE = :B1 ) W
HEN MATCHED THEN UPDATE SET TP.EVENT_DESC = RES.EVENT_DESC

Pl do not spam the forums with duplicate posts - HELP !!!  session pending or suspend beacause a merginto sql

Similar Messages

  • Did ios7.4 help the ipad sync with itunes

    did the update of ios 7.4 help the ipad sync with itunes - songs not playing

    Try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings will be reset.

  • My Mac G-4 OS X will not image an icon of the zip disk with I inserted into my computer's built-in Zip Drive, therefore I can not remove the zip disk from my computer.  What can I do?

    My Mac G-4 OS X will not image an icon of the zip disk with I inserted into my computer's built-in Zip Drive, therefore I can not remove the zip disk from my computer.  What can I do?

    Thanks Old Comm Guy, BD Aquam and Texas Mac Man for youradvice and reply to my question
    and problem with my Zip Drive.  However:
        1.  Depressing mouse buttonon start up did not eject the zip disk.
        2.  To examine front of zipdrive, I had to remove many screws and several plastic case
             coverings.  Upon doing thatI discovered that, unfortunately, there is no whole in front
              of mybuilt-in zip hardware drive for me to insert a paper clip to manually eject zipdisk.
          3.  I went to the Utilities folder in myMac OS X Application folder, but I could not find
               theiomega zip drive in there.
    Also, I did go into my "9" System folder and thento the Extensions folder within it and did find an icon of an
    Iomega Driver. When double clicking on it a window came upstating I was opening the application
    "ColorSync Extension" for thefirst time, and asking if I was sure I wanted to open this application.
    Uponclicking open nothing happened - nothing opened.
    I also went into the "System X" folder>Libraryfolder>Extension folder>IomegaSAM.ket icon and double
    clicked on it and asmall window opened stating "Compiling file List", however nothingopened it just
    continued to compile, so I closed it.
    Within my Mac OS X HD>  Applications>Iomega folder>Iomega Tools.app a smallwindow opened up
    with several options (Erase, Protect, Disk Info and DriveInfo). Clicking on the Drive Info a message says:
    "No Iomega Drives or noIomega Driver found.  Therefore, Ihave gone to Mac, Iomega and other websites
    trying to find a Driver for thebuilt-in Zip Drive in my Mac G-4 OS X 10.4.11, but have not really found anythat work.
    CAN ANYONE TELL ME IF THERE IS A WEBSITE WHERE I CANDOWNLOAD A NEW DRIVER FOR MY ZIP DRIVE?
    Thanks,     Peterfromcrystallake

  • I am going to japan with an Ipod nano and Iphone 4. Do I need a converter? or does the one the iphone comes with that plugs into the wall enough?

    I am going to japan with an Ipod nano and Iphone 4. Do I need a converter? or does the one the iphone comes with that plugs into the wall enough? I know i wont need an adapter because it will fit into the wall outlet, but voltage wise, will i need a converter? Japan runs on 100 V. I am so confused on all of this...

    As long as the adapter is 2 pronged, then you should be able to use it without any problems.
    B-rock

  • The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Hello All,
    I am getting below error can you please help me
    Error:-
    The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Perhaps this thread will help you out
    http://stackoverflow.com/questions/11453066/error-the-transaction-associated-with-the-current-connection-has-completed-but
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Need help importing session from Korg Triton Extreme into logic

    I am trying to import a full midi session that was sequenced on my Triton into Logic Pro9.  The problem I'm having is that when I record in, all 16 midi channels are sending to one Logic midi track.  Is there a way to import the full midi session into logic so I can edit the session in logic on the 16 individual tracks? Any help would be great!

    I think the triton can save standard midi files. Importing that file into logic would be the best and cleanest solution.
    Cheers,
    Jazz

  • Sessions hangs with library cache lock

    Der all,
    11.1.0.7 rac on solaris 10
    Our workflow session yesterday hanged on a particular step the session was waiting on a library cache lock (by using query select event,p1,p2 from v$session where sid=<my_sid>;)
    when I checked the blocking session , using the note 122793.1 and http://oracle-study-notes.blogspot.com/2009/05/resolving-library-cache-lock-issue.html and http://oracle-study-notes.blogspot.com/2009/05/find-session-holding-library-cache-lock.html .
    I found that
    SQL> SELECT SID,USERNAME,TERMINAL,PROGRAM FROM V$SESSION
      2   WHERE SADDR in
      3    (SELECT KGLLKSES FROM X$KGLLK LOCK_A
      4     WHERE KGLLKREQ > 0
      5       AND EXISTS (SELECT LOCK_B.KGLLKHDL FROM X$KGLLK LOCK_B
                     WHERE KGLLKSES = '&SADDR_OF_BLKING_SESS'
      6    7                   AND LOCK_A.KGLLKHDL = LOCK_B.KGLLKHDL
      8                   AND KGLLKREQ = 0)
      9    );
    Enter value for saddr_of_blking_sess: 0000000770E494E0
    old   6:                  WHERE KGLLKSES = '&SADDR_OF_BLKING_SESS'
    new   6:                  WHERE KGLLKSES = '0000000770E494E0'
      SID USERNAME        TERMINAL   PROGRAM
      817 SYS             UNKNOWN    oracle@tabsdb07
                                      (J002)
      828 SYS             UNKNOWN    oracle@tabsdb07
                                      (J001)after killing the session, the library cache locks still remained.when I ran trace on the session
    select /*+ all_rows ordered */ A.rowid, :1, :2, :3
    from
    "DBMRPT"."DBM_BIAUTO_SUSP" A , "DBMRPT"."DBM_CDR_FILE_HEAD" B where(
      "A"."CDR_TYPE" is not null and "A"."FILE_ID" is not null) and(
      "B"."CDR_TYPE" (+)= "A"."CDR_TYPE" and "B"."FILE_ID" (+)= "A"."FILE_ID")
      and( "B"."CDR_TYPE" is null or "B"."FILE_ID" is null)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.01          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.01       0.01          0          0          0           0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: SYS   (recursive depth: 3)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      row cache lock                                  5        0.00          0.00
      db file sequential read                   295932636        0.07       5066.63
      gc cr grant 2-way                          727813        0.02        233.95
      latch: gc element                              80        0.00          0.00
      latch: gcs resource hash                      870        0.00          0.00
      latch free                                      2        0.00          0.00
      gc remaster                                     9        2.00         12.91
      gcs drm freeze in enter server mode             9        0.54          2.08
      latch: object queue header operation           66        0.00          0.05
      latch: cache buffers chains                    15        0.03          0.20
      resmgr:internal state change                   63        0.10          5.30
      latch: cache buffers lru chain               1260        0.00          0.01
    ********************************************************************************Please guide
    Kai
    all this time sql_id for the session remanined in the sql :
    ALTER TABLE DBMRPT.DBM_BIAUTO_SUSP ENABLE CONSTRAINT DBS1_DCFH_FK ..

    hi..
    Go through [http://orainternals.wordpress.com/2009/06/02/library-cache-lock-and-library-cache-pin-waits/]
    Anand

  • How do you run the session programatically with out going to tr.codes?

    when we go with BDC sessions what code should we write, to run session programatically,
    i.e manually?

    If I got you right, you do not want to go to SM35 and run the session. Instead you want to run from program. If this is the case then we have understand the way Sessions work.
    Session method is intented to have a two step execution, where the creation of session is the first phase and execution of session is the second phase. This is mainly to have a centralized control over the Postings made in the SAP system.
    Hence, if session method is used, then it is always 2 step. We cannot programatically run the session. Instead u can use CALL TRANSACTION
    Naveen

  • How to delete the Table Contents before inserting records into SQL table ?

    Hello Experts,
            I have a scenario where in I have to Pick up some records from SAP RFC & insert into SQL table.
            i know how to do this scenario but the proble with this is before inserting we first have to ZAP the SQL table & insert a new records. One more twist is The Triggering is happening from SAP side with Sender RFC. If this would have been from SQL Side i could have written a Stored Procedure/ Trigger & could have called this before the SENDER JDBC communciation channel picks up the Triggering event from SQL side.
    So how to do this scenarioin XI, First deleting all the Records of SQL table & then inserting the new reocrds. without using the BPM.
    Regards,
    Umesh

    hi umesh,
    you can achieve this by writing SQL query in message mapping level..
    refer this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
    regards.

  • Issue with GP getting into Erroneous State

    Hi Experts
    I have an issue with GP Process getting into Erroneous State. We have a series of steps in the Guided Procedure Process. The process instance passes a few of the initial steps in the procedure and getting struck at a particular step and leading the process to erroneous state.
    I am just trying to find out what would be the possible reasons for a process to get into erroneous state.
    Kindly get us all possible suggestions to find the root cause for this issue.
    Appreciate your help in advance.
    Kind Regards
    Ramamoorthy D

    Hi Louis Hunag
    Thanks a ton for responding to my query.
    It is a User Interface Callable Object. Can you please elaborate on this in detailed manner. I have assigned the right user account to manage the execution role. Below is what I have done.
    In the GP Process, there are 4 default roles 1. Owner, 2. Default Processor, 3. Overseer 4. Administrator. All these were mapped with one ID from UME. What is the problem in this? Kindly let me know.
    Tx.
    Best Regards
    Ramamoorthy D

  • CONM7007I: Mapping the following SQLException, with ErrorCode -901 and SQLS

    When I execute a Query it throws
    CONM7007I: Mapping the following SQLException, with ErrorCode -901 and SQLState 58004, to a StaleConnectionException: java.sql.SQLException: [SQL0901] Error del sistema SQL.
    I am using iSeries DB2 and Websphere V5.
    Thanks for your help.

    Retrying solved my problem:
    StaleConnectionException
    This exception (com.ibm.websphere.ce.cm.StaleConnectionException) indicates that the
    connection currently being held is no longer valid. This can occur for numerous reasons,
    including the following:
    The application tries to get a connection and fails, as when the database is not started.
    A connection is no longer usable due to a database failure. When an application tries to
    use a connection it has previously obtained, the connection is no longer valid. In this
    case, all connections currently in use by an application could get this error when they try
    to use the connection.
    The application using the connection has already called close() and then tries to use the
    connection again.
    The connection has been orphaned because the application had not used it in at most two
    times the orphan timeout; then the application tries to use the orphaned connection.
    The application tries to use a JDBC resource, such as a statement, obtained on a
    now-stale connection.
    Code that implements retries in case of StaleConnectionException...
    boolean retry = false;
    int numOfRetries = 0;
    java.sql.Connection conn = null;
    java.sql.Statement stmt = null;
    do {
        try {
            //    assumes a datasource already obtained from JNDI
            conn = ds.getConnection();
            conn.setAutoCommit(true);
            stmt = conn.createStatement();
            stmt.execute("INSERT INTO EMPLOYEES VALUES
                    (0101, 'Bill', 'R', 'Smith')");
        } catch(com.ibm.websphere.ce.cm.StaleConnectionException
                sce) {
            if(numOfRetries < 2) {   
                retry = true;
                numOfRetries++;
            } else {
                retry = false;
                //    throw error indicating a connection
                //    cannot be obtained
        } catch (java.sql.SQLException sqle) {
            //    handle other database problem
        } finally {
            //    always cleanup JDBC resources
            try {
                if(stmt != null) stmt.close();
            } catch (java.sql.SQLException sqle) {
                //    usually can be ignored
            try {
                if(conn != null) conn.close();
            } catch (java.sql.SQLException sqle) {
                //    usually can be ignored
    } while (retry);

  • Pleasse help me with this error in SQL statement

    Please tell me the error in this query:
    the Error given is
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement
    given :
    Databse is MS Access
    In the databse :
    account - text
    number - text
    date - date/time
    vendor - text
    Connection connection = t.getConnection();
    /* t - some object containing a connection*/
    Statement stmt = connection.createStatement();
    stmt.executeUpdate("INSERT INTO Bills (account, number, date, vendor)
    VALUES ('vai', '23', 10/12/2006, 'jaadya')");

    I would imagine the problem is with the date. Different DBs have different date formats. To avoid that problem, use a PreparedStatement.
    java.sql.Date date = ...;
    PreparedStatement ps = con.prepareStatement("INSERT INTO Bills (account, number, date, vendor) VALUES (?, ?, ?, ?)");
    ps.setString(1, "vai");
    ps.setString(2, "23);
    ps.setDate(3, date);
    ps.setString(4, "jaadya");
    ps.executeUpdate();This saves you from having to deal with vendors' various date formats, keeps you from having to escape special characters in strings, and prevents SQL injection.

  • Help With SUBSTR in dynamic SQL statement

    Following is the dynamic SQL statement.
    EXECUTE IMMEDIATE 'UPDATE table_name pml
    SET pml.'|| con_fields.field ||' = SUBSTR(pml.'||con_fields.field||' ||'' ''||
    (SELECT pml1.'||con_fields.field||'
    FROM table_name pml1
    WHERE pml1.grp_id = '||los_concats.grp_id ||'
    AND pml1.row_id = '||los_concats.row_id||'
    AND pml1.loser_flg = ''Y''),1, '||con_fields.max_length||')
    WHERE pml.grp_id = '||los_concats.grp_id ||'
    AND pml.loser_flg IS NULL ';
    what it does is that it updates a particular field. This field is concatenated by a field of a similar record.
    My problem is with SUBSTR function. Since I am concatenating fields I do not want the field to be updated greater than max_length on that field, the reason why I use SUBSTR. the select query inside SUBSTR works alright with one of the AND condition in a WHERE clause not present. When I add that additional condition it gives me this error.
    ORA-00907: missing right parenthesis.
    Is there any way to get around this problem. Does SQL has other than SUBSTR function which can limit the character length.
    Appreciate it.

    The other alternative I thought about was to do this first
    EXECUTE IMMEDIATE 'SELECT pml.'||con_fields.field||'
    FROM table_name pml
    WHERE pml.grp_id = '||los_concats.grp_id||'
    AND pml.row_id = '||los_concats.row_id||'
    AND pml.loser_flg = ''Y''
    ' INTO v_concat_field;
    write into the variable v_concat_field and then use it into the previous script.
    But on this I get SQL Command not properly terminated, I don't get it Why?
    Donald I tried with your suggested script. It works fine with one of the conditions eliminated. I don't understand what the error trying to say?
    Thanks

  • Getting session hang When calling Function from SQL query

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

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

  • How can i put the value of a variable in an SQL statement?

    Hi,
    Can someone please tell me how i can use a variable as part of an sql statement.
    So instead of "SELECT * FROM tablename WHERE username='john'"
    I can put in "SELECT * FROM tablename WHERE username.text"

    What would happen if someone entered "(delete *
    from tablename)" into the username field?The SELECT would fail and the DELETE
    would never run.
    Or am I missing something?Ok, that wasn't valid SQL, so lets change it into valid SQL. What would this do
    "SELECT * FROM tablename WHERE username=" + user
    where user is "blah;DROP TABLE tablename;"
    The SQL would become
    SELECT * FROM tablename WHERE username=blah;DROP TABLE tablename;
    And that would select, and then drop the table
    Kaj
    Message was edited by:
    kajbj

Maybe you are looking for

  • BAPI - EXCISE INVOICE AT DEPOT 'J1IG'

    Hello gurus, I want to know is their any BAPI available for capturing Excise invoice at Depot (T-code - J1IG). Thanx. Deepak Ku.

  • Replacing the primary site server, SCCM 2012 R2

    Hi, Setup is currently SCCM 2012 R2 with the primary site server on Windows 2008 R2 on a Hyper-V VM with a separate physical SQL server on 2008 R2 (Windows and SQL). I'm not making any changes to the SQL server at this stage. I want to completely rep

  • Help updating jTable (model?)

    I've got a jTable, which stores information that I retrieve from game servers (player's name, frag count, and time connected to the server). I'll admit first off that I'm very, very new to Swing and still new to Java as a whole. I've searched the for

  • Coldfusion function hints in .html page

    I'm building a coldfusion site that will be using .html as the file extension instead of .cfm. I can easily set the server to parse the page correctly, however I am having a problem getting the code hinting to work in Dreamweaver. I did figure out ho

  • Why is Bridge creating XMP files in CS6?

    I'm using the CS6 beta on a new set of photos.  All I've done so far is batch rename all the files (all raw, all CR2) and edited the IPTC metadata - to add my name, the project name, etc.  Now I've got a side-car file for every photo.  CS5 just inclu