SQL to show blocking locks

Can someone give me the SQL statement to
show if there are any blocking database locks and if so - which user is locking the Database?
Thanks in Advance

Hi
This is your exact solution:
Select a.username, a.sid, a.serial#, b.id1, c.sql_text
From v$session a, v$lock b, v$sqltext c
Where b.id1 in( Select distinct e.id1
from v$session d , v$lock e
where d.lockwait = e.kaddr ) and
a.sid = b.sid and
c.hash_value = a.sql_hash_value and
b.request =0;
Thanks
Sarju
Oracle DBA
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by I'm clueless:
Can someone give me the SQL statement to
show if there are any blocking database locks and if so - which user is locking the Database?
Thanks in Advance<HR></BLOCKQUOTE>
null

Similar Messages

  • SQL Timeouts and Blocking Locks

    SQL Timeouts and Blocking Locks
    Just wanted to check in and see if anyone here has feedback on application settings, ColdFusion settings, JBOSS settings or other settings that could help to limit or remove SQL Timeouts and blocking locks on SID's.
    We're using MS SQL 2000 with JBOSS and IIS5.
    We've been seeing the following error in our logs that starts blocking locks in SQL:
    java.sql.SQLException: [newScale] [SQLServer JDBC Drive] [SQLServer] Lock request time out period exceeded.
    Once this happens, we're hosed until we remove the blocking SID in SQL.  These are the connections to the application.
    Any feedback would be great.  Thanks!

    Hi
    This is your exact solution:
    Select a.username, a.sid, a.serial#, b.id1, c.sql_text
    From v$session a, v$lock b, v$sqltext c
    Where b.id1 in( Select distinct e.id1
    from v$session d , v$lock e
    where d.lockwait = e.kaddr ) and
    a.sid = b.sid and
    c.hash_value = a.sql_hash_value and
    b.request =0;
    Thanks
    Sarju
    Oracle DBA
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by I'm clueless:
    Can someone give me the SQL statement to
    show if there are any blocking database locks and if so - which user is locking the Database?
    Thanks in Advance<HR></BLOCKQUOTE>
    null

  • Using OleDbDataAdapter Update with InsertCommands and getting blocking locks on Oracle table

    The following code snippet shows the use of OleDbDataAdapter with InsertCommands.  This code is producing many inserts on the Oracle table and is now suffering from contention... all on the same table.  How does the OleDbDataAdapter produce
    inserts from a dataset... what characteristics do these inserts inherent in terms of batch behavior... or do they naturally contend for the same resource. 
    oc.Open();
    for (int i = 0; i < xImageId.Count; i++)
    // Create the oracle adapter using a SQL which will not return any actual rows just the structure
    OleDbDataAdapter da =
       new OleDbDataAdapter("SELECT BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, " +
       "DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE FROM sysadm.PS_RI_INV_PDF_MERG WHERE 1 = 2", oc);
    // Create a data set
    DataSet ds = new DataSet("documents");
    da.Fill(ds, "documents");
    // Loop through invoices and write to oracle
    string[] sInvoices = invoiceNumber.Split(',');
    foreach (string sInvoice in sInvoices)
        // Create a data set row
        DataRow dr = ds.Tables["documents"].NewRow();
        ... map the data
        // Populate the dataset
        ds.Tables["documents"].Rows.Add(dr);
    // Create the insert command
    string insertCommandText =
        "INSERT /*+ append */ INTO PS_table " +
        "(SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, " +
        "EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) " +
        "VALUES (INV.nextval, :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME,  " +
        ":BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)";
    // Add the insert command to the data adapter
    da.InsertCommand = new OleDbCommand(insertCommandText);
    da.InsertCommand.Connection = oc;
    // Add the params to the insert
    da.InsertCommand.Parameters.Add(":BUSINESS_UNIT", OleDbType.VarChar, 5, "BUSINESS_UNIT");
    da.InsertCommand.Parameters.Add(":INVOICE", OleDbType.VarChar, 22, "INVOICE");
    da.InsertCommand.Parameters.Add(":ASSIGNMENT_ID", OleDbType.VarChar, 15, "ASSIGNMENT_ID");
    da.InsertCommand.Parameters.Add(":END_DT", OleDbType.Date, 0, "END_DT");
    da.InsertCommand.Parameters.Add(":RI_TIMECARD_ID", OleDbType.VarChar, 10, "RI_TIMECARD_ID");
    da.InsertCommand.Parameters.Add(":IMAGE_ID", OleDbType.VarChar, 8, "IMAGE_ID");
    da.InsertCommand.Parameters.Add(":FILENAME", OleDbType.VarChar, 80, "FILENAME");
    da.InsertCommand.Parameters.Add(":BARCODE_LABEL_ID", OleDbType.VarChar, 18, "BARCODE_LABEL_ID");
    da.InsertCommand.Parameters.Add(":DIRECT_INVOICING", OleDbType.VarChar, 1, "DIRECT_INVOICING");
    da.InsertCommand.Parameters.Add(":EXCLUDE_FLG", OleDbType.VarChar, 1, "EXCLUDE_FLG");
    da.InsertCommand.Parameters.Add(":DTTM_CREATED", OleDbType.Date, 0, "DTTM_CREATED");
    da.InsertCommand.Parameters.Add(":DTTM_MODIFIED", OleDbType.Date, 0, "DTTM_MODIFIED");
    da.InsertCommand.Parameters.Add(":IMAGE_DATA", OleDbType.Binary, System.Convert.ToInt32(filedata.Length), "IMAGE_DATA");
    da.InsertCommand.Parameters.Add(":PROCESS_INSTANCE", OleDbType.VarChar, 10, "PROCESS_INSTANCE");
    // Update the table
    da.Update(ds, "documents");

    Here is what Oracle is showing as blocking locks and the SQL that has been identified with each of the SIDS.  Not sure why there is contention.  There are no triggers or joined tables in this piece of code.
    Here is the SQL all of the SIDs below are running:
    INSERT INTO sysadm.PS_RI_INV_PDF_MERG (SEQ_NBR, BUSINESS_UNIT, INVOICE, ASSIGNMENT_ID, END_DT, RI_TIMECARD_ID, IMAGE_ID, FILENAME, BARCODE_LABEL_ID, DIRECT_INVOICING, EXCLUDE_FLG, DTTM_CREATED, DTTM_MODIFIED, IMAGE_DATA, PROCESS_INSTANCE) VALUES (SYSADM.INV_PDF_MERG.nextval,
    :BUSINESS_UNIT, :INVOICE, :ASSIGNMENT_ID, :END_DT, :RI_TIMECARD_ID, :IMAGE_ID, :FILENAME, :BARCODE_LABEL_ID, :DIRECT_INVOICING, :EXCLUDE_FLG, :DTTM_CREATED, :DTTM_MODIFIED, :IMAGE_DATA, :PROCESS_INSTANCE)
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1150 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1156 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX3
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 6 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 1726 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX2
    SID 1452 (BTSUSER,BIZTPRDI,BTSNTSvc64.exe) in instance FSLX1 is blocking SID 2016 (BTSUSER,biztprdi,BTSNTSvc64.exe) in instance FSLX2

  • Multiple blocking locks on same object

    we have a database that is providing a great deal of application 'freezing' due to lock problems that were not experienced before moving to a new 10g database environment.
    one of the items i believe to be of interest is the fact that when this 'freezing' occurs then a look at the database locks reveals that more than one TX exclusive blocking lock is held on the same database object without any waits showing.
    my understanding is that this should not be the case? that only one user should possess the exclusive transaction level lock and that the other user should only have an outstanding request for this same level lock?
    any information you can provide would be most appreciated.
    thanks in advance.

    You would need to find out the sql the application is executing when those locks freeze like that. From there determine if there is a logical syntax issue or get the explain plan to ensure it isn't for example an update statement on a massive table that has improper indexing.
    Also, do you see other sessions blocking other sessions as orafad suggested? In this scenario my original explanation is different. If the locks are all chained on waiting on another session, that means the first session that is blocking is updating the same data that the waiters are wanting.
    In my opinion you need to find out the exact SQL causing these locks to ensure it is an issue with one of your applications. Determining the performance of that query is a must.
    The only weird thing is you say there is no waits taking place....did you look in v$session_wait?
    Lee

  • Identifying the blocking Lock

    In one of our production DB we are experiencing huge bottlenecks due to locks. I am using OEM lock monitor to detect and identify the problematic lock. I am trying this out randomly as OEM list all the blocking locks. . Most times I am not able to analyse the problematic locks because of support calls from production. I just have time to kill the sessions and get the platform ready. Is there a script that I can use to identify the session that is blocking other sessions ? How do we do analysis during situations like this? At least I am interested in finding the root cause of the problem so we request the developers to fix it.
    - BMP

    &1 --><sid of any session>.if the sid provided is waiting for other sessions, it will show you the blocking session id.
    Try this one (Not tested):
    SELECT bs.username "Blocking User", bs.username "DB User",
    ws.username "Waiting User", bs.SID "SID", ws.SID "WSID",
    bs.sql_address "address", bs.sql_hash_value "Sql hash",
    bs.program "Blocking App", ws.program "Waiting App",
    bs.machine "Blocking Machine", ws.machine "Waiting Machine",
    bs.osuser "Blocking OS User", ws.osuser "Waiting OS User",
    bs.serial# "Serial#",
    DECODE (wk.TYPE,
    'MR', 'Media Recovery',
    'RT', 'Redo Thread',
    'UN', 'USER Name',
    'TX', 'Transaction',
    'TM', 'DML',
    'UL', 'PL/SQL USER LOCK',
    'DX', 'Distributed Xaction',
    'CF', 'Control FILE',
    'IS', 'Instance State',
    'FS', 'FILE SET',
    'IR', 'Instance Recovery',
    'ST', 'Disk SPACE Transaction',
    'TS', 'Temp Segment',
    'IV', 'Library Cache Invalidation',
    'LS', 'LOG START OR Switch',
    'RW', 'ROW Wait',
    'SQ', 'Sequence Number',
    'TE', 'Extend TABLE',
    'TT', 'Temp TABLE',
    wk.TYPE
    ) lock_type,
    DECODE (hk.lmode,
    0, 'None',
    1, 'NULL',
    2, 'ROW-S (SS)',
    3, 'ROW-X (SX)',
    4, 'SHARE',
    5, 'S/ROW-X (SSX)',
    6, 'EXCLUSIVE',
    TO_CHAR (hk.lmode)
    ) mode_held,
    DECODE (wk.request,
    0, 'None',
    1, 'NULL',
    2, 'ROW-S (SS)',
    3, 'ROW-X (SX)',
    4, 'SHARE',
    5, 'S/ROW-X (SSX)',
    6, 'EXCLUSIVE',
    TO_CHAR (wk.request)
    ) mode_requested,
    TO_CHAR (hk.id1) lock_id1, TO_CHAR (hk.id2) lock_id2
    FROM Gv$lock hk, v$session bs, v$lock wk, v$session ws
    WHERE hk.BLOCK = 1
    AND hk.lmode != 0
    AND hk.lmode != 1
    AND wk.request != 0
    AND wk.TYPE(+) = hk.TYPE
    AND wk.id1(+) = hk.id1
    AND wk.id2(+) = hk.id2
    AND hk.SID = bs.SID(+)
    AND wk.SID = ws.SID(+)
    AND (bs.username IS NOT NULL)
    AND (bs.username <> 'SYSTEM')

  • Microsoft sql client deadlocked on lock resources with another process

    Hi
    I wrote a forecasting report for a customer which creates an excel spreadsheet with the information
    Depending on how they run the report it can take between 5 to 15 minutes to run
    We have just upgraded the customer to SAP 8.8 PL10 and Microsoft SQL Server 2008 and they seem to be getting an error -
    Microsoft sql client deadlocked on lock resources with another process .......
    The error seems intermittent, they may get the error once and the next time they run it, it is fine.
    I have never seen this error before and they never had it before on SAP 2005
    Can anyone suggest anything please?
    Thanks
    Regards Andy

    Hi Andy,
    I was having the same problem. I'm gonna tell you what i did.
    My query usually takes from 10 to 15 minutes to show results. That long time also block all transaction in the database.
    I was reading about some techniques to improve queries performance. Some of the tips are:
    1. Review indexes in the table you are querying
    2. Use Views
    3. Avoid cursors
    4. Archive old data
    5. Use the correct transaction isolation level
    The last one, was the tip that helped me to avoid the block in the database.
    By default the isolation level in SQL Server is Read Commited, that explains why the database block some transactions. For example, if you have a query that take data from JDT1 table and it takes several minutes to show the results, other transactions that try to write in the same table should be blocked if they arrive at the same time of the first query.
    To solve this, you can make your query in a transaction with Snapshot isolation level. It means that your select query will take a snapshot of the data without blocking any other transaction.
    Here is an example how you can make it. The difference is that you may use ADO.NET connection replacing DI API Connection:
    oConnection = OK1.Generic.Helpers.setConnection(server, password, userID, db); // You have to set anyway your sqlconnection
                        if (oConnection.State == ConnectionState.Open)
                            oCommand = new SqlCommand();
                            oCommand.Connection = oConnection;
                            oCommand.CommandTimeout = System.Convert.ToInt32(timeOut);
                            oCommand.CommandText = "ALTER DATABASE " + db + " SET ALLOW_SNAPSHOT_ISOLATION ON";
                            oCommand.ExecuteNonQuery();
                            sqlTran1 = oConnection.BeginTransaction(IsolationLevel.Snapshot);
                            oCommand.CommandText = query;
                            oCommand.Transaction = sqlTran1;
                            oCommand.ExecuteNonQuery();
                            sqlTran1.Commit();
                            oCommand.CommandText = "ALTER DATABASE " + db + " SET ALLOW_SNAPSHOT_ISOLATION OFF";
                            oCommand.ExecuteNonQuery();
                            if (oConnection.State == ConnectionState.Open)
                                oConnection.Close();
    In this example I write the data to show in the report in other table, then the report takes the data from that table.
    I hope it will be helpful for you.
    Regards,
    Juan Camilo

  • Sql of the blocker history

    Hi
    Oracle 10g.
    Lets say, I experienced a database lock 2 hours ago and I want to find which sql statement was blocking others.
    I know the sid of the blocker but I am unable to find the sql statement of the blocker.
    Also, when I check enterprise manager top activity only shows the waiter.
    I tried to run the queries from below link, but it only shows the information about the waiting session.
    http://oraclue.com/2009/10/15/blocking-locks-history/
    How can I find the sql statement of the particular sid from history ?

    Ora_83 wrote:
    Lets say, I experienced a database lock 2 hours ago and I want to find which sql statement was blocking others.
    I know the sid of the blocker but I am unable to find the sql statement of the blocker.
    Also, when I check enterprise manager top activity only shows the waiter.
    I tried to run the queries from below link, but it only shows the information about the waiting session.
    http://oraclue.com/2009/10/15/blocking-locks-history/
    How can I find the sql statement of the particular sid from history ?Generally speaking, there is no way. There is no direct link available between the lock and the statement. Any SQL-driven solution to the probably is depending on luck, or a little guesswork, and may give no answer or a false positive. For a simple demo to make the point see: http://jonathanlewis.wordpress.com/2009/04/19/locking-sql/
    Regards
    Jonathan Lewis

  • Monitoring blocking Locks

    Hi
    This question relates to monitoring blocking locks on a 9.2.0.5 2 node RAC
    Origionally I have been monitoring bocking locks with every 5 mins using the following query:
    "select * from dba_blockers"
    I have recently implemented monitoring via grid control this is running an out of the box metric every 5 mins, the sql behind it is as follows:
    "SELECT blocking_sid, num_blocked
    FROM ( SELECT blocking_sid, SUM(num_blocked) num_blocked
    FROM ( SELECT l.id1, l.id2,
    MAX(DECODE(l.block, 1, i.instance_name||'-'||l.sid,
    2, i.instance_name||'-'||l.sid, 0 )) blocking_sid,
    SUM(DECODE(l.request, 0, 0, 1 )) num_blocked
    FROM gv$lock l, gv$instance i
    WHERE ( l.block!= 0 OR l.request > 0 ) AND
    l.inst_id = i.inst_id
    GROUP BY l.id1, l.id2)
    GROUP BY blocking_sid
    ORDER BY num_blocked DESC)
    WHERE num_blocked != 0 "
    Now.. At one point today the alert using "select * from dba_blockers" fired where as the out of the box metric from gird control did not fire.... alert duration was around 5 - 10 mins
    At first i simply assumed that this could have been a brief lock and due to both 5 min intervals being out of sync, the lock had shown and cleared before the grid control interval run.
    now im a little more curious.
    Is there any significan difference in what these 2 different SQL's will alert on, I was under the impression that DBA_BLOCKERS was simply querying a number of joined views, and Oracle had decided to use V$lock for their out of the box metric as it was more efficient.
    Any comments welcome
    Thanks

    Just to prove that the SQL is correct I have constrcuted a demo for you...
    SQL> create table t (a char(1));
    Table created.
    SQL> insert into t values ('z');
    1 row created.
    SQL> commit;
    in session 1 ---->
    select * from t where a='z' for update;
    ==================================================================
    in session 2 ---->
    update t set a='x' where a='z';
    (session simply hangs)
    ==================================================================
    in session 3 ------>
    SQL> select * from dba_blockers;
    HOLDING_SESSION
    48
    SQL>
    SQL> SELECT blocking_sid, num_blocked
    FROM ( SELECT blocking_sid, SUM(num_blocked) num_blocked
    FROM ( SELECT l.id1, l.id2, MAX(DECODE(l.block, 1, i.instance_name||'-'||l.sid,
    2, i.instance_name||'-'||l.sid, 0 )) blocking_sid,
    SUM(DECODE(l.request, 0, 0, 1 )) num_blocked
    FROM gv$lock l, gv$instance i
    WHERE ( l.block!= 0 OR l.request > 0 ) AND
    l.inst_id = i.inst_id
    GROUP BY l.id1, l.id2)
    GROUP BY blocking_sid
    ORDER BY num_blocked DESC)
    WHERE num_blocked != 0;
    2 3 4 5 6 7 8 9 10 11 12
    BLOCKING_SID NUM_BLOCKED
    RAC1-48 1
    So back to the origional question,
    I am using both these queries from different monitors on my prod syystem, both running on 5 minute intervals, " select * from dba_blockers" fired where as the above query - querying gv$lock did not fire.
    Origionaly i assumed that the blocking lock may have simply lasted 3t0 seconds, and due the 5 minute monitor intervals of each metric not being in sync, ... "select * from dba_blockers" may have picked up the lock, then the query selecting from gv$lock ran 2 mins later by which time the lock had disapeared.
    -Can anyone suggest any other reasons other than this why one monitor (select * from dba_blockers) picked up the lock and the other (gv$lock) didnt?
    Thanks

  • Monitoring Blocking locks (dba_blockers vs v$lock)

    Hi
    This question relates to monitoring blocking locks on a 9.2.0.5 database
    Origionally I have been monitoring bocking locks with every 5 mins using the following query:
    "select * from dba_blockers"
    I have recently implemented monitoring via grid control this is running an out of the box metric every 5 mins, the sql behind it is as follows:
    "SELECT blocking_sid, num_blocked
    FROM ( SELECT blocking_sid, SUM(num_blocked) num_blocked
    FROM ( SELECT l.id1, l.id2,
    MAX(DECODE(l.block, 1,l.sid,
    2,l.sid, 0 )) blocking_sid,
    SUM(DECODE(l.request, 0, 0, 1 )) num_blocked
    FROM v$lock l
    WHERE ( l.block!= 0 OR l.request > 0 ) AND
    GROUP BY l.id1, l.id2)
    GROUP BY blocking_sid
    ORDER BY num_blocked DESC)
    WHERE num_blocked != 0 "
    Now.. At one point today the alert using "select * from dba_blockers" fired where as the out of the box metric from gird control did not fire.... alert duration was around 5 - 10 mins
    At first i simply assumed that this could have been a brief lock and due to both 5 min intervals being out of sync, the lock had shown and cleared before the grid control interval run.
    now im a little more curious.
    Is there any significan difference in what these 2 different SQL's will alert on (different types of blocking locks / sessions?) , I was under the impression that DBA_BLOCKERS was simply querying a number of joined views, and Oracle had decided to use V$lock for their out of the box metric as it was more efficient.
    Any comments welcome
    Thanks

    Re: Monitoring blocking Locks

  • Blocking Locks - What Was Likely Going On?

    I had a blocking lock yesterday that showed up in OEM under Cluster Database --> Cluster Database Locks. The blocking lock was a row exclusive (RX) table lock that was blocking 175 other sessions that were listed under the blocking lock as having requested row share (RS) locks. It was an hour before I found out about this problem.
    Two questions:
    1.] The "Oracle Database Concepts 10gR2" book, Table 13-13, states that a row exclusive (RX) table lock can be obtained as a result of INSERT, UPDATE or DELETE DML and that in RX mode share lock modes are not permitted (which is why I had 175 blocked sessions). Does this mean that a user must have been doing a long running (1 hour plus) INSERT, UPDATE or DELETE or is there another more likely cause that I'm not aware of?
    2.] The only ways I know of to request a row share lock (of which 175 were blocked due to the RX lock) is by using:
    LOCK_TABLE <table name> IN SHARE MODE;
    LOCK_TABLE <table name> IN SHARE EXCLUSIVE MODE;
    LOCK_TABLE <table name> IN EXCLUSIVE MODE;
    I can't imagine a user doing any of these commands so is there another more likely reason that 175 row share (RX) locks were being requested (and blocked)?
    Thanks for any insight you can offer. I ended up killing the session that held the RX lock and that resolved the problem but I'd like to better understand what was happening.

    1.] The "Oracle Database Concepts 10gR2" book, Table
    13-13, states that a row exclusive (RX) table lock
    can be obtained as a result of INSERT, UPDATE or
    DELETE DML and that in RX mode share lock modes are
    not permittedThat table shows that RS (mode 2) is permitted while RX lock is held.
    Did you mean to say that sessions were waiting on a S mode (4) lock?
    This could indicate that update/delete was attempted on a parent table and that dependend table was lacking an index on fk column. (may answer your q.2)

  • Blocking locks by user report hangs

    Please,
    "Blocking locks by user" report under "Database Administration Section" of "Data Dictionary Reports" is hanging
    every time we try to run it against any database.
    Please, confirm this issue in Oracle Sql Developer 4.0 EA since it was working perfectly in
    Oracle SQL Developer 3.2.2 (3.2.20.09.87).
    Also, allow us an estimate deadline for correction.
    Thanks in advance,
    Andraly Ng

    please make a copy of the posting in the report-forum

  • Blocking Locks

    Oracle 9.2.0.8
    Our database is used as backend for IIS Servers. Several times per week we experience Blocking locks situation when we could have around 300 – 400 session waiting. Most time when somebody fire up some Update or Delete process. Every time when I check dba_waiters table during this it gives me 10 – 20 holding session. After killing them all things go back to normal.
    My question how do I know which one out of this 10 – 20 session is first or real offender. The reason I asked that sometimes after checking SQL’s from several holding sessions they different. And I am not sure which one is the real issue. If I could find this I would be able to go back to developers and see if they missed commit or something in code.

    You can use DBA_BLOCKERS and DBA_WAITERS to generate a hierarchy-- the session at the top of the hierarchy is the real offender (assuming, of course, that the locking is not intentional).
    In DBA_WAITERS, you'll see a WAITING_SESSION and a HOLDING_SESSION. If you see entries indicating that A is waiting for B, B is waiting for C, and C is waiting for D, you see that there is a hierarchy of locks. Session D in this case is the ultimate culprit (it is blocking a session and it is not blocked by any other session). Of course, in reality, there may be multiple culprit sessions. And you'd want to run the query a couple of times to make sure that what you're seeing is consistent-- if the blockers and waiters change regularly, that's a very different situation than if things are stuck because one session has gone out to lunch.
    Justin

  • Blocking Locks monitoring in 12c cloud control

    Ours is a 11.2 4 node RAC environment, and to check for blocking locks i run a sql script. I want to monitor the blocking locks in the system and if there are any locks for more than say 10 minutes then send out a mail to a group to look into it.
    We have 12c cloud control setup, my question is if there is a way to setup alerting/monitoring via 12c for checking blocking locks on all nodes and send out email notifications if there are any. I am not much familiar with 12c, please let me know and if its possible let me know the steps to set it up.

    Resolved by removing and re-adding the target...

  • How to find out the reason for blocking locks?

    PB Application try to create data in ASE 12.5. With this operation, there are sql, sp, trigger involved. Most of the it is okay. With lock of sleeping or sync sleeping lock. User wait for a short time to get the result.
    but some time, there are blocking lock.
    If spid for the app is 1. then looks like this app also generate another spid, say it is 2. and 2 is blocking by 1. spid 1 holding lock!
    then all user is frozen because of spid 1 holding lock!!!  How to figure it out the reason for blocking locks?

    Thanks, Mark. Yes, sp_lock, sp_who, ... are common tool I used.
    I found out one case like:
    I have a SP which call a View for data.
    When I run this SP, suppose the sipd is 1. then it will create another spid 2 because of access view and it gone very quick. This cause spid 1 block spid 2 within a short time.
    If the are many user run the app, the app will be  frozen and everyone is waiting. Finally it release, no dead lock, but the performance is not acceptable.
    That why I have this question.

  • A lot of blocking locks on NRIV daily

    Hi experts,
      Our system has a lot of blocking locks on NRIV. I use DMV to check and find many processes update RF_BELEG frequently. I find note 840901 can solve using parallel buffering, but our FI users do not agree sale document number without continuous chronological ascending order. Any solution from SAP or SQL server? Could SQL server parallel update NRIV table?

    hi dennis,
    this issue would be complicated since if you're not allowing your Apps server buffering NRIV than your SAP performance will decrease. this is because every transaction which require number need to be generated first every time your user save data to your SAP system.
    This buffering technique is used to handle  this issue so if your Apps server do not need to ask new number every time your user save their transaction data.
    i have same issue when our external (public) auditor ask me than i ask for SAP support and then they explain about this. when i explain this issue to my external auditor, they understand this issue and they said no problem as long as  this issue could be accepted.
    ardhian
    http://sapbasis.wordpress.com
    http://ardhian.kioslinux.com

Maybe you are looking for

  • Refreshing included JSP file

    Hi, I've created a simple word-verification login system to stop robots from trying out various password combo's on a user's account. I've created a separate JSP page that randomly chooses an image from a database, sets a session variable to the word

  • How to find that reports are in use or not?

    HI experts I have some set of reports under one InfoArea I want to know that any user is using them or not? And if someone is using then I want to find date on which it was last used.. Can you please tell me?? Regards Swati

  • Reordering pages from Algorithm

    I design ID badges for events and using a merge programme I output a large pdf-file with up to 1500 pages. Each small badge on a single page. The file is now ordered by name. I send the file to a commercial printer which can fit approx 12-18 badges o

  • Word macro search via LDAP for User info into Doc

    I'm looking for a macro that will help me create Userinfo in a doc when i start a new doc. Exampel surename lastname and Deparment. Adress City and phone and some more. Where can i find som info about this. The info need to be connected to the logged

  • Application organisation

    Hello We will shortly be starting our first application with JDeveloper (ADF 11 BC, ADF 11 Rich Faces). One aspect of the application is what we call the "basic tables" These tables are where the user will input the basic information require for the