您好,登錄后才能下訂單哦!
本篇內容主要講解“怎么解決ORACLE 12C :'acknowledge over PGA limit' Wait Event問題”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“怎么解決ORACLE 12C :'acknowledge over PGA limit' Wait Event問題”吧!
用戶反映19c生產環境數據庫慢,運行簡單語句uat只需要2s,但是prod需要40s,對此對數據庫進行檢查
首先檢查數據庫的awr報告,發現異常等待acknowledge over PGA limit占用較大
Top 10 Foreground Events by Total Wait Time
Event | Waits | Total Wait Time (sec) | Avg Wait | % DB time | Wait Class |
---|---|---|---|---|---|
acknowledge over PGA limit | 5,255 | 1050.3 | 199.87ms | 90.2 | Scheduler |
cursor: pin S wait on X | 6 | 72.6 | 12.10 s | 6.2 | Concurrency |
DB CPU | 4.6 | .4 |
查詢mos文檔,發現此類問題是由于PGA大小達到了PGA_AGGREGATE_LIMIT的值,防止ORA-4036錯誤,后面進程分配pga時需要等待其他進程釋放pga。
12c: 'acknowledge over PGA limit' Wait Event (Doc ID 2138882.1)
CAUSE
The "acknowlege over PGA limit" is a new wait event that was introduced with PGA_AGGREGATE_LIMIT in 12.1,
and it will force a process that wants more PGA to wait a bit if the instance is getting close to hitting the limit.
The hope is some other process will release memory and avoid the ORA-4036 error.
SOLUTION
1. Set PGA_AGGREGATE_LIMIT=0 (as SYS user) to revert to 11g behavior of PGA memory management using PGA_AGGREGATE_TARGET parameter and the wait event will be alleviated.
ALTER SYSTEM SET PGA_AGGREGATE_LIMIT=0 SID='*' SCOPE=BOTH;
2. Set PGA_AGGREGATE_LIMIT to higher than the default value (as SYS user), which was calculated based on the PGA_AGGREGATE_TARGET, PROCESSES or "_pga_limit_target_perc" setting and that will also help to reduce this wait event.
ALTER SYSTEM SET PGA_AGGREGATE_LIMIT= &new_value SID='*' SCOPE=BOTH;
oracle建議設置PGA_AGGREGATE_LIMIT=0或者增大這個參數的值解決
ALTER SYSTEM SET PGA_AGGREGATE_LIMIT=0 SCOPE=BOTH;
但是,這個方法只是暫時解決,究竟是什么導致的呢,需要繼續檢查pga使用情況
首先判斷該應用pga設置是否合理,即連接數數量和pga大小,可以通過查詢process數量和pga使用,如果
明顯出現process較小而pga使用很大,則有可能是某些應用進程或者數據庫進程異常導致,可以通過下面語句查詢出是
哪個進程異常導致
1.列出占用pga最大的進程
select pid,spid,substr(username,1,20) "USER" ,program,PGA_USED_MEM,PGA_ALLOC_MEM,PGA_FREEABLE_MEM,PGA_MAX_MEM
from v$process
where pga_alloc_mem=(select max(pga_alloc_mem) from v$process
where program not like '%LGWR%');
2.查看數據庫會話所有sid占用pga的的詳細情況
set linesize 120
set pagesize 120
column spid heading 'OSpid' format a8
column pid heading 'Orapid' format 999999
column sid heading 'Sess id' format 99999
column serial# heading 'Serial#' format 999999
column status heading 'Status' format a8
column pga_alloc_mem heading 'PGA alloc' format 99,999,999,999
column pga_used_mem heading 'PGA used' format 99,999,999,999
column username heading 'oracleuser' format a12
column osuser heading 'OS user' format a12
column program heading 'Program' format a20
SELECT
p.spid,
p.pid,
s.sid,
s.serial#,
s.status,
p.pga_alloc_mem,
p.PGA_USED_MEM,
s.username,
s.osuser,
s.program
FROM
v$process p,
v$session s
WHERE s.paddr ( + ) = p.addr
and p.BACKGROUND is null /* Remove if need to monitor background processes */
Order by p.pga_alloc_mem desc;
3.檢查pga隨著時間的增長
select snap_id,round(value/1024/1024,0) from dba_hist_pgastat where name='total PGA allocated' order by snap_id
4.檢查應用進程分配的pga,查詢出大于50m的
select a.sid,a.status,a.sql_id,a.last_call_et,b.pga_alloc_mem/1024/1024,a.event,a.state from v$session a,v$process b where a.paddr=b.addr and a.status='INACTIVE' and b.pga_alloc_mem/1024/1024 > 50;
5.查看當前pga使用情況
select * from v$pgastat
通過1可以查詢出是否有異常的數據庫進程占用較大的pga,2可以查詢出是否有異常會話占用較大pga,3可以查詢出pga在最近一段時間的增長情況,可以判斷出什么時候開始出現異常,4則是對應用進程使用Pga大于50m進行排查
如果是數據庫進程異常,則需要檢查該系統進程對應的trc文件進行分析。
如果是應用進程異常,則通過該sid和spid去分析,對不釋放的進程做heapdump,看看內存中導致存儲的是什么內容,然后和應用一起解決
到此,相信大家對“怎么解決ORACLE 12C :'acknowledge over PGA limit' Wait Event問題”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。