您好,登錄后才能下訂單哦!
文章參考:ORACLE 11g官方文檔[Managing Memory]
前言:之前搭建數據庫集群環境后,現場的維護人員不知何時改為了手動內存管理,且參數設置存在不合理,導致客戶plsql執行報錯,如下所示:
查看數據庫日志,有如下提示:
Wed Mar 15 00:15:08 2017
Errors in file /app/oracle/diag/rdbms/resdb/resdb1/trace/resdb1_ora_12320832.trc (incident=441054):
ORA-04031: unable to allocate 56 bytes of shared memory ("streams pool","unknown object","streams pool","fixed allocation
callback")
Incident details in: /app/oracle/diag/rdbms/resdb/resdb1/incident/incdir_441054/resdb1_ora_12320832_i441054.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Wed Mar 15 16:11:30 2017
Errors in file /app/oracle/diag/rdbms/resdb/resdb1/trace/resdb1_ora_8126806.trc (incident=440838):
ORA-04031: ?·¨·??2 ????2Э?′?"shared pool","SELECT TRIGGER_NAME, TRIGGER...","SQLA","tmp")
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Errors in file /app/oracle/diag/rdbms/resdb/resdb1/trace/resdb1_m000_10879616.trc (incident=442639):
ORA-04031: unable to allocate 536 bytes of shared memory ("shared pool","select /*+ rule */ bucket, e...","SQLA^bbcee4f7"
,"qerixs : rixalo")
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Wed Mar 15 16:11:31 2017
Dumping diagnostic data in directory=[cdmp_20170315161131], requested by (instance=1, osid=10879616 (M000)), summary=[inc
ident=442638].
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Wed Mar 15 16:11:32 2017
Sweep [inc][442639]: completed
查看數據庫內存參數設置,并未是自動內存管理,設置自動內存管理模式處理。
問題處理過程
內存管理:自動內存管理、手動內存管理
自動內存管理:oracle 11g后支持PGA和SGA的自動內存管理,只需設置實例的總內存大小,根據需要自動分配PGA和SGA大小;
手動內存管理:如果想要手動管理內存設置,這個就需要DBA根據環境需要進行適當設置了。
自動內存管理設置:只需修改初始化參數設置MEMORY_TARGET和可選參數設置MEMORY_MAX_TARGET
設置自動內存管理步驟:
1.以sysdba權限的用戶登錄數據庫
查看當前數據庫SGA_TARGET和PGA_AGGREGATE_TARGET的參數設置
SQL> show parameter sga_target;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_target big integer 0
SQL> show parameter pga_aggregate_target;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_target big integer 160000M
執行如下SQL查詢語句,確認實例啟動時分配PGA的最大值
SQL> select value from v$pgastat where name='maximum PGA allocated';
VALUE
----------
4620300288
根據如下公式計算其參數值:
memory_target = sga_target + max(pga_aggregate_target, maximum PGA allocated)
2.初始化參數MEMORY_MAX_TARGET
首先查看當前數據庫中MEMORY_MAX_TARGET參數
SQL> show parameter MEMORY_MAX_TARGET ;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
memory_max_target big integer 0
SQL> ALTER SYSTEM SET MEMORY_MAX_TARGET = 160000M SCOPE = SPFILE SID='*';
ALTER SYSTEM SET MEMORY_TARGET = 160000M SCOPE = SPFILE SID='*';
ALTER SYSTEM SET PGA_AGGREGATE_TARGET = 0 SCOPE = SPFILE SID='*';
3.重啟數據庫
4.自動內存管理監控
The dynamic performance view V$MEMORY_DYNAMIC_COMPONENTS
shows the current sizes of all dynamically tuned memory components, including the total sizes of the SGA and instance PGA.
SQL> select * from v$memory_target_advice order by memory_size;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。