shmmax shamll sga_taget之间的关系以及再hp-ux下遇到的ORA-2709问题

2021-08-27 00:00:00 专区 订阅 生产 内存 共享

shmmax shmmll sga_taget

shmmax单个共享段的大值,单位字节

shmmall 共享段的总大小,单位pages

sga_target 好放到一个共享内存段内,使得内存使用性能更好,防止内存碎片

sga-target可以使用多个共享内存段,其设置原则根据上述关系设定,基本是shamax比sga_target稍大,如果跑了几个数据库则shmmall
要超过两个库的sga-target大小即可。


对于hp-ux系统,如果共享内存段超过50个、且启用了异步i/o,很可能造成实例无法启动。报错:ORA-27090: Unable to reserve kernel resources for asynchronous disk I/O.

如下是Oracle MOS的解释

Explanation
~~~~~~~~~~~
At startup, if /dev/async is configured, the foreground process doing the
startup and also each background process will execute the following (as seen
from tusc)

open("/dev/async", O_RDWR|O_LARGEFILE, 03070) ..... = 8
....
shmat(1590, NULL, 0) .............................. = 0xXXXXXXXX
shmctl(1590, IPC_STAT, 0x800003ffbfff2728) ........ = 0
ioctl(8, 0x80186103, 0x800003ffbfff2710) .......... = 0

The shmat/shmctl/ioctl calls are repeated for every shared memory segment.

It is only possible to 'register' 50 shared memory segments with the async
i/o driver. The 51st ioctl() call fails as follows:

shmat(1591, NULL, 0) .............................. = 0xXXXXXXXX
shmctl(1591, IPC_STAT, 0x800003ffbfff2728) ........ = 0
ioctl(8, 0x80186103, 0x800003ffbfff2710) .......... ERR#7 E2BIG


Workaround
~~~~~~~~~~
Ensure the SGA will fit into less than 50 segments (ideally one segment,
subject to operating system restrictions - see Note:69119.1)

If the problem is with SAM silently setting SHMMAX to 64MB, then specify an absolute
value for SHMMAX rather than using a formula.
If SAM does not accept the absolute value, then use kmtune to set the value.

Always use kmtune to verify the current setting of SHMMAX.

Notes on kmtune:
Get the value of SHMMAX
% /usr/sbin/kmtune -q shmmax
Set the value of SHMMAX
% usr/sbin/kmtune -s shmmax=0X4000000
NB, the kernel will need to be rebuilt, unless HP-UX11i, in
which case use '-u' option with kmtune, to dynamically set SHMMAX


相关文章