本篇內容主要講解“怎么解決ORACLE 12C :'acknowledge over PGA limit' Wait Event問題”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“怎么解決ORACLE 12C :'acknowledge over PGA limit' Wait Event問題”吧!
成都創(chuàng)新互聯(lián)主營許昌網站建設的網絡公司,主營網站建設方案,成都App定制開發(fā),許昌h5微信小程序定制開發(fā)搭建,許昌網站營銷推廣歡迎許昌等地區(qū)企業(yè)咨詢
用戶反映19c生產環(huán)境數(shù)據(jù)庫慢,運行簡單語句uat只需要2s,但是prod需要40s,對此對數(shù)據(jù)庫進行檢查
首先檢查數(shù)據(jù)庫的awr報告,發(fā)現(xiàn)異常等待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文檔,發(fā)現(xiàn)此類問題是由于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或者增大這個參數(shù)的值解決
ALTER SYSTEM SET PGA_AGGREGATE_LIMIT=0 SCOPE=BOTH;
但是,這個方法只是暫時解決,究竟是什么導致的呢,需要繼續(xù)檢查pga使用情況
首先判斷該應用pga設置是否合理,即連接數(shù)數(shù)量和pga大小,可以通過查詢process數(shù)量和pga使用,如果
明顯出現(xiàn)process較小而pga使用很大,則有可能是某些應用進程或者數(shù)據(jù)庫進程異常導致,可以通過下面語句查詢出是
哪個進程異常導致
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.查看數(shù)據(jù)庫會話所有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可以查詢出是否有異常的數(shù)據(jù)庫進程占用較大的pga,2可以查詢出是否有異常會話占用較大pga,3可以查詢出pga在最近一段時間的增長情況,可以判斷出什么時候開始出現(xiàn)異常,4則是對應用進程使用Pga大于50m進行排查
如果是數(shù)據(jù)庫進程異常,則需要檢查該系統(tǒng)進程對應的trc文件進行分析。
如果是應用進程異常,則通過該sid和spid去分析,對不釋放的進程做heapdump,看看內存中導致存儲的是什么內容,然后和應用一起解決
到此,相信大家對“怎么解決ORACLE 12C :'acknowledge over PGA limit' Wait Event問題”有了更深的了解,不妨來實際操作一番吧!這里是創(chuàng)新互聯(lián)網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續(xù)學習!
網頁標題:怎么解決ORACLE12C:'acknowledgeoverPGAlimit'WaitEvent問題
分享網址:http://aaarwkj.com/article46/goojhg.html
成都網站建設公司_創(chuàng)新互聯(lián),為您提供移動網站建設、云服務器、做網站、關鍵詞優(yōu)化、App設計、營銷型網站建設
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)