oracle10g报错27123,RHEL5.4安装Oracle10G各项参数

共享内存通过将通用的结构和数据放在共享内存段中,使得进程可以对它们进行访问。这是现有最快的进程间通信(IPC)方式 主要是因为数据在进程之间传递时没有涉及到内核的操作。在进程之间不需要复制数据。

Oracle 将共享内存用于它的系统全局区(SGA),这是一个由所有的 Oracle 备份进程及前台进程所共享的内存区域。为 SGA 分配足够的容量对于 Oracle 的性能非常重要,因为它负责保存数据库缓冲区高速缓存、共享 SQL、访问路径以及更多。

要确定所有共享内存的限制,可使用以下命令:

# ipcs -lm

设置SHMMAX

SHMMAX 参数定义共享内存段的最大大小(以字节为单位)。Oracle SGA 由共享内存组成,且错误设置 SHMMAX 可能会限制 SGA 的大小。在设置 SHMMAX 时,切记 SGA 的大小应该适合于一个共享内存段。SHMMAX 设置不足可能会导致以下问题:

ORA-27123:unable to attach to shared memory segment

您可以通过执行以下命令来确定SHMMAX 的值:

# cat /proc/sys/kernel/shmmax

33554432

SHMMAX 的默认值为32MB。通常,这个值对于配置 Oracle SGA 而言太小了。我通常使用以下任一方法将 SHMMAX 参数设置为 2GB:

·通过直接更改/proc 文件系统,你无需重新启动计算机便可以改变 SHMMAX 的缺省设置。可以使用以下方法动态设置 SHMMAX 的值。通过将此命令置于 /etc/rc.local 启动文件中可以使它永久有效:

# echo "2147483648" > /proc/sys/kernel/shmmax

·您还可以使用sysctl 命令来更改 SHMMAX 的值:

# sysctl -w kernel.shmmax=2147483648

·最后,通过将该内核参数插入到/etc/sysctl.conf 启动文件中,您可以使这种更改永久有效:

# echo "kernel.shmmax=2147483648" >> /etc/sysctl.conf

设置SHMMNI

我们现在看一下SHMMNI 参数。这个内核参数用于设置系统范围内共享内存段的最大数量。该参数的缺省值是 4096。该值足以满足需要,因此通常无需更改。

可以通过执行以下命令来确定SHMMNI 的值:

# cat /proc/sys/kernel/shmmni

4096

设置SHMALL

最后,我们来看SHMALL 共享内存内核参数。该参数控制系统一次可以使用的共享内存总量(以页为单位)。简言之,该参数的值始终应至少为:

ceil(SHMMAX/PAGE_SIZE)

SHMALL 的默认大小为2097152,并可以使用以下命令进行查询:

# cat /proc/sys/kernel/shmall

2097152

SHMALL 的默认设置足以满足Oracle RAC 10g 安装的需要。

(注意:i386 平台上的 Red Hat Linux 中的页面大小为 4,096 字节。但您可以使用 bigpages,它支持配置更大的内存页面大小。)

至此,我们已经配置了共享内存设置,接下来将介绍如何配置信号。对信号的最佳描述是,它是用于在共享资源(如共享内存)的进程(或进程中的线程)之间提供同步的计数器。Unix System V 支持信号集,其中的每个信号都是一个信号计数。当应用程序请求信号时,它使用“集合”来完成此工作。

要确定所有信号限制,可使用以下命令:

# ipcs -ls

您还可以使用以下命令:

# cat /proc/sys/kernel/sem

25032000   32      128

设置SEMMSL

SEMMSL 内核参数用于控制每个信号集合的最大信号数。

Oracle 建议将SEMMSL 设置为 init.ora 文件(适用于 Linux 系统上所有数据库)中的最大 PROCESS 实例参数设置再加上 10。此外,Oracle 建议将 SEMMSL 设置为不小于 100。

设置SEMMNI

SEMMNI 内核参数用于控制整个 Linux 系统中信号集的最大数量。Oracle 建议将 SEMMNI 设置为不小于 100。

设置SEMMNS

