天天看點

Streams AQ: qmn coordinator waiting for slave to start等待事件

       Streams AQ: qmn coordinator waiting for slave to start等待事件很少見到,今天在檢視一個客戶的AWR報告中發現了這個等待事件,AWR報告的TOP如下:

<b>Event</b>

<b>Waits</b>

<b>Time(s)</b>

<b>Avg wait (ms)</b>

<b>% DB time</b>

<b>Wait Class</b>

DB CPU

308

62.85

db file sequential read

92,033

96

1

19.60

User I/O

db file scattered read

44,852

90

2

18.39

Streams AQ: qmn coordinator waiting for slave to start

3

16

5269

3.23

Other

gc cr grant 2-way

60,943

11

2.27

Cluster

    Streams AQ: qmn coordinator waiting for slave to start等待事件等待的次數非常少,在一個小時的AWR報告中就出現了3次,但是每次的等待時間卻非常長,平均達5秒以上。在10g版本中,QMON(Queue Monitor Processes)自動協調slave經常的配置設定,aq_tm_processes無需在手動設定,slave程序會在需要的時候自動配置設定。

    檢視了使用者的aq_tm_processes參數為0,資料庫版本為10.2.0.5(oracle是不建議将aq_tm_processes設定為0的),那說明此時oracle在自動配置設定slave程序時時存在問題的,效率過低,是以如果出現Streams AQ: qmn coordinator waiting for slave to start等待事件,還是建議将aq_tm_processes參數設定為非零值,讓oracle預先配置設定幾個slave程序,該參數的取值範圍是0~10,或者取消aq_tm_processes參數的設定,讓oracle自動配置設定。

    可以通過下面的代碼檢視QMON自動調整是否啟用,同時aq_tm_processes參數是否被設定為0:

connect / as sysdba

set serveroutput on

declare

mycheck number;

begin

select 1 into mycheck from v$parameter where name = 'aq_tm_processes' and value = '0' and (ismodified != 'FALSE' OR isdefault = 'FALSE');

if mycheck = 1 then

dbms_output.put_line('The parameter ''aq_tm_processes'' is explicitly set to 0!');

end if;

exception when no_data_found then

dbms_output.put_line('The parameter ''aq_tm_processes'' is not explicitly set to 0.');

end;

/

     取消aq_tm_processes參數的設定:

alter system reset aq_tm_processes scope=spfile sid=\'*\';

    補充:從11.2.0.3以後的版本中,aq_tm_processes預設值又調整為1.