Long running JOB due to parallel execution

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.

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值