温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

设置ORACLE自动内存管理

发布时间:2020-10-09 04:30:04 来源:网络 阅读:4563 作者:secdata 栏目:数据库

文章参考:ORACLE 11g官方文档[Managing Memory]

前言:之前搭建数据库集群环境后,现场的维护人员不知何时改为了手动内存管理,且参数设置存在不合理,导致客户plsql执行报错,如下所示:

设置ORACLE自动内存管理

查看数据库日志,有如下提示:

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;

设置ORACLE自动内存管理

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI