【生产排故】Oracle 11g 异机rman恢复报错ORA-302failure occurred at sskgpcreates

在这里插入图片描述
【引言】
今天,使用Oracle的11g做异库恢复,第一步使用源端生产库的pfile文件在目标端使用startup nomount命令启拉库时,报错了如下信息:

$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Jan 9 17:49:14 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SYS@ETHANDB> startup nomount;
ORA-27154: post/wait create failed
ORA-27300: OS system dependent operation:semget failed with status: 28
ORA-27301: OS failure message: No space left on device
ORA-27302: failure occurred at: sskgpcreates

根据提示,会误以为是磁盘空间不足 (No space left on device), 其实最后的提示发现是信号量参数设置问题。

分析思路:

查阅Oracle官方文档,查看数据库初始参数和Kernel参数的关系.

db_block_buffers            shmmax
db_files (maxdatafiles)     nfile, maxfiles
large_pool_size             shmmax
log_buffer                  shmmax
processes                   nproc, semmsl, semmns
shared_pool_size            shmmax
Common Unix Kernel Parameter Definitions
The following Kernel Parameters tend to be generic across most Unix platforms:

通常情况下,如下内核参数就可以满足大多数Unix系统。

maxfiles - Soft file limit per process.
maxuprc - Maximum number of simultaneous user processes per userid.
nfile - Maximum number of simultaneously open files systemwide at any given time.
nproc - Maximum number of processes that can exist simultaneously in the system.
shmmax - The maximum size(in bytes) of a single shared memory segment.
shmmin - The minimum size(in bytes) of a single shared memory segment.
shmmni - The number of shared memory identifiers.
shmseg - The maximum number of shared memory segments that can be attached by a process.
semmns - The number of semaphores in the system.
semmni - The number of semaphore set identifiers in the system; determines the number of semaphore sets that can be created at any one time.
semmsl - The maximum number of sempahores that can be in one semaphore set. It should be same size as maximum number of Oracle processes.

看一个官方案例 vi /etc/sysctl.conf

#System default settings live in /usr/lib/sysctl.d/00-system.conf.
#To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#For more information, see sysctl.conf(5) and sysctl.d(5).
#ORACLE SETTING
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 15728640
kernel.shmmax = 64424509440
kernel.shmmni = 4096
kernel.sem = 5010 641280 5010 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

接下来再介绍下各参数的主要用途:
1.kernel.shmall: 共享内存页数的最大值
Linux共享内存页大小为4KB, 共享内存段的大小都是共享内存页大小的整数倍。一个共享内存段的最大大小是16G,需要共享内存页数是 16GB/4KB=16777216KB/4KB=4194304(页)

2.kernel.shmmax:单个共享内存段的最大值
shmmax是核心参数中最重要的参数之一,用于定义单个共享内存段的最大值,shmmax设置应足够大,能在一个共享内存段下容纳下整个的SGA,设置的过低可能会导致需要创建多个共享内存段,可能导致系统性能的下降。

3. kernel.shmmni:共享内存段的最大数量
注意该参数不是shmmin,是shmmni,shmmin 表示内存段最小大小 ) shmmni缺省值4096 足够。 shmmax(bytes) = shmmni(page size, default 4k) * shmall (page的个数)

4) semop 系统调用(函数)提供了利用一个 semop 系统调用完成多项信号操作的功能。

一个信号集能够拥有每个信号集中最大数量的SEMMSL 信号,因此建议设置 SEMOPM 等于SEMMSL 。 Oracle 建议将 SEMOPM 的值设置为不少于 100 。 SEMMNI :内核参数用于控制整个 Linux 系统中信号集的最大数量。 Oracle 建议将 SEMMNI 的值设置为不少于 100 。

装过Oracle的亲都知道,linux系统中很好改,在 vi /etc/sysctl.conf 里,重新加载生效是 sysctl -p即可。

注意:Linux系统中设定完这些数据后,必须使用sysctl -p 生效。

根据上述介绍,processes设置过大,会报如上错误;怎么解决呐?

两种方式:
方式1 process数改小;方式2调整系统参数semmns值。
通常,我们会先尝试方式1,但有时候生产需求要求process不能调小,只能只用方式2修改semmns值。

但该系统报错为HP-UX系统环境,HP-UX系统下并没有Linux的 /etc/sysctl.conf 文件,也不能使用命令 sysctl -p。

系统信息如下:

#uname -a
HP-UX crm-tdb B.11.31 U ia64 2272784454 unlimited-user license

如果要通过修改方式2调整系统参数semmns值来解决,该咋弄?

作为背景知识,这里先介绍下HP-UX环境中的内核参数,看下官方手册。

Configuring Kernel Parameters on HP-UX Systems
During installation, you can generate and run the Fixup script to check and set the kernel parameter values required for successful installation of the database. This script updates required kernel packages if necessary to minimum values.
If you cannot use the Fixup scripts, then verify that the kernel parameters shown in the following table are set to values greater than or equal to the minimum value shown. The procedure following the table describes how to verify and set the values manually.

Note:
The kernel parameter values in this section are minimum values only. For production database systems, Oracle recommends that you tune these values to optimize the performance of the system. Refer to your operating system documentation for more information about tuning kernel parameters.

官方推荐值,如下图:
image.png
For HP-UX Itanium:

Enter the following command to start the kcweb application:
#/usr/sbin/kcweb -F

Check the value or formula specified for each of these parameters and, if necessary, modify that value or formula.

If necessary, refer to the kcweb online Help for more information about completing this step.

Note:
If you modify the value of a parameter that is not dynamic, then you must restart the system.


修改过程:
root用户使用命令:

```bash
#/usr/sbin/kcweb -F

按照一步步提示,修改semmns,最终修改如下:
image.png

需要注意的是:
上述参数为静态参数,如果做了修改,为使其生效,需要重启服务器。

修改参数semns后,再次使用源端生产库的pfile文件在目标端使用startup nomount命令启拉库成功。

【总结】
1.本来一很小的问题,整个查资料和处理过程还是有点曲折; linux系统上很简单一条指令,到了HP-UX上重启服务器才能修改,很是折腾了一番;
2.事无大小,需用心做,多钻研。

以下是个人微信公众号“一森咖记”,欢迎关注
在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值