天天看點

oracle11g共享記憶體dest的處理 ipcs dest

今天發現現場有個oracle11.0.0.2的庫感覺有問題,執行任何sql語句(包括ddl)都很慢;

後來發現他的共享記憶體有問題,在root和oracle下都有dest的共享記憶體。

在metlink上搜了一下,oracle在不重新開機主機的情況下提供了一個解決方案。

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=270396324384212&id=1319087.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=cnncanoks_135#SYMPTOM

Unable to Remove Shared Memory Segment with Status of dest (文檔 ID 1319087.1)

SYMPTOMS

Instance has been shutdown however the shared memory segment is not removed.

$ ipcs -m

------ Shared Memory Segments --------

key        shmid   owner  perms bytes       nattch status

0x6faedb68 3604484 grid   660   4096        0

0x00000000 4718597 oracle 660   17181966336 1      dest

0x00000000 4521990 oracle 660   17181966336 1      dest

0x682f74fc 4980743 oracle 660   17181966336 78

0x68449b18 5046280 oracle 660   17181966336 81

0x681a4ee0 5111817 oracle 660   17181966336 80

$ ipcrm -m 4521990

$ ipcs -m

------ Shared Memory Segments --------

key        shmid   owner  perms bytes       nattch status

0x6faedb68 3604484 grid   660   4096        0

0x00000000 4718597 oracle 660   17181966336 1      dest

0x00000000 4521990 oracle 660   17181966336 1      dest

0x682f74fc 4980743 oracle 660   17181966336 79

0x68449b18 5046280 oracle 660   17181966336 81

CHANGES

RDBMS instance shutdown failed to clean-up all active bequeath connections.

The status column for the problem shared memory segment has a flag status of 'dest'.

The flag "dest" in the status column means that SHM_DEST flag has been set for that memory segment.

Setting this flag allows the operating system to automatically clean up the shared memory segment when it is no longer used.

CAUSE

There is still an active process associated with the shared memory segment, preventing the removal via ipcrm.

SOLUTION

Identify active processes holding open files on the shared memory segment using lsof.

For each problem shared memory ID# using lsof to identify the process ->

      lsof |egrep "<shmid>|COMMAND"

$ lsof |egrep "4718597|COMMAND"

oracle 1903 oracle mem REG 0,19 0 3985532

$ kill -9 1903

Re-running ipcs will show that the shared memory segment is now removed.

In the above example we only had 1 process reported.