cancel
Showing results for 
Search instead for 
Did you mean: 

IPC Resources & Oracle...

Duncan Edmonstone
Honored Contributor

IPC Resources & Oracle...

Hi,

Following on from this post:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=274670

I became a little concerned about Hein's comments that the 'sysresv' utility does not always identify every shared memory segment that oracle uses. A little testing found this to be true... so I'm now trying to work on a utility that can accurately identify all the shared memory segments and semaphore sets used by an oracle instance - after a little research I've decided that parsing the output of 'oradebug ipc' is the most reliable method of establishing these values, to wit I have written the attached script.

The script currently gathers and prints details on shared memory segments, HOWEVER:

1. I'm not that confident that I am parsing the file in a 'reliable' fashion - there doesn't seem to be much of a standard layout to oracle trace files - I've tested this on HP-UX11.00/8.1.7 and RedHatLinux/9.2.0 OS/Oracle combinations, but that doesn't give me much confidence yet...

2. I'm a little unsure as how to proceed on semaphore sets... the problem is that on all oracle databases that I have access to, there is only one semaphore set in use, so I have no idea what the trace file looks like when there are multiple semaphore sets in use...

So I need some help if possible -

- Anyone who's happy to run this on their test systems, please do, and let me know if it acurately parses your shared memory segments (together with your OS version & Oracle Version). The script certainly works on HP-UX and Linux - its untested on Solaris and AIX, but should work (although oracle doesn't use semaphores on AIX). If it doesn't work, can you post an output of your 'oradebug ipc' so I can figure out what I'm missing. You need to change the ORACLE_HOME and ORACLE_SID values at the top before running (yes this will all be automated later)

- Anyone out there with >1 semaphore set in use by their database, can you just post your 'oradebug ipc' outputs so I can figure out how to parse this?

And naturally, other interesting comments welcome...

Cheers

Duncan

HTH

Duncan
4 REPLIES
Geoff Wild
Honored Contributor

Re: IPC Resources & Oracle...

Well...I ran it on my system:

HP-UX 11i and Oracle 9.2

Your script:

sh ora.shmmem
m 628228

ipcs:

m 628228 0x935edde8 --rw-rw---- oraie1 dba


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Duncan Edmonstone
Honored Contributor

Re: IPC Resources & Oracle...

ping...

just wanted to keep this near the top...

duncan

HTH

Duncan
Duncan Edmonstone
Honored Contributor

Re: IPC Resources & Oracle...

ping... again...

Duncan

HTH

Duncan
Duncan Edmonstone
Honored Contributor

Re: IPC Resources & Oracle...

OK, this is getting frustrating... I finally managed to set up an instance that uses multiple semaphore sets on a Linux box... I start my instance and see 5 semaphore sets used, and 9 shared memory segments.

[oracle@redhat102390mr oracle]$ ipcs -sm

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 65538 gdm 777 196608 2 dest
0x00000000 131075 gdm 777 196608 2 dest
0x00000000 4227076 oracle 640 4194304 8
0x00000000 4259845 oracle 640 33554432 8
0x00000000 4292614 oracle 640 33554432 8
0x00000000 4325383 oracle 640 33554432 8
0x00000000 4358152 oracle 640 33554432 8
0x00000000 4390921 oracle 640 33554432 8
0x00000000 4423690 oracle 640 33554432 8
0x00000000 4456459 oracle 640 33554432 8
0x26d68a6c 4489228 oracle 640 20971520 40

------ Semaphore Arrays --------
key semid owner perms nsems status
0xa26dca80 2064384 oracle 640 126
0xa26dca81 2097153 oracle 640 126
0xa26dca82 2129922 oracle 640 126
0xa26dca83 2162691 oracle 640 126
0xa26dca84 2195460 oracle 640 126


Using sysresv, I see only four shared memory segments, and all 5 semaphore sets:

[oracle@redhat102390mr oracle]$ sysresv

IPC Resources for ORACLE_SID "lindb1" :
Shared Memory:
ID KEY
4227076 0x00000000
4259845 0x00000000
4292614 0x00000000
4325383 0x00000000
Semaphores:
ID KEY
2064384 0xa26dca80
2097153 0xa26dca81
2129922 0xa26dca82
2162691 0xa26dca83
2195460 0xa26dca84
Oracle Instance alive for sid "lindb1"

