oracle共享内存会清理嘛,清理apache 共享内存引起的oracle宕机,有类似应用的请大家注意...
发布日期:2021-06-24 11:54:36 浏览次数:2 分类:技术文章

本文共 2644 字,大约阅读时间需要 8 分钟。

我的平台是redhat as 3 ,oracle 9204.

其他应用是apache,resin等。

因为以前发现apache运行时间长以后会出现共享内存不足的错误,具体错误信息如下:

[Fri Apr 13 06:00:03 2007] [error] shm.create(): error creating shm 2 No such file or directory

[Fri Apr 13 06:00:03 2007] [error] shm.create(): error creating shm /home/apache/logs/shm.file

[Fri Apr 13 06:00:03 2007] [warn] pid file /home/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?

[Fri Apr 13 06:00:03 2007] [emerg] (28)No space left on device: Couldn't create accept lock

因此,我写了一个脚本,来定时检测并清理。一直很有效。

前一段时间,新开了一个小应用,也是apache的应用,由于没地方放了,就放到oracle机器上了,一直运行比较好;

今天早上接到信息,说新开的这个apache应用服务停止了,打开log一看,又是共享内存的问题,二话不说,把原来的脚本在系统上跑了一遍,restart apache,ok。系统可以了。

过了几分钟。问题大了,说oracle服务宕了。赶紧检查,ps -ef|oracle  服务都没了,看alterlog发现如下信息:

Errors in file /opt/oracle/admin/sc1/bdump/sc1_reco_5195.trc:

ORA-27157: OS post/wait facility removed

ORA-27300: OS system dependent operation:semop failed with status: 43

ORA-27301: OS failure message: Identifier removed

ORA-27302: failure occurred at: sskgpwwait1

Fri Apr 13 10:10:46 2007

Errors in file /opt/oracle/admin/sc1/bdump/sc1_smon_5193.trc:

ORA-27157: OS post/wait facility removed

ORA-27300: OS system dependent operation:semop failed with status: 43

ORA-27301: OS failure message: Identifier removed

ORA-27302: failure occurred at: sskgpwwait1

Fri Apr 13 10:10:46 2007

RECO: terminating instance due to error 27157

Fri Apr 13 10:10:46 2007

Errors in file /opt/oracle/admin/sc1/udump/sc1_ora_23824.trc:

ORA-27153: wait operation failed

ORA-27300: OS system dependent operation:semop failed with status: 22

ORA-27301: OS failure message: Invalid argument

ORA-27302: failure occurred at: sskgpwwait2

Fri Apr 13 10:10:46 2007

Errors in file /opt/oracle/admin/sc1/bdump/sc1_lgwr_5189.trc:

知道是系统问题导致oracle宕机了。想到刚才的操作,怀疑把oracle的共享内存也给误清理了,好在db能正常启动,把数据库启动后,检查共享内存:

[root@oracle]# ipcs -s

------ Semaphore Arrays --------

key        semid      owner      perms      nsems

0x00000000 4849664    nobody    600        1

0x00000000 4882433    nobody    600        1

0x00000000 4915202    nobody    600        1

0x00000000 4947971    nobody    600        1

0x00000000 4980740    nobody    600        1

0xbeae576c 5111813    oracle    640        201

0xbeae576d 5144582    oracle    640        201

0xbeae576e 5177351    oracle    640        201

0xbeae576f 5210120    oracle    640        201

0xbeae5770 5242889    oracle    640        201

0x00000000 5275658    nobody    600        1

0x00000000 5308427    nobody    600        1

0x00000000 5341196    nobody    600        1

0x00000000 5373965    nobody    600        1

0x00000000 5406734    nobody    600        1

0x00000000 5439503    nobody    600        1

0x00000000 5472272    nobody    600        1

0x00000000 5505041    nobody    600        1

果然有oracle的共享内存,而我的脚本没有判断。如果只是删除apache用户的共享内存,可以这样

ipcs -s | grep apache | perl -e 'while (

9f7588d3b12cd5d674b5f81c0b8fc6cb.gif { @a=split(/\s+/); print `ipcrm sem $a[1]`}'

如果大家谁的应用和我这个类似,一定注意。

转载地址:https://blog.csdn.net/weixin_32601635/article/details/116476244 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:php高手进阶,PHP高手进阶-LAMPer技能树
下一篇:oracle怎么判断是裸设备安装,windows 下安装oracle,如何建立裸设备(单机,非做RAC)...

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月15日 02时56分53秒