Today I met a long running job. ETL developer said that this job had been running for about 6 hours,
request DBA's help.
I asked them to provide SID , which is 4861.
According the providing sid, I checked the wait event is PX Deq: Execute Reply , which means the job is
running in parallel mode.
For parallel running SQL, we can check wait event by using SQL_ID.So I use below SQL to check what is waiting for.
select (sysdate-logon_time)*24*60 minutes, username,machine,sid,serial#,event,p1,p2,p3,
row_wait_obj# obj#,row_wait_file# file#,row_wait_block# block#,sql_id,sql_child_number from
gv$session where sql_id='9tuyvbacwkc5k';
Below is the formatted query result.
Pls notice session 2303 and 4816, wait event is read by other session.P1 , P2, P3 are the same.
What is read by other session? below is the explain from Metalink 732891.1
When information is requested from the database, Oracle will first read the data from disk into the database buffer cache.
If two or more sessions request the same information, the first session will read the data into the buffer cache while other sessions wait.
In previous versions, this wait was classified under the "buffer busy waits" event. However, in Oracle 10.1 and higher,
this wait time is now broken out into the "read by other session" wait event. Excessive waits for this event are typically due to
several processes repeatedly reading the same blocks, e.g. many sessions scanning the same index or performing
full table scans on the same table. Tuning this issue is a matter of finding and eliminating this contention.
Then I checked the execution plan, I find that one table will scan 8 times in parallel mode.
Here I can't post the execution plan for some reason.
Now it's clear that the SQL hung is due to read by other session. read by other session is due to one table need scan 8 times in parallel mode.
So I suggest disable parallel query. Finally the SQL can be finished within 30minutes.