Using 'oradebug ipc', I see all 9 shared memory segments, and only 1 of the semaphores:

/usr/oracle/product/9.2/admin/lindb1/udump/lindb1_ora_6482.trc
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production
ORACLE_HOME = /usr/oracle/product/9.2
System name: Linux
Node name: redhat102390mr
Release: 2.4.9-e.24
Version: #1 Tue May 27 16:15:51 EDT 2003
Machine: i686
Instance name: lindb1
Redo thread mounted by this instance: 1
Oracle process number: 10
Unix process pid: 6482, image: oracle@redhat102390mr (TNS V1-V3)

*** 2003-12-16 14:21:51.570
*** SESSION ID:(9.101) 2003-12-16 14:21:51.570
Dump of unix-generic skgm context
areaflags 00000067
realmflags 0000000f
mapsize 00000800
protectsize 00001000
lcmsize 00001000
seglen 00400000
largestsize 00000000f8000000
smallestsize 0000000001000000
stacklimit 0xbfe6d5c4
stackdir -1
mode 640
magic acc01ade
Handle: 0xaa9b598 `/usr/oracle/product/9.2lindb1'
Dump of unix-generic realm handle `/usr/oracle/product/9.2lindb1', flags = 00000000
Area #0 `Fixed Size' containing Subareas 0-0
Total size 000000000006e478 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
0 0 4227076 0x00000050000000 0x00000050000000
Subarea size Segment size
000000000006f000 0000000000400000
Area #1 `Variable Size' containing Subareas 1-8
Total size 000000000f000000 Minimum Subarea size 01000000
Area Subarea Shmid Stable Addr Actual Addr
1 1 4259845 0x00000051000000 0x00000051000000
Subarea size Segment size
0000000002000000 0000000002000000
Area Subarea Shmid Stable Addr Actual Addr
1 2 4292614 0x00000053000000 0x00000053000000
Subarea size Segment size
0000000002000000 0000000002000000
Area Subarea Shmid Stable Addr Actual Addr
1 3 4325383 0x00000055000000 0x00000055000000
Subarea size Segment size
0000000002000000 0000000002000000
Area Subarea Shmid Stable Addr Actual Addr
1 4 4358152 0x00000057000000 0x00000057000000
Subarea size Segment size
0000000002000000 0000000002000000
Area Subarea Shmid Stable Addr Actual Addr
1 5 4390921 0x00000059000000 0x00000059000000
Subarea size Segment size
0000000002000000 0000000002000000
Area Subarea Shmid Stable Addr Actual Addr
1 6 4423690 0x0000005b000000 0x0000005b000000
Subarea size Segment size
0000000002000000 0000000002000000
Area Subarea Shmid Stable Addr Actual Addr
1 7 4456459 0x0000005d000000 0x0000005d000000
Subarea size Segment size
0000000002000000 0000000002000000
Area Subarea Shmid Stable Addr Actual Addr
1 8 4489228 0x0000005f000000 0x0000005f000000
Subarea size Segment size
0000000001000000 0000000001400000
Area #2 `Redo Buffers' containing Subareas 9-9
Total size 00000000000a3000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
2 9 4489228 0x00000060000000 0x00000060000000
Subarea size Segment size
00000000000a3000 0000000001400000
Area #3 `skgm overhead' containing Subareas 10-10
Total size 0000000000001000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
3 10 4489228 0x000000600a3000 0x000000600a3000
Subarea size Segment size
0000000000001000 0000000001400000
Dump of Solaris-specific skgm context
sharedmmu 00000000
shareddec 0
used region 0: start 0000000020000000 length 0000000020000000
used region 1: start 0000000042000000 length 000000001f000000
Maximum processes: = 500
Number of semaphores per set: = 126
Semaphores key overhead per set: = 4
User Semaphores per set: = 122
Number of semaphore sets: = 5
Semaphore identifiers: = 5
Semaphore List=
2064384



So is there *any* reliable way of gathering this data?

Cheers

Duncan

HTH

Duncan