dbms_alert Polling intervals - oracle

Explain, please, here this paragraph from the documentation
WAITANY procedure. If you use the WAITANY procedure, and if a signalling session does a signal but does not commit within one second of the signal, a polling loop is required so that this uncommitted alert does not camouflage other alerts. The polling loop begins at a one second interval and exponentially backs off to 30-second intervals.
I correctly understand that here it is said that when WAITANY is called on the server, the thread queries the presence of events at certain intervals? And if I called WAITANY with a sufficiently long timeout, when an event occurs, will I be notified only after the current request interval expires? Those. on the server is about like this code
function WaitAny(ATimeout) {
const intervals = [0, 1, ....., 30);
for (i = 0; i < intervals.length; i++) {
Sleep(min(intervals[i], ATimeout))
if (IsExistsEvents())
return 0;
ATimeout -= intervals[i];
if (ATimeout <= 0)
return 1;
}
maxInterval = intervals[intervals.length - 1];
while (ATimeout > 0) {
Sleep(min(maxInterval, ATimeout))
if (IsExistsEvents())
return 0;
ATimeout -= maxInterval;
}
return 1;
}

No, it will still be "immediate".
When someones signals an alert, it will flick out a pipe message (a non-transactional blip) which the waiter will see. But of course, the waiter has not "officially" received the alert until the signaller commits.
So the waiter gets the blip, then waits on a lock (alerts are implemented with Oracle's standard locking mechanism). Because we're expecting the commit to come quickly.
If it doesn't, that's a problem because what if we get a signal from a different alert (because we are doing a WAITANY here). So when that commit does not come, we'll acquiesce and do the exponential backoff. But it is not "check for the alert at 1, 2, 4, etc seconds", it is "re-enter the wait for lock state every 1,2,4, ...seconds". So when that commit comes, we'll pretty much see it straightaway.
For example, I traced a 2 minute wait on an alert from someone who signaled but did not commit
declare
n varchar2(100);
m varchar2(100);
s int;
begin
dbms_alert.WAITANY(n,m,s);
end;
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 127.49 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 0.00 127.50 0 0 0 1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 107
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
enq: UL - contention 9 32.01 127.47
log file sync 1 0.00 0.00
SQL*Net message to client 1 0.00 0.00
SQL*Net message from client 1 0.00 0.00
********************************************************************************
You can see the 2 minute wait was almost all on lock waits.

Related

Jmeter delay between two loop count in Loop Controller

I am trying to achieve below use case for load testing via jmeter
1. Search Product
2. Add to cart
3. Do payment
1 user with uid = 1 will perform above mentioned 3 steps every 5min for 1 hour.
total request per user per hour. = 12(5 * 12 = 60) * 3(rpm) = 36(request per hour)
total users(threads) = 1000.
total request per hour = 1000 * 36 = 36000
lets consider 3 request as a single set
I am looking for below things
after every 5min 1 set should be executed
delay between two sets should be of 5 min
can anyone please help me in achieving above scenario?
I have tried with below jmeter tools
thread group (thread = 1000, ramp up = 100 sec, loop count = 1)
loop controller( above 3 request with loop count = 12)
constant timer = 300000 millisecond
thread group (thread = 1000, ramp up = 100 sec, loop count = 1)
loop controller( above 3 request with loop count = 12)
constant throughput timer = 5 rpm
thread group (thread = 1000, ramp up = 100 sec, loop count = infinite, duration = 3600 sec)
above 3 request inside thread group
constant throughput timer = 5 rpm
Also I have tried with random order controller
I am unable to simulate above scenario. What I am getting is first request is getting executed 1000 times, then delay, then second request is getting executed 1000 times, then delay then 3rd request is getting executed 1000 times.
Constant Timer adds a delay before each Sampler in its scope
If you want to introduce a delay between 2 iterations add Flow Control Action sampler and define the desired delay there
Additionally if you want all the users to finish the action - add a Synchronizing Timer and set the number of users to group by to be equal to the number of threads in the Thread Group.
More information on JMeter Timers concept: A Comprehensive Guide to Using JMeter Timers

Varnish 4: High cache-hit but high backend traffic

When running Varnish 4.0.3 and looking at varnishstat, it reports a cache-hit ratio of about 0.9 - 0.95 which I interpret as a 90-95% cache-hit ratio (incorrect?). I have a very low hit-pass count, so I cannot see that there is a lot of traffic that is not cacheable. The part that bothers me is that the backend servers are working quite a bit despite this. When I look at iftop I see that the server (which isn't running any other applications) is transmitting at about 19Mbit (includes answers to the clients and request headers to backend servers) and receiving about 14Mbit from the backend servers.
I can add that I also have a small grace period in my cache and I see that about 1-2 requests per second get counted as hits but still make a request to the backend, but that is an insignificant number of requests.
I must be missing something that should be obvious. But what?
Edit:
MAIN.uptime 70613 1.00 Child process uptime
MAIN.sess_conn 43313 0.61 Sessions accepted
MAIN.sess_drop 0 0.00 Sessions dropped
MAIN.sess_fail 0 0.00 Session accept failures
MAIN.sess_pipe_overflow 0 0.00 Session pipe overflow
MAIN.client_req_400 0 0.00 Client requests received, subject to 400 errors
MAIN.client_req_411 0 0.00 Client requests received, subject to 411 errors
MAIN.client_req_413 0 0.00 Client requests received, subject to 413 errors
MAIN.client_req_417 0 0.00 Client requests received, subject to 417 errors
MAIN.client_req 6438096 91.17 Good client requests received
MAIN.cache_hit 5231719 74.09 Cache hits
MAIN.cache_hitpass 149819 2.12 Cache hits for pass
MAIN.cache_miss 619678 8.78 Cache misses
MAIN.backend_conn 19491 0.28 Backend conn. success
MAIN.backend_unhealthy 0 0.00 Backend conn. not attempted
MAIN.backend_busy 0 0.00 Backend conn. too many
MAIN.backend_fail 0 0.00 Backend conn. failures
MAIN.backend_reuse 1279156 18.12 Backend conn. reuses
MAIN.backend_toolate 5046 0.07 Backend conn. was closed
MAIN.backend_recycle 1284221 18.19 Backend conn. recycles
MAIN.backend_retry 5 0.00 Backend conn. retry
MAIN.fetch_head 7 0.00 Fetch no body (HEAD)
MAIN.fetch_length 166348 2.36 Fetch with Length
MAIN.fetch_chunked 861097 12.19 Fetch chunked
MAIN.fetch_eof 0 0.00 Fetch EOF
MAIN.fetch_bad 0 0.00 Fetch bad T-E
MAIN.fetch_close 862 0.01 Fetch wanted close
MAIN.fetch_oldhttp 0 0.00 Fetch pre HTTP/1.1 closed
MAIN.fetch_zero 192834 2.73 Fetch zero len body
MAIN.fetch_1xx 0 0.00 Fetch no body (1xx)
MAIN.fetch_204 0 0.00 Fetch no body (204)
MAIN.fetch_304 77295 1.09 Fetch no body (304)
MAIN.fetch_failed 0 0.00 Fetch failed (all causes)
MAIN.fetch_no_thread 0 0.00 Fetch failed (no thread)
MAIN.pools 2 . Number of thread pools
MAIN.threads 400 . Total number of threads
MAIN.threads_limited 0 0.00 Threads hit max
MAIN.threads_created 400 0.01 Threads created
MAIN.threads_destroyed 0 0.00 Threads destroyed
MAIN.threads_failed 0 0.00 Thread creation failed
MAIN.thread_queue_len 0 . Length of session queue
MAIN.busy_sleep 22 0.00 Number of requests sent to sleep on busy objhdr
MAIN.busy_wakeup 22 0.00 Number of requests woken after sleep on busy objhdr
MAIN.sess_queued 0 0.00 Sessions queued for thread
MAIN.sess_dropped 0 0.00 Sessions dropped for thread
MAIN.n_object 61732 . object structs made
MAIN.n_vampireobject 0 . unresurrected objects
MAIN.n_objectcore 61791 . objectcore structs made
MAIN.n_objecthead 59996 . objecthead structs made
MAIN.n_waitinglist 100 . waitinglist structs made
MAIN.n_backend 8 . Number of backends
MAIN.n_expired 412530 . Number of expired objects
MAIN.n_lru_nuked 0 . Number of LRU nuked objects
MAIN.n_lru_moved 1938371 . Number of LRU moved objects
MAIN.losthdr 0 0.00 HTTP header overflows
MAIN.s_sess 43313 0.61 Total sessions seen
MAIN.s_req 6438096 91.17 Total requests seen
MAIN.s_pipe 192 0.00 Total pipe sessions seen
MAIN.s_pass 586507 8.31 Total pass-ed requests seen
MAIN.s_fetch 1206185 17.08 Total backend fetches initiated
MAIN.s_synth 0 0.00 Total synthethic responses made
MAIN.s_req_hdrbytes 4609529442 65278.77 Request header bytes
MAIN.s_req_bodybytes 615275 8.71 Request body bytes
MAIN.s_resp_hdrbytes 2888897421 40911.69 Response header bytes
MAIN.s_resp_bodybytes 95537815896 1352977.72 Response body bytes
MAIN.s_pipe_hdrbytes 57835 0.82 Pipe request header bytes
MAIN.s_pipe_in 45698 0.65 Piped bytes from client
MAIN.s_pipe_out 1305816 18.49 Piped bytes to client
MAIN.sess_closed 24747 0.35 Session Closed
MAIN.sess_pipeline 0 0.00 Session Pipeline
MAIN.sess_readahead 0 0.00 Session Read Ahead
MAIN.sess_herd 813362 11.52 Session herd
MAIN.shm_records 512140676 7252.78 SHM records
MAIN.shm_writes 18119050 256.60 SHM writes
MAIN.shm_flushes 788498 11.17 SHM flushes due to overflow
MAIN.shm_cont 89983 1.27 SHM MTX contention
MAIN.shm_cycles 277 0.00 SHM cycles through buffer
MAIN.sms_nreq 0 0.00 SMS allocator requests
MAIN.sms_nobj 0 . SMS outstanding allocations
MAIN.sms_nbytes 0 . SMS outstanding bytes
MAIN.sms_balloc 0 . SMS bytes allocated
MAIN.sms_bfree 0 . SMS bytes freed
MAIN.backend_req 1298448 18.39 Backend requests made
MAIN.n_vcl 1 0.00 Number of loaded VCLs in total
MAIN.n_vcl_avail 1 0.00 Number of VCLs available
MAIN.n_vcl_discard 0 0.00 Number of discarded VCLs
MAIN.bans 1 . Count of bans
MAIN.bans_completed 1 . Number of bans marked 'completed'
MAIN.bans_obj 0 . Number of bans using obj.*
MAIN.bans_req 0 . Number of bans using req.*
MAIN.bans_added 1 0.00 Bans added
MAIN.bans_deleted 0 0.00 Bans deleted
MAIN.bans_tested 0 0.00 Bans tested against objects (lookup)
MAIN.bans_obj_killed 0 0.00 Objects killed by bans (lookup)
MAIN.bans_lurker_tested 0 0.00 Bans tested against objects (lurker)
MAIN.bans_tests_tested 0 0.00 Ban tests tested against objects (lookup)
MAIN.bans_lurker_tests_tested 0 0.00 Ban tests tested against objects (lurker)
MAIN.bans_lurker_obj_killed 0 0.00 Objects killed by bans (lurker)
MAIN.bans_dups 0 0.00 Bans superseded by other bans
MAIN.bans_lurker_contention 0 0.00 Lurker gave way for lookup
MAIN.bans_persisted_bytes 13 . Bytes used by the persisted ban lists
MAIN.bans_persisted_fragmentation 0 . Extra bytes in persisted ban lists due to fragmentation
MAIN.n_purges 0 . Number of purge operations executed
MAIN.n_obj_purged 0 . Number of purged objects
MAIN.exp_mailed 949607 13.45 Number of objects mailed to expiry thread
MAIN.exp_received 949607 13.45 Number of objects received by expiry thread
MAIN.hcb_nolock 6001341 84.99 HCB Lookups without lock
MAIN.hcb_lock 447556 6.34 HCB Lookups with lock
MAIN.hcb_insert 447556 6.34 HCB Inserts
MAIN.esi_errors 0 0.00 ESI parse errors (unlock)
MAIN.esi_warnings 0 0.00 ESI parse warnings (unlock)
MAIN.vmods 2 . Loaded VMODs
MAIN.n_gzip 558747 7.91 Gzip operations
MAIN.n_gunzip 22866 0.32 Gunzip operations
MAIN.vsm_free 970832 . Free VSM space
MAIN.vsm_used 83963776 . Used VSM space
MAIN.vsm_cooling 0 . Cooling VSM space
MAIN.vsm_overflow 0 . Overflow VSM space
MAIN.vsm_overflowed 0 0.00 Overflowed VSM space
MGT.uptime 70613 1.00 Management process uptime
MGT.child_start 1 0.00 Child process started
MGT.child_exit 0 0.00 Child process normal exit
MGT.child_stop 0 0.00 Child process unexpected exit
MGT.child_died 0 0.00 Child process died (signal)
MGT.child_dump 0 0.00 Child process core dumped
MGT.child_panic 0 0.00 Child process panic
MEMPOOL.vbc.live 24 . In use
MEMPOOL.vbc.pool 10 . In Pool
MEMPOOL.vbc.sz_wanted 88 . Size requested
MEMPOOL.vbc.sz_needed 120 . Size allocated
MEMPOOL.vbc.allocs 19491 0.28 Allocations
MEMPOOL.vbc.frees 19467 0.28 Frees
MEMPOOL.vbc.recycle 19436 0.28 Recycled from pool
MEMPOOL.vbc.timeout 11998 0.17 Timed out from pool
MEMPOOL.vbc.toosmall 0 0.00 Too small to recycle
MEMPOOL.vbc.surplus 0 0.00 Too many for pool
MEMPOOL.vbc.randry 55 0.00 Pool ran dry
MEMPOOL.busyobj.live 6 . In use
MEMPOOL.busyobj.pool 9 . In Pool
MEMPOOL.busyobj.sz_wanted 65536 . Size requested
MEMPOOL.busyobj.sz_needed 65568 . Size allocated
MEMPOOL.busyobj.allocs 1298643 18.39 Allocations
MEMPOOL.busyobj.frees 1298637 18.39 Frees
MEMPOOL.busyobj.recycle 1298436 18.39 Recycled from pool
MEMPOOL.busyobj.timeout 41750 0.59 Timed out from pool
MEMPOOL.busyobj.toosmall 0 0.00 Too small to recycle
MEMPOOL.busyobj.surplus 0 0.00 Too many for pool
MEMPOOL.busyobj.randry 207 0.00 Pool ran dry
MEMPOOL.req0.live 4 . In use
MEMPOOL.req0.pool 9 . In Pool
MEMPOOL.req0.sz_wanted 65536 . Size requested
MEMPOOL.req0.sz_needed 65568 . Size allocated
MEMPOOL.req0.allocs 423162 5.99 Allocations
MEMPOOL.req0.frees 423158 5.99 Frees
MEMPOOL.req0.recycle 423143 5.99 Recycled from pool
MEMPOOL.req0.timeout 36313 0.51 Timed out from pool
MEMPOOL.req0.toosmall 0 0.00 Too small to recycle
MEMPOOL.req0.surplus 0 0.00 Too many for pool
MEMPOOL.req0.randry 19 0.00 Pool ran dry
MEMPOOL.sess0.live 4 . In use
MEMPOOL.sess0.pool 9 . In Pool
MEMPOOL.sess0.sz_wanted 384 . Size requested
MEMPOOL.sess0.sz_needed 416 . Size allocated
MEMPOOL.sess0.allocs 21655 0.31 Allocations
MEMPOOL.sess0.frees 21651 0.31 Frees
MEMPOOL.sess0.recycle 21642 0.31 Recycled from pool
MEMPOOL.sess0.timeout 10076 0.14 Timed out from pool
MEMPOOL.sess0.toosmall 0 0.00 Too small to recycle
MEMPOOL.sess0.surplus 0 0.00 Too many for pool
MEMPOOL.sess0.randry 13 0.00 Pool ran dry
MEMPOOL.req1.live 6 . In use
MEMPOOL.req1.pool 9 . In Pool
MEMPOOL.req1.sz_wanted 65536 . Size requested
MEMPOOL.req1.sz_needed 65568 . Size allocated
MEMPOOL.req1.allocs 418423 5.93 Allocations
MEMPOOL.req1.frees 418417 5.93 Frees
MEMPOOL.req1.recycle 418406 5.93 Recycled from pool
MEMPOOL.req1.timeout 35924 0.51 Timed out from pool
MEMPOOL.req1.toosmall 0 0.00 Too small to recycle
MEMPOOL.req1.surplus 0 0.00 Too many for pool
MEMPOOL.req1.randry 17 0.00 Pool ran dry
MEMPOOL.sess1.live 6 . In use
MEMPOOL.sess1.pool 10 . In Pool
MEMPOOL.sess1.sz_wanted 384 . Size requested
MEMPOOL.sess1.sz_needed 416 . Size allocated
MEMPOOL.sess1.allocs 21659 0.31 Allocations
MEMPOOL.sess1.frees 21653 0.31 Frees
MEMPOOL.sess1.recycle 21645 0.31 Recycled from pool
MEMPOOL.sess1.timeout 10040 0.14 Timed out from pool
MEMPOOL.sess1.toosmall 0 0.00 Too small to recycle
MEMPOOL.sess1.surplus 0 0.00 Too many for pool
MEMPOOL.sess1.randry 14 0.00 Pool ran dry
SMA.s0.c_req 1349644 19.11 Allocator requests
SMA.s0.c_fail 0 0.00 Allocator failures
SMA.s0.c_bytes 22210720975 314541.53 Bytes allocated
SMA.s0.c_freed 19148751042 271178.83 Bytes freed
SMA.s0.g_alloc 105992 . Allocations outstanding
SMA.s0.g_bytes 3061969933 . Bytes outstanding
SMA.s0.g_space 2306739187 . Bytes available
SMA.Transient.c_req 1343403 19.02 Allocator requests
SMA.Transient.c_fail 0 0.00 Allocator failures
SMA.Transient.c_bytes 24207322266 342816.79 Bytes allocated
SMA.Transient.c_freed 24201619786 342736.04 Bytes freed
SMA.Transient.g_alloc 7499 . Allocations outstanding
SMA.Transient.g_bytes 5702480 . Bytes outstanding
SMA.Transient.g_space 0 . Bytes available
VBE.backend1([IP]).vcls 1 . VCL references
VBE.backend1([IP]).happy 18446744073709551615 . Happy health probes
VBE.backend1([IP]).bereq_hdrbytes 173320400 2454.51 Request header bytes
VBE.backend1([IP]).bereq_bodybytes 238971 3.38 Request body bytes
VBE.backend1([IP]).beresp_hdrbytes 124704577 1766.03 Response header bytes
VBE.backend1([IP]).beresp_bodybytes 19209840560 272043.97 Response body bytes
VBE.backend1([IP]).pipe_hdrbytes 14288 0.20 Pipe request header bytes
VBE.backend1([IP]).pipe_out 8069 0.11 Piped bytes to backend
VBE.backend1([IP]).pipe_in 335893 4.76 Piped bytes from backend
VBE.backend2([IP]).vcls 1 . VCL references
VBE.backend2([IP]).happy 18446744073709551615 . Happy health probes
VBE.backend2([IP]).bereq_hdrbytes 173379423 2455.35 Request header bytes
VBE.backend2([IP]).bereq_bodybytes 76962 1.09 Request body bytes
VBE.backend2([IP]).beresp_hdrbytes 124652416 1765.29 Response header bytes
VBE.backend2([IP]).beresp_bodybytes 18690565655 264690.15 Response body bytes
VBE.backend2([IP]).pipe_hdrbytes 14629 0.21 Pipe request header bytes
VBE.backend2([IP]).pipe_out 8558 0.12 Piped bytes to backend
VBE.backend2([IP]).pipe_in 284168 4.02 Piped bytes from backend
VBE.backend3([IP]).vcls 1 . VCL references
VBE.backend3([IP]).happy 18446744073709551615 . Happy health probes
VBE.backend3([IP]).bereq_hdrbytes 173448768 2456.33 Request header bytes
VBE.backend3([IP]).bereq_bodybytes 75294 1.07 Request body bytes
VBE.backend3([IP]).beresp_hdrbytes 124641060 1765.13 Response header bytes
VBE.backend3([IP]).beresp_bodybytes 18738758550 265372.64 Response body bytes
VBE.backend3([IP]).pipe_hdrbytes 17940 0.25 Pipe request header bytes
VBE.backend3([IP]).pipe_out 16704 0.24 Piped bytes to backend
VBE.backend3([IP]).pipe_in 301836 4.27 Piped bytes from backend
VBE.backend4([IP]).vcls 1 . VCL references
VBE.backend4([IP]).happy 18446744073709551615 . Happy health probes
VBE.backend4([IP]).bereq_hdrbytes 173265357 2453.73 Request header bytes
VBE.backend4([IP]).bereq_bodybytes 227023 3.22 Request body bytes
VBE.backend4([IP]).beresp_hdrbytes 124724341 1766.31 Response header bytes
VBE.backend4([IP]).beresp_bodybytes 18642562615 264010.35 Response body bytes
VBE.backend4([IP]).pipe_hdrbytes 22537 0.32 Pipe request header bytes
VBE.backend4([IP]).pipe_out 12367 0.18 Piped bytes to backend
VBE.backend4([IP]).pipe_in 383919 5.44 Piped bytes from backend
LCK.sma.creat 2 0.00 Created locks
LCK.sma.destroy 0 0.00 Destroyed locks
LCK.sma.locks 5272603 74.67 Lock Operations
LCK.hcb.locks 837080 11.85 Lock Operations
LCK.hcl.creat 0 0.00 Created locks
LCK.hcl.destroy 0 0.00 Destroyed locks
LCK.hcl.locks 0 0.00 Lock Operations
LCK.vcl.creat 1 0.00 Created locks
LCK.vcl.destroy 0 0.00 Destroyed locks
LCK.vcl.locks 2604799 36.89 Lock Operations
LCK.sess.creat 43306 0.61 Created locks
LCK.sess.destroy 43304 0.61 Destroyed locks
LCK.sess.locks 4765 0.07 Lock Operations
LCK.wstat.creat 1 0.00 Created locks
LCK.wstat.destroy 0 0.00 Destroyed locks
LCK.wstat.locks 3421304 48.45 Lock Operations
LCK.wq.locks 6449131 91.33 Lock Operations
LCK.objhdr.creat 447638 6.34 Created locks
LCK.objhdr.destroy 387644 5.49 Destroyed locks
LCK.objhdr.locks 42615452 603.51 Lock Operations
LCK.exp.creat 1 0.00 Created locks
LCK.exp.destroy 0 0.00 Destroyed locks
LCK.exp.locks 4462106 63.19 Lock Operations
LCK.lru.creat 2 0.00 Created locks
LCK.lru.destroy 0 0.00 Destroyed locks
LCK.lru.locks 4259219 60.32 Lock Operations
LCK.cli.creat 1 0.00 Created locks
LCK.cli.destroy 0 0.00 Destroyed locks
LCK.cli.locks 23549 0.33 Lock Operations
LCK.ban.creat 1 0.00 Created locks
LCK.ban.destroy 0 0.00 Destroyed locks
LCK.ban.locks 1594008 22.57 Lock Operations
LCK.vbp.creat 1 0.00 Created locks
LCK.vbp.destroy 0 0.00 Destroyed locks
LCK.vbp.locks 112922 1.60 Lock Operations
LCK.backend.locks 2626872 37.20 Lock Operations
LCK.vcapace.creat 1 0.00 Created locks
*Had to remove some (uneventful parts) from the log due to message limit.
In this I calculated "other non-cacheable requests" by client_req - (cache_hit + cache_hitpass + cache_miss) = 436880. That along with cache_hitpass and cache misses (or just client_req-cache-hit) which are not cached brings the total to 586699, or about 18.7%. If they are heavy requests I suppose that could account for the traffic. But I'm a bit unconvinced.
Have you tried to look at the access log of one of the servers? Maybe you have requests coming in not through Varnish?
Also, I know that at least in Varnish 3, the cache hit rate is calculated from hits that can come from cache to begin with. For example, with a standard configuration, POST requests are not counted there.
The access log may give you some insight...

How to understand ORA-00060 deadlock trace file

Recently I got a ORA-00060 deadlock error.
I read this post and this post and this post but I'm not sure what the problem is: unindexed FK cause this or other problem.
My question is how to understand this trace file and how to solve it?
Below is the trace file:
*** 2015-06-02 14:53:45.513
DEADLOCK DETECTED ( ORA-00060 )
[Transaction Deadlock]
The following deadlock is not an ORACLE error. It is a
deadlock due to user error in the design of an application
or from issuing incorrect ad-hoc SQL. The following
information may aid in determining the deadlock:
Deadlock graph:
---------Blocker(s)-------- ---------Waiter(s)---------
Resource Name process session holds waits process session holds waits
TM-00014d94-00000000 497 556 S 332 1414 SX
TM-00014d94-00000000 332 1414 SX 416 1038 S
TX-0011000f-000000ab 416 1038 X 302 457 S
TM-00014d94-00000000 302 457 SX 497 556 S
session 556: DID 0001-01F1-0000000D session 1414: DID 0001-014C-00000022
session 1414: DID 0001-014C-00000022 session 1038: DID 0001-01A0-0000000C
session 1038: DID 0001-01A0-0000000C session 457: DID 0001-012E-00000028
session 457: DID 0001-012E-00000028 session 556: DID 0001-01F1-0000000D
Rows waited on:
Session 556: obj - rowid = 00014D94 - AAAAAAAAAAAAAAAAAA
(dictionary objn - 85396, file - 0, block - 0, slot - 0)
Session 1414: obj - rowid = 00014D94 - AAAAAAAAAAAAAAAAAA
(dictionary objn - 85396, file - 0, block - 0, slot - 0)
Session 1038: obj - rowid = 00014D94 - AAAAAAAAAAAAAAAAAA
(dictionary objn - 85396, file - 0, block - 0, slot - 0)
Session 457: obj - rowid = 00014FA0 - AAAU+gAAEAAAft+AAA
(dictionary objn - 85920, file - 4, block - 129918, slot - 0)
----- Information for the OTHER waiting sessions -----
Session 1414:
sid: 1414 ser: 1424 audsid: 100128 user: 91/SW flags: 0x45
pid: 332 O/S info: user: oracle, term: UNKNOWN, ospid: 10179
image: oracle#jwdb
client details:
O/S info: user: root, term: unknown, ospid: 1234
machine: localhost.localdomain program: JDBC Thin Client
application name: JDBC Thin Client, hash value=2546894660
current SQL:
insert into t_course_takes (created_at, updated_at, attend, course_id, course_take_type_id, election_mode_id, lesson_id, limit_group_id, paid, remark, semester_id, state, std_id, turn, virtual_cost, id) values (:1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 )
Session 1038:
sid: 1038 ser: 951 audsid: 100212 user: 91/SW flags: 0x45
pid: 416 O/S info: user: oracle, term: UNKNOWN, ospid: 10343
image: oracle#jwdb
client details:
O/S info: user: root, term: unknown, ospid: 1234
machine: localhost.localdomain program: JDBC Thin Client
application name: JDBC Thin Client, hash value=2546894660
current SQL:
delete from t_course_takes where id=:1
Session 457:
sid: 457 ser: 2983 audsid: 100099 user: 91/SW flags: 0x45
pid: 302 O/S info: user: oracle, term: UNKNOWN, ospid: 10111
image: oracle#jwdb
client details:
O/S info: user: root, term: unknown, ospid: 1234
machine: jdbcclient program: JDBC Thin Client
application name: JDBC Thin Client, hash value=2546894660
current SQL:
insert into t_elect_loggers (created_at, updated_at, course_code, course_name, course_take_type_id, course_type, credits, election_mode_id, ip_address, lesson_no, operator_code, operator_name, project_id, remark, screening, semester_id, std_code, std_name, turn, type, virtual_orig, virtual_rest, id) values (:1 , :2 , :3 , :4 , :5 , :6 , :7 , :8 , :9 , :10 , :11 , :12 , :13 , :14 , :15 , :16 , :17 , :18 , :19 , :20 , :21 , :22 , :23 )
----- End of information for the OTHER waiting sessions -----
Information for THIS session:
----- Current SQL Statement for this session (sql_id=ca9jc1g44ap41) -----
delete from t_course_takes where id=:1
===================================================
PROCESS STATE
-------------
Process global information:
process: 0x9d0fd98c8, call: 0x95429a500, xact: 0x922b10710, curses: 0x94110e198, usrses: 0x94110e198
----------------------------------------
SO: 0x9d0fd98c8, type: 2, owner: (nil), flag: INIT/-/-/0x00 if: 0x3 c: 0x3
proc=0x9d0fd98c8, name=process, file=ksu.h LINE:11459, pg=0
(process) Oracle pid:497, ser:7, calls cur/top: 0x95429a500/0x95429a500
flags : (0x0) -
flags2: (0x0), flags3: (0x0)
intr error: 0, call error: 0, sess error: 0, txn error 0
intr queue: empty
ksudlp FALSE at location: 0
(post info) last post received: 0 0 9
last post received-location: ksq.h LINE:1877 ID:ksqrcl
last process to post me: 900fd0348 12 0
last post sent: 0 0 9
last post sent-location: ksq.h LINE:1877 ID:ksqrcl
last process posted by me: 900fce2c8 17 0
(latch info) wait_event=0 bits=0
Process Group: DEFAULT, pseudo proc: 0x90102ea98
O/S info: user: oracle, term: UNKNOWN, ospid: 10507
OSD pid info: Unix process pid: 10507, image: oracle#jwdb
Dump of memory from 0x0000000921009C90 to 0x0000000921009E98
921009C90 00000000 00000000 00000000 00000000 [................]
Repeat 31 times
921009E90 00000000 00000000 [........]
(FOB) flags=2050 fib=0x902c3c2b8 incno=0 pending i/o cnt=0
fname=/home/jwdb/oracle/oradata/orcl/undotbs01.dbf
fno=3 lblksz=8192 fsiz=238080
(FOB) flags=2050 fib=0x902c3c8b8 incno=0 pending i/o cnt=0
fname=/home/jwdb/oracle/oradata/orcl/users01.dbf
fno=4 lblksz=8192 fsiz=603680
(FOB) flags=2050 fib=0x902c3b6a0 incno=0 pending i/o cnt=0
fname=/home/jwdb/oracle/oradata/orcl/system01.dbf
fno=1 lblksz=8192 fsiz=92160
----------------------------------------
SO: 0x94110e198, type: 4, owner: 0x9d0fd98c8, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
proc=0x9d0fd98c8, name=session, file=ksu.h LINE:11467, pg=0
(session) sid: 556 ser: 3224 trans: 0x922b10710, creator: 0x9d0fd98c8
flags: (0x45) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
flags2: (0x40008) -/-
DID: , short-term DID:
txn branch: (nil)
oct: 7, prv: 0, sql: 0x9cfed0be0, psql: 0x9afeb20c8, user: 91/SW
ksuxds FALSE at location: 0
service name: SYS$USERS
client details:
O/S info: user: root, term: unknown, ospid: 1234
machine: localhost.localdomain program: JDBC Thin Client
application name: JDBC Thin Client, hash value=2546894660
Current Wait Stack:
0: waiting for 'enq: TM - contention'
name|mode=0x544d0004, object #=0x14d94, table/partition=0x0
wait_id=787 seq_num=896 snap_id=53
wait times: snap=0.023828 sec, exc=4 min 18 sec, total=4 min 18 sec
wait times: max=infinite, heur=4 min 18 sec
wait counts: calls=87 os=87
in_wait=1 iflags=0x15a0
There is at least one session blocking this session.
Dumping first 3 direct blockers:
inst: 1, sid: 457, ser: 2983
inst: 1, sid: 1353, ser: 5618
inst: 1, sid: 907, ser: 5215
Dumping final blocker:
inst: 1, sid: 1168, ser: 1194
There are 1 sessions blocked by this session.
Dumping one waiter:
inst: 1, sid: 1136, ser: 2212
wait event: 'enq: TM - contention'
p1: 'name|mode'=0x544d0004
p2: 'object #'=0x14d94
p3: 'table/partition'=0x0
row_wait_obj#: 85396, block#: 0, row#: 0, file# 0
min_blocked_time: 12 secs, waiter_cache_ver: 32536
Wait State:
fixed_waits=0 flags=0x23 boundary=(nil)/-1
Session Wait History:
elapsed time of 0.000000 sec since current wait
0: waited for 'latch: enqueue hash chains'
address=0x9313226a0, number=0x1c, tries=0x0
wait_id=839 seq_num=895 snap_id=1
wait times: snap=0.226082 sec, exc=0.226082 sec, total=0.226082 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000000 sec of elapsed time
1: waited for 'enq: TM - contention'
name|mode=0x544d0004, object #=0x14d94, table/partition=0x0
wait_id=787 seq_num=894 snap_id=52
wait times: snap=3.000901 sec, exc=4 min 18 sec, total=4 min 18 sec
wait times: max=infinite
wait counts: calls=87 os=87
occurred after 0.000000 sec of elapsed time
2: waited for 'latch: enqueue hash chains'
address=0x6000cf38, number=0x1c, tries=0x0
wait_id=838 seq_num=893 snap_id=1
wait times: snap=0.000142 sec, exc=0.000142 sec, total=0.000142 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000000 sec of elapsed time
3: waited for 'enq: TM - contention'
name|mode=0x544d0004, object #=0x14d94, table/partition=0x0
wait_id=787 seq_num=892 snap_id=51
wait times: snap=12.003822 sec, exc=4 min 15 sec, total=4 min 15 sec
wait times: max=infinite
wait counts: calls=86 os=86
occurred after 0.000000 sec of elapsed time
4: waited for 'latch: enqueue hash chains'
address=0x6000cf38, number=0x1c, tries=0x0
wait_id=837 seq_num=891 snap_id=1
wait times: snap=0.000170 sec, exc=0.000170 sec, total=0.000170 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000000 sec of elapsed time
5: waited for 'enq: TM - contention'
name|mode=0x544d0004, object #=0x14d94, table/partition=0x0
wait_id=787 seq_num=890 snap_id=50
wait times: snap=6.001627 sec, exc=4 min 3 sec, total=4 min 3 sec
wait times: max=infinite
wait counts: calls=82 os=82
occurred after 0.000000 sec of elapsed time
6: waited for 'latch: enqueue hash chains'
address=0x6000cf38, number=0x1c, tries=0x0
wait_id=836 seq_num=889 snap_id=1
wait times: snap=0.000378 sec, exc=0.000378 sec, total=0.000378 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000000 sec of elapsed time
7: waited for 'enq: TM - contention'
name|mode=0x544d0004, object #=0x14d94, table/partition=0x0
wait_id=787 seq_num=888 snap_id=49
wait times: snap=3.000543 sec, exc=3 min 57 sec, total=3 min 57 sec
wait times: max=infinite
wait counts: calls=80 os=80
occurred after 0.000000 sec of elapsed time
8: waited for 'latch: enqueue hash chains'
address=0x6000cf38, number=0x1c, tries=0x0
wait_id=835 seq_num=887 snap_id=1
wait times: snap=0.000350 sec, exc=0.000350 sec, total=0.000350 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000000 sec of elapsed time
9: waited for 'enq: TM - contention'
name|mode=0x544d0004, object #=0x14d94, table/partition=0x0
wait_id=787 seq_num=886 snap_id=48
wait times: snap=3.000880 sec, exc=3 min 54 sec, total=3 min 54 sec
wait times: max=infinite
wait counts: calls=79 os=79
occurred after 0.000000 sec of elapsed time
Updated on 6/5/2015
The whole trace file is here
This ORA-00060 was causing problem to my team also. The trace file was showing the blocking of two session each other as TX--- X --------S. In our case we were sure that the multithreaded environment is distributed on unique_number column such that two threads will not update the same record. Further down the trace file it showed "enq: TX - allocate ITL entry". When the processing was running I checked the kind of waits:
select blocking_session, sid, serial#, wait_class, seconds_in_wait
from
v$session
where
blocking_session is not NULL
order by
blocking_session;
And it was showing the wait class is "Configure". So, I increased the initrans of the tables used by the processing. Then also reduced the batch size so that commit happens more frequently then earlier. After that the problem is solved.

Deadlock in Oracle 3

I have found following errors on Oracle..
I cant understand what is happening here.
Cant understand which session is waiting for what....
Also is it about Raw level lock or something?
Can anyone please help me?
*** 2015-03-10 10:23:30.288
DEADLOCK DETECTED ( ORA-00060 )
[Transaction Deadlock]
The following deadlock is not an ORACLE error. It is a
deadlock due to user error in the design of an application
or from issuing incorrect ad-hoc SQL. The following
information may aid in determining the deadlock:
Deadlock graph:
---------Blocker(s)-------- ---------Waiter(s)---------
Resource Name process session holds waits process session holds waits
TX-001c0006-0000a440 94 2903 X 123 2284 X
TX-001d0011-0000fac7 123 2284 X 94 2903 X
session 2903: DID 0001-005E-00018DE5 session 2284: DID 0001-007B-0001863D
session 2284: DID 0001-007B-0001863D session 2903: DID 0001-005E-00018DE5
Rows waited on:
Session 2903: obj - rowid = 0001285E - AAASheAAIAABMBIAAV
(dictionary objn - 75870, file - 8, block - 311368, slot - 21)
Session 2284: obj - rowid = 0001285E - AAASheAAIAABL9/AAq
(dictionary objn - 75870, file - 8, block - 311167, slot - 42)
----- Information for the OTHER waiting sessions -----
Session 2284:
sid: 2284 ser: 207 audsid: 2893404 user: 87/ESS_ADMIN flags: 0x45
pid: 123 O/S info: user: oracle, term: UNKNOWN, ospid: 3209
image: oracle#pbifmsdb2
client details:
O/S info: user: root, term: unknown, ospid: 1234
machine: pbifmsapp2 program: JDBC Thin Client
application name: JDBC Thin Client, hash value=2546894660
current SQL:
UPDATE SEC_LOGIN_AUDIT SET LOGOUT_TIME= SYSDATE,LOGOUT_TYPE=:1 ,LST_UPDT_DT= SYSDATE WHERE UPPER(USER_NAME) IN UPPER(:2 ) AND LOGOUT_TYPE IS NULL AND TRUNC(LOGIN_DATE_TIME) BETWEEN TRUNC(SYSDATE)-1 AND TRUNC(SYSDATE)
----- End of information for the OTHER waiting sessions -----
Information for THIS session:
----- Current SQL Statement for this session (sql_id=cm6x9vt91y3v3) -----
UPDATE SEC_LOGIN_AUDIT SET LOGOUT_TIME= SYSDATE,LOGOUT_TYPE=:1 ,LST_UPDT_DT= SYSDATE WHERE UPPER(USER_NAME) IN UPPER(:2 ) AND LOGOUT_TYPE IS NULL AND TRUNC(LOGIN_DATE_TIME) BETWEEN TRUNC(SYSDATE)-1 AND TRUNC(SYSDATE)
===================================================
PROCESS STATE
-------------
Process global information:
process: 0xc000001154e37f70, call: 0xc00000113a5ee668, xact: 0xc0000011489d4808, curses: 0xc0000011598a5760, usrses: 0xc0000011598a5760
----------------------------------------
SO: 0xc000001154e37f70, type: 2, owner: 0x0000000000000000, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
proc=0xc000001154e37f70, name=process, file=ksu.h LINE:11459 ID:, pg=0
(process) Oracle pid:94, ser:1, calls cur/top: 0xc00000113a5ee668/0xc00000113a5ee668
flags : (0x0) -
flags2: (0x0), flags3: (0x0)
intr error: 0, call error: 0, sess error: 0, txn error 0
intr queue: empty
ksudlp FALSE at location: 0
(post info) last post received: 134 0 2
last post received-location: ksl2.h LINE:2165 ID:kslpsr
last process to post me: c00000115cda7358 10 6
last post sent: 0 0 26
last post sent-location: ksa2.h LINE:282 ID:ksasnd
last process posted by me: c00000115cda7358 10 6
(latch info) wait_event=0 bits=0
Process Group: DEFAULT, pseudo proc: 0xc000001170f9b220
O/S info: user: oracle, term: UNKNOWN, ospid: 9438
OSD pid info: Unix process pid: 9438, image: oracle#pbifmsdb2
Dump of memory from 0xC000001154DE40C8 to 0xC000001154DE42D0
C000001154DE40C0 00000000 00000000 [........]
C000001154DE40D0 00000000 00000000 00000000 00000000 [................]
Repeat 31 times
(FOB) flags=2066 fib=c000001173a56518 incno=0 pending i/o cnt=0
fname=/iwdmsdata/PIWDMS/DATA/ess_data.dbf
fno=8 lblksz=8192 fsiz=339200
(FOB) flags=2066 fib=c000001173a55900 incno=0 pending i/o cnt=0
fname=/iwdmsdata/PIWDMS/DATA/iwas_data.dbf
fno=6 lblksz=8192 fsiz=3678848
(FOB) flags=2050 fib=c000001173a58348 incno=0 pending i/o cnt=0
fname=/iwdmsdata/PIWDMS/DATA/temp01.dbf
fno=201 lblksz=8192 fsiz=4194176
(FOB) flags=2050 fib=c000001173a56518 incno=0 pending i/o cnt=0
fname=/iwdmsdata/PIWDMS/DATA/ess_data.dbf
fno=8 lblksz=8192 fsiz=339200
(FOB) flags=2050 fib=c000001173a546d0 incno=0 pending i/o cnt=0
fname=/iwdmsdata/PIWDMS/DATA/undotbs01.dbf
fno=3 lblksz=8192 fsiz=231040
(FOB) flags=2050 fib=c000001173a55f00 incno=0 pending i/o cnt=0
fname=/iwdmsdata/PIWDMS/DATA/iwas_index.dbf
fno=7 lblksz=8192 fsiz=470400
(FOB) flags=2050 fib=c000001173a55900 incno=0 pending i/o cnt=0
fname=/iwdmsdata/PIWDMS/DATA/iwas_data.dbf
fno=6 lblksz=8192 fsiz=3678848
(FOB) flags=2050 fib=c000001173a53ab8 incno=0 pending i/o cnt=0
fname=/iwdmsdata/PIWDMS/DATA/system01.dbf
fno=1 lblksz=8192 fsiz=204800
----------------------------------------
SO: 0xc0000011598a5760, type: 4, owner: 0xc000001154e37f70, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
proc=0xc000001154e37f70, name=session, file=ksu.h LINE:11467 ID:, pg=0
(session) sid: 2903 ser: 7 trans: 0xc0000011489d4808, creator: 0xc000001154e37f70
flags: (0x45) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
flags2: (0x40008) -/-
DID: , short-term DID:
txn branch: 0xc00000114052f870
oct: 6, prv: 0, sql: 0xc00000116796d070, psql: 0xc0000011675cd1f0, user: 87/ESS_ADMIN
ksuxds FALSE at location: 0
service name: SYS$USERS
client details:
O/S info: user: root, term: unknown, ospid: 1234
machine: pbifmsapp2 program: JDBC Thin Client
application name: JDBC Thin Client, hash value=2546894660
Current Wait Stack:
0: waiting for 'enq: TX - row lock contention'
name|mode=0x54580006, usn<<16 | slot=0x1d0011, sequence=0xfac7
wait_id=471131 seq_num=12392 snap_id=1
wait times: snap=3.004466 sec, exc=3.004466 sec, total=3.004466 sec
wait times: max=1 min 0 sec, heur=3.004466 sec
wait counts: calls=1 os=1
in_wait=1 iflags=0x15a0
There is at least one session blocking this session.
Dumping 1 direct blocker(s):
inst: 1, sid: 2284, ser: 207
Dumping final blocker:
inst: 1, sid: 2284, ser: 207
Wait State:
fixed_waits=0 flags=0x22 boundary=0x0000000000000000/-1
Session Wait History:
elapsed time of 1.625218 sec since current wait
0: waited for 'SQL*Net message from client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471130 seq_num=12391 snap_id=1
wait times: snap=0.000630 sec, exc=0.000630 sec, total=0.000630 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000003 sec of elapsed time
1: waited for 'SQL*Net message to client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471129 seq_num=12390 snap_id=1
wait times: snap=0.000000 sec, exc=0.000000 sec, total=0.000000 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000039 sec of elapsed time
2: waited for 'SQL*Net message from client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471128 seq_num=12389 snap_id=1
wait times: snap=0.002370 sec, exc=0.002370 sec, total=0.002370 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000001 sec of elapsed time
3: waited for 'SQL*Net message to client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471127 seq_num=12388 snap_id=1
wait times: snap=0.000001 sec, exc=0.000001 sec, total=0.000001 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000069 sec of elapsed time
4: waited for 'SQL*Net message from client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471126 seq_num=12387 snap_id=1
wait times: snap=0.000659 sec, exc=0.000659 sec, total=0.000659 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000004 sec of elapsed time
5: waited for 'SQL*Net message to client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471125 seq_num=12386 snap_id=1
wait times: snap=0.000001 sec, exc=0.000001 sec, total=0.000001 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.001259 sec of elapsed time
6: waited for 'SQL*Net message from client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471124 seq_num=12385 snap_id=1
wait times: snap=0.000447 sec, exc=0.000447 sec, total=0.000447 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000036 sec of elapsed time
7: waited for 'SQL*Net message to client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471123 seq_num=12384 snap_id=1
wait times: snap=0.000006 sec, exc=0.000006 sec, total=0.000006 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 1.741446 sec of elapsed time
8: waited for 'SQL*Net message from client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471122 seq_num=12383 snap_id=1
wait times: snap=0.001060 sec, exc=0.001060 sec, total=0.001060 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000002 sec of elapsed time
9: waited for 'SQL*Net message to client'
driver id=0x74637000, #bytes=0x1, =0x0
wait_id=471121 seq_num=12382 snap_id=1
wait times: snap=0.000001 sec, exc=0.000001 sec, total=0.000001 sec
wait times: max=infinite
wait counts: calls=0 os=0
occurred after 0.000038 sec of elapsed time
Sampled Session History of session 2903 serial 7
---------------------------------------------------
The sampled session history is constructed by sampling
the target session every 1 second. The sampling process
captures at each sample if the session is in a non-idle wait,
an idle wait, or not in a wait. If the session is in a
non-idle wait then one interval is shown for all the samples
the session was in the same non-idle wait. If the
session is in an idle wait or not in a wait for
consecutive samples then one interval is shown for all
the consecutive samples. Though we display these consecutive
samples in a single interval the session may NOT be continuously
idle or not in a wait (the sampling process does not know).
The history is displayed in reverse chronological order.
sample interval: 1 sec, max history 120 sec
---------------------------------------------------
[3 samples, 10:23:27 - 10:23:29]
waited for 'enq: TX - row lock contention', seq_num: 12392
p1: 'name|mode'=0x54580006
p2: 'usn<<16 | slot'=0x1d0011
p3: 'sequence'=0xfac7
time_waited: >= 2 sec (still in wait)
[3 samples, 10:23:24 - 10:23:26]
not in wait at each sample
[13 samples, 10:23:11 - 10:23:23]
idle wait at each sample
[1 sample, 10:23:10]
not in wait at each sample
[8 samples, 10:23:02 - 10:23:09]
idle wait at each sample
[2 samples, 10:23:00 - 10:23:01]
not in wait at each sample
[5 samples, 10:22:54 - 10:22:59]
idle wait at each sample
[2 samples, 10:22:52 - 10:22:53]
not in wait at each sample
[1 sample, 10:22:51]
idle wait at each sample
[1 sample, 10:22:50]
not in wait at each sample
[2 samples, 10:22:48 - 10:22:49]
idle wait at each sample
[2 samples, 10:22:46 - 10:22:47]
not in wait at each sample
[9 samples, 10:22:37 - 10:22:45]
idle wait at each sample
[2 samples, 10:22:35 - 10:22:36]
not in wait at each sample
[1 sample, 10:22:34]
idle wait at each sample
[2 samples, 10:22:32 - 10:22:33]
not in wait at each sample
[1 sample, 10:22:31]
idle wait at each sample
[1 sample, 10:22:30]
not in wait at each sample
[1 sample, 10:22:29]
idle wait at each sample
[2 samples, 10:22:27 - 10:22:28]
not in wait at each sample
[1 sample, 10:22:26]
idle wait at each sample
[1 sample, 10:22:25]
waited for 'db file scattered read', seq_num: 9258
p1: 'file#'=0x6
p2: 'block#'=0x1fecd0
p3: 'blocks'=0x4
time_waited: 0.007933 sec (sample interval: 0 sec)
[5 samples, 10:22:20 - 10:22:24]
idle wait at each sample
[4 samples, 10:22:16 - 10:22:19]
not in wait at each sample
[3 samples, 10:22:13 - 10:22:15]
idle wait at each sample
[2 samples, 10:22:11 - 10:22:12]
not in wait at each sample
[7 samples, 10:22:04 - 10:22:10]
idle wait at each sample
[6 samples, 10:21:58 - 10:22:03]
not in wait at each sample
[30 samples, 10:21:30 - 10:21:57]
idle wait at each sample
---------------------------------------------------
Sampled Session History Summary:
longest_non_idle_wait: 'enq: TX - row lock contention'
[3 samples, 10:23:27 - 10:23:29]
time_waited: >= 2 sec (still in wait)
Can anyone please help me?
You have had two session that each waited for a resource that was held by the other session.
For example:
Session 1
update table_ .... where x = 100;
Session 1 has now locked the record x=100. No other session can modify this record until Session1 either commits or rolls back (that is: ends the transaction).
Session 2
update table_ .... where x = 200;
Session 2 has now locked the record x=200.
Then, still session 2:
update table_ .... where x=100;
Since Session 1 has locked that record, this statement will wait until it can do the modification (that is, until Session 1 end its transaction).
Session 1
update table_ .... where x=200;
Now, this is the deadlock. Since x=200 is locked by Session 2, Session 1 cannot proceed until the transaction of Session 2 ends. But Session 2 cannot proceed because it is also waiting for Session 1.
Hence the Deadlock Error ORA-00060.

cplex prints a lot to terminal although corresponding parameters are set

I am using CPLEX in Cpp.
After googling I found out what parameters need to be set to avoid cplex from printing to terminal and I use them like this:
IloCplex cplex(model);
std::ofstream logfile("cplex.log");
cplex.setOut(logfile);
cplex.setWarning(logfile);
cplex.setError(logfile);
cplex.setParam(IloCplex::MIPInterval, 1000);//Controls the frequency of node logging when MIPDISPLAY is set higher than 1.
cplex.setParam(IloCplex::MIPDisplay, 0);//MIP node log display information-No display until optimal solution has been found
cplex.setParam(IloCplex::SimDisplay, 0);//No iteration messages until solution
cplex.setParam(IloCplex::BarDisplay, 0);//No progress information
cplex.setParam(IloCplex::NetDisplay, 0);//Network logging display indicator
if ( !cplex.solve() ) {
....
}
but yet cplex prints such things:
Warning: Bound infeasibility column 'x11'.
Presolve time = 0.00 sec. (0.00 ticks)
Root node processing (before b&c):
Real time = 0.00 sec. (0.01 ticks)
Parallel b&c, 4 threads:
Real time = 0.00 sec. (0.00 ticks)
Sync time (average) = 0.00 sec.
Wait time (average) = 0.00 sec.
------------
Total (root+branch&cut) = 0.00 sec. (0.01 ticks)
Is there any way to avoid printing them?
Use setOut method from IloAlgorithm class (IloCplex inherits from IloAlgorithm). You can set a null output stream as a parameter and prevent logging the message on the screen.
This is what works in C++ according to cplex parameters doc:
cplex.setOut(env.getNullStream());
cplex.setWarning(env.getNullStream());
cplex.setError(env.getNullStream());

Resources