SEMMNS 内核参数用于控制整个 Linux 系统中的信号(而非信号集)的最大数量。

Oracle 建议将SEMMNS 设置为系统上每个数据库的 PROCESSES 实例参数设置之和,加上最大的 PROCESSES 的两倍,最后为系统上的每个 Oracle 数据库加上 10。

使用以下计算式确定可以在Linux 系统上分配的信号的最大数量。它将是以下两者中较小的一个值:

SEMMNS — 或(SEMMSL * SEMMNI) 。

设置SEMOPM

SEMOPM 内核参数用于控制每个 semop 系统调用可以执行的信号操作数。

semop 系统调用(函数)能够使用一个semop 系统调用完成多个信号的操作。一个信号集可以拥有每个信号集中最大数量的 SEMMSL,因此建议将 SEMOPM 设置为等于 SEMMSL。

Oracle 建议将SEMOPM 设置为不小于 100。

设置信号内核参数

最后,我们来看如何使用一些方法来设置所有信号参数。在下文中,我想更改(增加)的唯一参数是SEMOPM。所有其他的缺省设置可以完全满足我们的示例安装。

·您可以通过直接更改/proc 文件系统,不必重新启动机器而更改所有信号设置的缺省设置。该方法将以下内容置于 /etc/rc.local 启动文件中:

# echo "250 32000 100 128" > /proc/sys/kernel/sem

·您还可以使用sysctl 命令来更改所有信号设置的值:

# sysctl -w kernel.sem="250 32000 100 128"

·最后,可以通过将内核参数插入到/etc/sysctl.conf 启动文件中以使此更改永久有效:

# echo "kernel.sem=250 32000 100 128" >> /etc/sysctl.conf

1.1.3最大文件句柄数

使用以下命令来确定整个系统中文件句柄的最大数量:

# cat /proc/sys/fs/file-max

32768

Oracle建议将整个系统的文件句柄值至少设置为65536。

·通过直接更改/proc 文件系统,您可以不必重新启动机器而改变文件句柄最大数量的默认设置。该方法将以下内容置于 /etc/rc.local 启动文件中:

# echo "65536" > /proc/sys/fs/file-max

·您还可以使用sysctl 命令来更改 SHMMAX 的值:

# sysctl -w fs.file-max=65536

·最后,可以通过将内核参数插入到/etc/sysctl.conf 启动文件中以使此更改永久有效:

# echo "fs.file-max=65536" >> /etc/sysctl.conf

可以通过使用以下命令查询文件句柄的当前使用情况:

# cat /proc/sys/fs/file-nr

61395      32768

file-nr文件显示了三个参数:分配的文件句柄总数、当前使用的文件句柄数以及可以分配的最大文件句柄数。

