oracle和OS内核参数匹配问题

2019-09-01 09:37

oracle和OS内核参数匹配问题

我最近解决了一些这方面的问题,并在网络上查询了一些相关资料终于发现一个比较全面解释这类问题的官方文档。本来打算当一次活雷锋全文翻译的,后来考虑自己英文一般,并且对于其中一些OS相关的知识也没有深入了解。就保留英文大家自己去领会其中的要领,自己简单总结了一下解决这类问题的关键点并整理一下英文原文。这个文档是oracle官方技术支持网站Metalink的资料,里面引用了一些其它的文档例如NOTE:115235.1 。

对于unix操作系统中Semaphores问题只是针对和oracle相关问题作一些解释。对于信号量和共享内存段参数在不同的系统中可能有不同的参数对应,具体你去查询对应的OS文档。

在解决这类问题的时候我发现大部分问题都是因为在安装oracle时没有仔细阅读针对指定OS的安装说明造成安装实例失败,一般oracle的官方文档都详细说明在对应操作系统上如何设置这些内核参数。还有就是因为其他原因OS管理人员调整了参数,但是没有通知DBA,一旦oracle崩溃再次重新启动的时候就可能因为新的内核参数不合适而无法启动。 如果是oracle意外停机之后重新启动不成功,并出现类似ora-27123的错误那么一定要询问是否有其他人修改过内核参数,有时候你没有修改并不代表其他人没有修改哟,我遇到过不少这样的情况!

1、与oracle相关的信号量和共享内存段参数

一般unix系统中和信号量相关的是三个参数SEMMNI SEMMSL SEMMNS。他们相互关联决定系统可以分配的信号量。Oracle使用信号量完成内部进程之间的通信。

关于共享内存段使用shmmx参数进行总体控制。它指定了系统可以分配的共享内存段最大大小,实际并没有分配那么多只是给出一个可以使用的最大限制。

对于类核参数的修改必须要重新启动系统之后才会生效。 2、出现信号量和共享内存段相关问题的情况

oracle只有在startup nomount的时候才会请求os的这些资源,用于建立SGA和启动后台进程。

有些情况下因为oracle崩溃之后os没有清除oracle分配的SGA,也可能造成共享内存段不足,需要人工清除。

3、如何解决相关的问题

你可以简单的修改init参数减少oracle对共享内存段和信号量的需求。 对于控制信号量的三个参数SEMMNI SEMMSL SEMMNS 。最终可以使用的信号量由

下面公式 提取 (semmsl * semmni) 或者 semmns中最小的值。

例如在linux下. 进入目录/proc/sys/kernel;用cat命令或more命令查看semaphore当前参数的

值: cat sem

命令运行后将会出现如下的结果: 250 32000 32 128

其中, 250 是参数SEMMSL的值,32000是参数SEMMNS的值, 32是参数SEMOPM的值,而128则是参数SEMMNI的值。250*128=32000

对于oracle7需要信号量的设置等于init中processes的设置。对于8i 9i需要等于processes*2。

对于信号量参数的设定一定要小心,因为不正确的设置可能会让系统使用默认值。这个值一般比oracle系统要求的低。在HP unix上遇到过这样的问题,当时在参数配置的时候指定两个不同的sem-mni造成系统使用默认的设置。

对于共享内存段,系统的设置至少要等于SGA的大小。

Semaphores and Shared Memory

BULLETIN Status: PUBLISHED Content Type: TEXT/PLAIN Creation Date: 05-AUG-2001

Last Revision Date: 05-AUG-2002 PURPOSE-------

To provide an overview of shared memory and semaphores, answer common questions related to these OS resources and provide links to more detailed information.

SCOPE & APPLICATION -------------------

This document is intended for anyone who is responsible for creating or

administering an Oracle Database. It is intended to compliment the semaphore and shared memory information already provided in the Oracle Installation Guides.

关于信号量和共享内存段的背景知识

---------------------------------------------------------------------------------- Semaphores and shared memory are two very distinct sets of Operating System resources. Semaphores are a system resource that Oracle utilizes for interprocess communication and they occupy a relatively small memory space, while shared memory is utilized to contain the SGA and can garner a large portion of physical memory.

How many of these resources are available and how they are allocated is controlled by the configuration of the operating system kernel('kernel' referring to the centralized core components of the underlying operating system).

There are three OS kernel parameters that work together to limit semaphore allocation and one OS kernel paramater that dictates the maximum size of a shared memory segment.

Operating System kernel parameters generally cannot be tuned on the fly. If they are modified, the changes will not take place until the system is rebooted.

Remember also that the kernel parameters related to semaphores and shared memory represent 'high-water' marks. Meaning that the OS will not automatically allocate a given amount, but will allow up to that given amount to be available

upon request.

什么时候信号量和共享内存段问题最有可能发生

----------------------------------------------------------------------------------

Both semaphore or shared memory errors appear primarily at instance startup (The 'startup nomount' stage specifically). This is the only time that Oracle tries to acquire semaphores and shared memory for the instance. Errors related to semaphores or shared memory rarely appear during normal database operations.

The most common circumstance in which these errors occur is during the creation of a new database.

Sometimes when an Oracle instance crashes, however, it's shared memory segments may not be released by the OS. This limits the overall amount of shared memory available for the instance to start up again. In this case, you will need to remove those segments manually.

如何解决信号量和共享内存段问题:

How to resolve semaphore and shared memory errors:

----------------------------------------------------------------------------------

In addressing both semaphore and shared memory errors at instance startup, there are two separate areas that should be considered for reconfiguration.

The first and most simple fix is to modify the init.ora to reduce the number of semaphores or the amount of shared memory Oracle will try to grab at instance startup.

If your situation requires that you not reduce the appropriate init.ora

parameters, you will have to modify the operating system kernel to allow the OS to provide more semaphores or allow larger shared memory segments.

SEMAPHORES

================================================== ================================

IMPORTANT NOTE: ORACLE DOES NOT UTILIZE SEMAPHORES ON AIX OR DIGITAL/TRU64.

与信号量相关的的ORA错误

What kind of ORA errors are related to semaphores?

---------------------------------------------------------------------------------- 'Out of memory' type errors are seldom related to semaphores. Error messages which reference a 'SEMM*****' function are related to semaphores.

IMPORTANT NOTE: THESE ERRORS ONLY OCCUR AT INSTANCE STARTUP.

ORA-7250 \ ORA-7279 \ ORA-7251 \ ORA-7252 \ ORA-7339 \

[NOTE:115235.1] Resolving ORA-7279 or ORA-27146 errors when starting instance VERY COMMON On Oracle8i and Oracle9i:

ORA-3113 \


oracle和OS内核参数匹配问题.doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2000-2016年中国海洋大学612生物化学A考研真题及答案解析 汇编

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: