Blocking sessions during MGP compose
We keep getting the MGP compose process blocked by inactive sessions
We raised a SR with Oracle and they suggested adding the instance parameter DO_APPLY_BFR_COMPOSE=YES to webtogo.ora, but this does not seem to have cured the problem.
From tracing, it seems that the problem is an inactive apply session that resulted in an error, being there for the user it is trying to compose. The actual block is on the table MOBILEADMIN.C$ALL_CLIENT_ITEMS.
If an apply fails due to an error (eg: constraint violarion, trigger failure etc), it executes the statement
UPDATE MOBILEADMIN.C$ALL_CLIENT_ITEMS SET CRR='Y' WHERE CLIENTID=? AND PUBLICATION_ITEM IN ( SELECT PUBLICATION FROM MOBILEADMIN.C$ALL_TEMPLATE_ITEMS ati WHERE ati.TEMPLATE=?):
as part of the copy to the error queue. It also looks to execute the same statement at the beginning of the compose for the user, hence the block.
The other odd thing is that looking at the blocks this morning, the MGP apply/compose kicked off at 7.09 am. The user synchronised at just after 8 am, by which time the MGP cycle was well into the compose phase, and there is no record of apply activity for the user within the cycle (the actual apply is in the following cycle), the the content of the blocking session was definitely apply code.
MGP used to do all of the applys first, and then all of the composes, with a test to skip the compose if there was data in the user in queue. The upgrade to 10.2 (or one of the many patches since) looks to have changed the default behaviour to attempt an apply before each user compose, but the parameter above was supposed to set the server back to its old behaviour (ie: keep apply and compose seperate). NOTE i have not seen any of the old 'compose deferred because of unprocessed data in the in queue' messages in the compose recently either.
Upshot is that it looks like it is still mixing apply and compose together, and where the apply hits an error, the apply thread is not closing correctly, or releasing its locks.
Does anyone have any information about the parameters
DO_APPLY_BFR_COMPOSE or
SKIP_INQ_CHK_BFR_COMPOSE (this appeared with a value of NO when we added the other parameter.
Information from oracle is that the two are mutualy exclusive (?) but they are not documented anywhere that i can find (the one reference on metalink leads to a non existant note), and oracle seem reluctant to supply any
so PLEASE
a) any information about the parameters
b) any dependancies (ie: parameters not working because we are missing a patch)
c) location of documentation
d) any other ideas
which version are you on?
we are on 10.2.0.2, so unsure if this works in other versions
The standard mobile manager parameters screen does not by default show these settings, but we were asked to add them into the webtogo.ora file in the [CONSOLIDATOR] section eg:
[CONSOLIDATOR]
# Installer will change these values
SERVER_VERSION=8.1.7
SKIP_INQ_CHK_BFR_COMPOSE=YES
DO_APPLY_BFR_COMPOSE=NO
RESUME_FILE_SIZE=512
# 8.1.7
# Installer won't change these values
MAX_THREADS=3
JDBC_DRIVER=oracle.jdbc.driver.OracleDriver
once this was done we stopped and restarted the mobile server and then the new parameters will appear in the normal data synchronisation>administration>instance parameters screen
our current setting on the live system are
SKIP_INQ_CHK_BFR_COMPOSE YES
DO_APPLY_BFR_COMPOSE NO
and this does the compose whether or not there is pending data in the in queues for the client. Just my opinion, but there seems little point in doing the check as even if you force two tries of the apply process (one in the main apply phhase before the compose phase, and one just before composing for a particular user), the data in the second apply will not be picked up on fast refresh publication items as the 'snapshot' of the changes has already been done in the process logs phase
Similar Messages
-
Hi people,
When we try to sync about 80000 new rows to the server we receive the following in mgptrace_sys1.log
log-1: ============== Server Exception - Begin ==================
java.lang.Exception: MGP compose timed out for C2131_01
at oracle.lite.sync.Consolidator$O8Server.fastPush(Consolidator.java, Compiled Code)
at oracle.lite.sync.MGP$MGPG.run(MGP.java, Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
================== Server Exception - End ====================
Does anyone know how to prevent this?
Many thanks
AndyThis is expected, since the compose cycle for the user C2131_01 exceeded the default value for parameter COMPOSE_TIMEOUT, which is 5 minutes. I suggest two things:
1. Tune the system to optinmize MGP performance (use the Consperf utiliy to get the numbers and explain plan)
2. Increase COMPOSE_TIMEOUT
The reason we did this is to prevent MGP from being blocked by one particular user -
MGP compose postponed because of unprocessed data in the in_queue
Could anybody shed some light on what does this mean?
"MGP compose postponed for B010MRM because of unprocessed data in the in_queue"
Thanks in advance,
dliu
We saw this one in the "Moblile Manager" Data Synchronization > MGP Apply/Compose Cycles > MGP History Cycle >
"Compose Error:
java.lang.Exception: MGP compose postponed for B010MRM because of unprocessed data in the in_queue
at oracle.lite.sync.Consolidator$O8Server.fastPush(Unknown Source)
at oracle.lite.sync.MGP$MGPG.run(Unknown Source)
at java.lang.Thread.run(Thread.java:534)"Basically there was data sitting in the in queue for the particular user when thier turn came around for the compose cycle of the MGP.
If this is the case, there could be a conflict between the incoming data and the data that could be selected from the main server database for download. To prevent this the compose will not run for the user.
During the next MGP cycle the in queue data will be posted first (assuming no errors) and then the compose will run as normal for the user. This is a relatively normal situation where there is a lot of incoming traffic and continual compose processes. -
Hi,
Need some assistance...!
For the last few weeks i was getting the blocking session alerts and when i checked out for what the blocking session is doing, i found some select or insert or pl/sql line of code is getting executed. but the thing is i have observed the blocking is done on the same table each time.
Any suggestions how i can proceed further ? why the lock is getting on the similar table.
Regards,
SunilaAbout code examination, you could check the detailed SQL statements:
- INSERT should only block if another INSERT is run on the same table with the same primary key and in this case the second INSERT statement will fail due to duplicate key.
- SELECT can only block if SELECT with FOR UPDATE clause is used and in this case all rows returned by the SELECT (for a single table SELECT) are locked. SELECT without FOR UPDATE clause does not block.
If not already done, see How Oracle locks data. -
Access to view blocking sessions in sql server 2008
Hi,
One of my client wrote a stored procedure. we scheduled this SP in a job. while job is running, it is blocking other sessions. It is happening frequently. So, client is asking me to grant permission to view blocking session( want to execute sp_who2). Could
you please advise me, which permission I need to give. I don't like to give access other than sp_who2. Please advise.
Thanks.
Raja.
Thanks, RajaYou need VIEW SERVER STATE permissions for sp_who or sp_who2 to work. You can also use sys.dm_exec_requests which will also give blocking information and requires the same permissions.
Else you can take a look at the other alternative which is sp_whoisactive - check this link -
http://sqlblog.com/blogs/adam_machanic/archive/2012/03/22/released-who-is-active-v11-11.aspx
Regards, Ashwin Menon My Blog - http:\\sqllearnings.com -
What's the query to find this kind of info, blocking session? eg
535 session blocking one other session 1962, they are both coming from SP:This query will tell you who's blocking who...
select (select username
from v$session
where sid = a.sid) blocker
, a.sid
, ' is blocking '
, (select username
from v$session
where sid = b.sid) blockee
, b.sid
from v$lock a
, v$lock b
where a.block = 1
and b.request 0
and a.id1 = b.id1
and a.id2 = b.id2query by Tom Kyte -
How to kill the blocking session
hi expert,
when i m going to run the below query
Update rcv_transactions_interface rti set rti.processing_mode_code ='BATCH' where rti.interface_transaction_id = 3671265
it gives the error:
ORA-00054 resource busy and acquire with NOWAIT specified.
i find out the blocking session by using the blow query;
SELECT a.SESSION_ID, a.SESSION_SERIAL#, min(A.SAMPLE_TIME) start_time,max(A.SAMPLE_TIME) end_time,a.inst_id, a.blocking_session,a.user_id,s.sql_text,A.EVENT,O.OBJECT_NAME,max(A.SAMPLE_TIME) - min(A.SAMPLE_TIME)
FROM GV$ACTIVE_SESSION_HISTORY a ,gv$sql s, dba_objects o
where a.sql_id=s.sql_id
and A.CURRENT_OBJ# = O.OBJECT_ID
and blocking_session is not null
and a.user_id != 0 -- exclude SYS user
and a.sample_time > sysdate - 7
and a.event = 'enq: TX - row lock contention'
group by a.SESSION_ID, a.SESSION_SERIAL#, a.inst_id,a.blocking_session,a.user_id,s.sql_text,A.EVENT,O.OBJECT_NAME
it gives the output
SESSION_ID
SESSION_SERIAL#
START_TIME
END_TIME
INST_ID
BLOCKING_SESSION
USER_ID
SQL_TEXT
EVENT
OBJECT_NAME
MAX(A.SAMPLE_TIME)-MIN(A.SAMPLE_TIME)
369
45,849
9/4/2013 8:29:33.119 AM
9/4/2013 11:40:27.508 AM
1
554
173
SELECT POL.UNIT_PRICE FROM PO_LINES POL WHERE POL.PO_LINE_ID = :b1
enq: TX - row lock contention
PO_LINES_ALL
+00 03:10:54.389000
554
18,872
9/4/2013 8:29:33.119 AM
9/4/2013 11:40:27.508 AM
1
365
173
SELECT POL.UNIT_PRICE,POL.QUANTITY,POL.UNIT_MEAS_LOOKUP_CODE,POL.AMOUNT FROM PO_LINES POL WHERE POL.PO_LINE_ID = :b1
enq: TX - row lock contention
JA_IN_PO_LINE_LOCATION_TAXES
+00 03:10:54.389000
572
168
9/4/2013 8:29:33.119 AM
9/4/2013 11:40:27.508 AM
1
554
173
select line_location_id into :b0 from po_line_locations_all where line_location_id=:b1 for update of line_location_id
enq: TX - row lock contention
PO_LINE_LOCATIONS_ALL
+00 03:10:54.389000
581
4,973
9/4/2013 10:49:38.157 AM
9/4/2013 10:50:39.259 AM
1
572
173
Update rcv_transactions_interface rti set rti.processing_mode_code ='BATCH' where rti.interface_transaction_id = 3671265
enq: TX - row lock contention
RCV_TRANSACTIONS_INTERFACE
+00 00:01:01.102000
my problem is in the above output among 4 which i have to delete so sove my issue.
its very urgent for me.
plz plz suggest me and how can i kill the session.
thanks & regards
pritesh ranjanpriteshranjan wrote:
hi expert,
when i m going to run the below query
Update rcv_transactions_interface rti set rti.processing_mode_code ='BATCH' where rti.interface_transaction_id = 3671265
it gives the error:
ORA-00054 resource busy and acquire with NOWAIT specified.
i find out the blocking session by using the blow query;
SELECT a.SESSION_ID, a.SESSION_SERIAL#, min(A.SAMPLE_TIME) start_time,max(A.SAMPLE_TIME) end_time,a.inst_id, a.blocking_session,a.user_id,s.sql_text,A.EVENT,O.OBJECT_NAME,max(A.SAMPLE_TIME) - min(A.SAMPLE_TIME)
FROM GV$ACTIVE_SESSION_HISTORY a ,gv$sql s, dba_objects o
where a.sql_id=s.sql_id
and A.CURRENT_OBJ# = O.OBJECT_ID
and blocking_session is not null
and a.user_id != 0 -- exclude SYS user
and a.sample_time > sysdate - 7
and a.event = 'enq: TX - row lock contention'
group by a.SESSION_ID, a.SESSION_SERIAL#, a.inst_id,a.blocking_session,a.user_id,s.sql_text,A.EVENT,O.OBJECT_NAME
it gives the output
SESSION_ID
SESSION_SERIAL#
START_TIME
END_TIME
INST_ID
BLOCKING_SESSION
USER_ID
SQL_TEXT
EVENT
OBJECT_NAME
MAX(A.SAMPLE_TIME)-MIN(A.SAMPLE_TIME)
369
45,849
9/4/2013 8:29:33.119 AM
9/4/2013 11:40:27.508 AM
1
554
173
SELECT POL.UNIT_PRICE FROM PO_LINES POL WHERE POL.PO_LINE_ID = :b1
enq: TX - row lock contention
PO_LINES_ALL
+00 03:10:54.389000
554
18,872
9/4/2013 8:29:33.119 AM
9/4/2013 11:40:27.508 AM
1
365
173
SELECT POL.UNIT_PRICE,POL.QUANTITY,POL.UNIT_MEAS_LOOKUP_CODE,POL.AMOUNT FROM PO_LINES POL WHERE POL.PO_LINE_ID = :b1
enq: TX - row lock contention
JA_IN_PO_LINE_LOCATION_TAXES
+00 03:10:54.389000
572
168
9/4/2013 8:29:33.119 AM
9/4/2013 11:40:27.508 AM
1
554
173
select line_location_id into :b0 from po_line_locations_all where line_location_id=:b1 for update of line_location_id
enq: TX - row lock contention
PO_LINE_LOCATIONS_ALL
+00 03:10:54.389000
581
4,973
9/4/2013 10:49:38.157 AM
9/4/2013 10:50:39.259 AM
1
572
173
Update rcv_transactions_interface rti set rti.processing_mode_code ='BATCH' where rti.interface_transaction_id = 3671265
enq: TX - row lock contention
RCV_TRANSACTIONS_INTERFACE
+00 00:01:01.102000
my problem is in the above output among 4 which i have to delete so sove my issue.
its very urgent for me.
plz plz suggest me and how can i kill the session.
thanks & regards
pritesh ranjan
According to the above, your session_id is 581 which is blocked by session_id 572 so you need to kill the 3rd session in the list.
Thanks,
Hussein -
Metric threshold Blocking session count
Hi,
I am trying to modify the blocking session count threshould and making warning threshold as null and critical threshold > 0. When i create a blocking session in the database i get the warning for application wait class but i don't get a critical alert generated even waiting for more than an hour. Here is what i have done so far
1. changed the warning threshold to null, critical threshold to > 0 and changed the time of collection to each 5 minutes.
2. Creating a blocking lock in the database, when i go on the performance page of db and look at the instance locks i can see the lock being held for more than 30 minutes
Any ideas how can i get this going will be much appreciated.In order to trigger the metric "blocking session count", you have to
a. have one session which is holding the lock (not comitting)
b. at least one session which is waiting for exactly that lock. in that case, the metric will report sid of blocking session with a value of > 0.
Regards,
Martin Decker
www.ora-solutions.net -
Oracle Blocking Session History
Hi Folks,
This morning the database server machine CPU hits 100% - i found a blocking session but didnt killed it as it was of the flashback session.
The only option i thought was to restart the database.
Now, i want to investigate the problem - any idea, how to find the cause of tht problem???
regards,
OraGuy1) Session A holding a lock that Session B is waiting on, causing session B to be temporarily blocked, assuming that's what you saw when you're talking about a "blocking session", is not particularly unusual in Oracle (or any relational database for that matter). That shouldn't cause a spike in CPU and it shouldn't require a database restart to clear the problem (at worst, you might kill the session that holds the lock, but it would normally resolve itself automatically), though. And that definitely doesn't explain a hung database if that's truly what you had.
2) Since you mentioned AWR, can we assume that you are using the enterprise edition with the performance & tuning packs? If so, assuming you rebooted before the AWR snapshot captured information about the state of the system, you could potentially go through the ASH data (active session history) for the various sessions that were blocking and waiting to see what they were waiting on.
Justin -
Hi all friends,
I want to find out blocking sessions between 3.00 am to 7.00 am on dec 18,2013. Could some one help me on this please. I have a script and i would appreciate if someone can help me out to modify it.
SELECT s1.username || '@' || s1.machine
|| ' ( SID=' || s1.sid || ' ) is blocking '
|| s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
FROM v$lock l1, v$session s1, v$lock l2, v$session s2
WHERE s1.sid=l1.sid AND s2.sid=l2.sid
AND l1.BLOCK=1 AND l2.request > 0
AND l1.id1 = l2.id1
AND l2.id2 = l2.id2I want to find only TX row lock
-
hi,
How to find out the blocking sessions in RACUse Google .
Some Links :
http://erikwramner.wordpress.com/2010/05/28/find-blocking-and-blocked-sessions/
http://oraclespin.wordpress.com/2009/05/18/how-to-find-blocking-session/
also mention in this thread before
Re: Finding Locking SID in RAC environments -
Blocking session in hot backup mode?
In 8.1.7.4 Some time While in hot backup mode, blocking session occuring by checkpoint session background process. Can we issue the alter system checkpoint command in this
Situation ? how to handle this?best way is to try and see but checkpointing frequently wont help in my opinion, a better workaround may be ensuring you only place one tablepspace at a time in backup mode and bring the tablespace out of backup mode as soon as you have backed it up.
-
Blocking Session - blocked SQL - SELECT SYSDATE FROM SYS.DUAL
Oracle 10.0.0.4g
When database execute some big and long queries/operations my system is slow and some users wait, can’t work (they work with some Oracle forms applications ) because I often have blocking session.
I found up that this blocking sessions block only this query of another user:
SELECT SYSDATE FROM SYS.DUAL
Or:
+10-АВГ-2009 08:51:10 User X1 ( SID= 222 ) with the statement: SELECT ... is blocking the SQL statement on Y1 ( SID=333 ) blocked SQL -> SELECT SYSDATE FROM SYS.DUAL+
When I kill one of the blocking session another session take his place and do the same:
+10-АВГ-2009 08:53:10 User X2 ( SID= 444 ) with the statement: SELECT ... is blocking the SQL statement on Y2 ( SID=555 ) blocked SQL -> SELECT SYSDATE FROM SYS.DUAL+
When long queries finished everything is OK.
Please Help Me!!!I create ASH report:_
Top User Events
Avg Active
Event Event Class % Activity Sessions
enq: TM - contention Application 55.87 0.96
db file sequential read User I/O 18.87 0.32
CPU + Wait for CPU CPU 16.33 0.28
db file scattered read User I/O 3.02 0.05
Top Event P1/P2/P3 Values
Event % Event P1 Value, P2 Value, P3 Value % Activity
Parameter 1 Parameter 2 Parameter 3
enq: TM - contention 55.87 "xxxxxxxxxxxxxxxxxxxx" 38.35
name|mode object # table/partition
"1111111111","xxxxxxx","0" 17.44
db file sequential read 19.21 "xxxxxxxxxxxxxxx’’ 0.00
file# block# blocks
db file scattered read 3.03 "xxxxxxxxxxxxxxxxxxxxxx’’ 0.01
file# block# blocks
Top SQL Statements …………..
SQL ID Planhash % Activity Event % Event
fnxxxxxxxxx N/A 25.09 enq: TM - contention 23.47
** SQL Text Not Available **
N/A 25.09 db file sequential read 1.19
** SQL Text Not Available **
byxxxxxxxxxxxxx 1111111 10.11 enq: TM - contention 7.43
SELECT SYSDATE FROM SYS.DUAL
db file sequential read 2.10
fnxxxxxxxxx 11111111111 2.57 enq: TM - contention 2.16
** SQL Text Not Available **
Top DB Objects
Object ID % Activity Event % Event
Object Name (Type) Tablespace
11111 10.33 enq: TM - contention 10.30
XXXXXXXXXXXXXXXXXXXXXXXX (INDEX) CC
99999 10.18 enq: TM - contention 10.16
XXXXXXXXXXXXXXXXXXXXXXXXX (INDEX) IND
933333 6.67 enq: TM - contention 6.55
FFFFFFFFFFFFFFFF (TABLE) T3
114545 3.88 enq: TM - contention 3.85
RRRRRRRRRRRRRRRRRRRRRR (INDEX) JJJ
1136664 2.96 enq: TM - contention 2.93
FFFFFFFFFFFFFFFFFFFFFFFFF (INDEX) G
How to found sql text that is not available ** SQL Text Not Available **?
What to do whit this Top DB Objects that have enq: TM - contention event?
And how to solve this problem? -
Find blocking sessions based on forms
Hi,
We use R12 applications and database 10g and wanted to kill blocking sessions that were created from forms in oracle applications.
How to find out them?You can use the resource manager to kill the blocking sessions.
Also you can query to find the blocking sessions:
select SID, SERIAL#, machine, USERNAME, status, BLOCKING_SESSION
from v$session where BLOCKING_SESSION IS NOT NULL
UNION ALL
select A.SID, A.SERIAL#, A.machine, A.USERNAME, A.status, A.BLOCKING_SESSION
from v$session A, V$SESSION b WHERE A.SID=B.BLOCKING_SESSION
order by machine, status; -
Forms related blocking sessions
Hi,
We use R12 applications and database 10g and wanted to kill blocking sessions that were created from forms in oracle applications.
How to find out them?
Regardsquery v$lock to find blocking sessions
check v$session action field (for 'FRM:%') to see if they're forms
the later releases of 11.5 set the v$session action field, so I assume R12 still does that - but don't have access to check.
Maybe you are looking for
-
Hi i have the New (3rd generation) iPad 4G 32 Gb and i noticed that i totally lost internet connection during Skype video calls. The wifi signal is full but loosing the internet connection. Trying other apps like safari after the failure i don't have
-
Standard report on purchase order and bank details
Respected all I need a standard report in which i could get purchase order number , internal order number , vendor name , invoice number , cheque number , cheque amount and cheque date . Is there any standard report available? your replies a
-
How do I get Gmail Notes to show up in Apple Notes?
I just got a new macbook pro with Mountain Lion 10.8.2. I am trying to synchronize my Droid phone notes (using Gnotes via Gmail) with the Apple Notes App on the mac book. I believe I have properly set up the Gmail account in the system preferences.
-
How do I create a view in SQL Server in Visual Studio Express 2013 for Desktop?
Hi I've got a SQL Server database set up using the internal SQL Server in Visual Studio Express 2013 for Desktop. I want to create a view (using tables with one to many relationships) but I don't know how to do it. Where can I find a good tutorial on
-
I don't want my flash menu to reload on every page
Hi everyone, I have a website that I am working on where I have a menu made in flash, the menu expands when you select a category item and executes a hyperlink when you click on a particular item within the category. This hyperlink load a new page an