oracle异机同步,Oracle 11g 异机rman恢复报错ORA-27302:failure occurred at: sskgpcreates

【此为"一森咖记"公众号——第111篇文章】

读完需要15分钟速读仅需10分钟

c40a5ddb441c7b821bcb9830bd629755.png

【引言】

今天,使用Oracle的11g做异库恢复,第一步时使用源端生产库的pfile文件在目标端使用startup nomount命令启拉库时,报错了如下信息:

crm-tdb[CRMPRDSDB]:/opt/oracle/product/11.2.0.4/db_1/dbs$ 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@CRMPRDSDB> 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            shmmaxdb_files (maxdatafiles)     nfile, maxfileslarge_pool_size             shmmaxlog_buffer                  shmmaxprocesses                   nproc, semmsl, semmnsshared_pool_size            shmmax

Common Unix Kernel Parameter DefinitionsThe 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/.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.kernel.sem对应4个值SEMMSL、SEMMNS、SEMOPM、SEMMNI

SEMMSL: 每个信号集的最大信号数量数据库最大 PROCESS 实例参数的设置值再加上10。oracle建议将SEMMSL的值设置为不少于100。SEMMNS:用于控制整个linux系统中信号(而不是信号集)的最大数。Oracle 建议将SEMMNS设置为:系统中每个数据库的PROCESSES实例参数设置值的总和,加上最大PROCESSES值的两倍,最后根据系统中Oracle数据库的数量,每个加10。通常,两者中较小的一个值:SEMMNS 或(SEMMSL * SEMMNI),来确定在 Linux 系统中可以分配的信号的最大数量。

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

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.

For HP-UX Itanium:

Enter the following command to start thekcwebapplication:

# /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 isnot dynamic, then you must restart the system.

修改过程:

root用户使用命令:

# /usr/sbin/kcweb -F

按照一步步提示,即可进行修改。

需要注意的是:

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

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

【总结】

1.本来一很小的问题,整个查资料和处理过程还是有点曲折; linux系统上很简单一条指令,到了HP-UX上重启服务器才能修改,很是折腾了一番;

2.事无大小,需用心做,多钻研。

4423195cd20d07785df5934b69b64c97.png下是个人微信公众号“一森咖记”,欢迎关注

近期热文你可能也会对以下话题感兴趣。点击链接就可以查看。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值