(注意:如果需要增大/proc/sys/fs/file-max 中的值,请确保正确设置 ulimit。对于 2.4.20,通常将其设置为 unlimited。使用 ulimit 命令来验证 ulimit 设置:

# ulimit

unlimited

在Oracle 9.2.0.1 以及更高版本中,Oracle 在 Linux 上使用 UDP 作为默认协议进行过程间通信 (IPC) 的默认协议,如在 RAC 集群中的实例间的高速缓存合并和集群管理器缓冲区传输。

Oracle强烈建议将默认的和最大的发送缓冲区大小(SO_SNDBUF 套接字选项)调整为 256KB,并将默认的和最大的接收缓冲区大小(SO_RCVBUF 套接字选项)调整为 256KB。

接收缓冲区由TCP 和 UDP 用于保留所接收的数据,直到应用程序读出这些数据为止。由于不允许对等端发送超过缓冲区大小窗口的数据,因此接收缓冲区无法溢出。这意味着,如果数据报不适合套接字接收缓冲区,则将它们舍弃,从而可能导致发送端压垮接收端。

无需重新引导即可在/proc 文件系统中更改默认的和最大的窗口大小:

# su - root

# sysctl -w net.core.rmem_default=262144

net.core.rmem_default = 262144

# sysctl -w net.core.wmem_default=262144

net.core.wmem_default = 262144

# sysctl -w net.core.rmem_max=262144

net.core.rmem_max = 262144

# sysctl -w net.core.wmem_max=262144

net.core.wmem_max = 262144

以上命令对已经运行的操作系统作出更改。现在您应将以下各行添加到RAC 集群中每个节点的 /etc/sysctl.conf 文件中,从而使以上更改成为永久性更改(针对每次重新引导而言):

# Default setting in bytes of the socket receive buffer

net.core.rmem_default=262144

# Default setting in bytes of the socket send buffer

net.core.wmem_default=262144

# Maximum socket receive buffer size which may be set by using

# the SO_RCVBUF socket option

net.core.rmem_max=262144

# Maximum socket send buffer size which may be set by using

# the SO_SNDBUF socket option

net.core.wmem_max=262144

用户能够打开的文件句柄的最大数

Setting Limits for the Maximum Number of Open File Descriptors for the Oracle User

After you changed and increased /proc/sys/fs/file-max at Setting File Handles, there is still a per user limit of open file descriptors which is set to 1024 by default:

$ su - oracle

$ ulimit -n

1024

To change this, you have to edit the file /etc/security/limits.conf as root and make the following changes or add the following lines, respectively:

oraclesoft    nofile          4096

oraclehard    nofile          63536

The "soft limit" in the first line defines the number of file handles or open files that the Oracle user will have after login. If the Oracle user gets error messages about running out of file handles, then the Oracle user can increase the number of file handles like in this example up to 63536 ("hard limit") by running the following command:

ulimit -n 63536

You can set the "soft" and "hard" limits higher if necessary. Note that I do not recommend to set the "hard" limit fornofilefor theoracleuser equal to/proc/sys/fs/file-max. If you do that and the user uses up all the file handles, then the system would run out of file handles. This could mean that you won't be able to initiate new remote logins any more since the system won't be able to open any PAM modules which are required for performing a login. That's why I set the hard limit to 63536 and not to 65536.

You also need to ensure that pam_limits is configured in the file /etc/pam.d/system-auth, or in /etc/pam.d/sshd (for SSH), /etc/pam.d/su (for su), or /etc/pam.d/login (local logins and telnet) if you don't want to enable it for all logins, or if /etc/pam.d/system-auth does not exist like on SUSE. This is the PAM module that will read the /etc/security/limits.conf file. The entry should read like:

sessionrequired      /lib/security/pam_limits.so

Here are the two "session" entries I have in my /etc/pam.d/system-auth file:

sessionrequired      /lib/security/pam_limits.so

sessionrequired      /lib/security/pam_unix.so

To make this change permanent, add "ulimit -n 63536" (for Bash) to the ~oracle/.bash_profile file which is the user startup file for the Bash shell on Red Hat Linux (to verify your shell run: echo $SHELL). To do this you could simply copy/paste the following commands for the oracle's Bash shell:

su - oracle

cat >> ~oracle/.bash_profile << EOF

ulimit -n 63536

EOF

1.1.6Oracle用户能够执行的进程的最大数

Setting Limits for the Maximum Number of Processes for the Oracle User

After reading the procedure at Setting Limits for the Maximum Number of Open File Descriptors for the Oracle User, you should now understand what "soft" and "hard" limits are, how to configure pam_limits.so, and how to change the limits.

To see the current limit of the maximum number of processes for the oracle user, run:

su - oracle

ulimit -u

Note that theulimitoptions are different for other shells.

To change the "soft" and "hard" limits for the maximum number of processes for the oracle user, add the following lines to the /etc/security/limits.conf file:

oraclesoft    nproc          2047

oraclehard    nproc          16384

To make this change permanent, add "ulimit -u 16384" (for Bash) to the ~oracle/.bash_profile file which is the user startup file for the Bash shell on Red Hat Linux (to verify your shell run: echo $SHELL). To do this you could simply copy/paste the following commands for the oracle's Bash shell:

su - oracle

cat >> ~oracle/.bash_profile << EOF

ulimit -u 16384

EOF

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值