Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Semaphore contention during databases startup

Timmy Sin
Advisor

Semaphore contention during databases startup

Hi All,

I've encountered a problem in my HP-UX 10.20 box with four Oracle 7.3.2 databases. For easy understanding, I named them as database A, B, C and D. The following database combination can coexist on the system.
A, C, D
B, C, D
The problem is that database A and B can not coexist on the system. Whenever either A or B has been started, the startup of the other database will result in the following error:
SVRMGR> Connected to an idle instance.
SVRMGR> ORA-07279: spcre: semget error, unable to get first semaphore set.
HP-UX Error: 28: No space left on device
Additional information: 1
SVRMGR>
I've looked up the error message from the forum and most of the recommendation is to increase the kernal parameter SEMMNS due to insufficient semaphore. It seems that it is not my case.
I got further information from the output from ipcs.
IPC status from /dev/kmem as of Mon Sep 30 09:45:23 2002
T ID KEY MODE OWNER GROUP
s 1516 0x00000000 --ra-r----- oracle dba
s 717 0x00000000 --ra-r----- oracle dba
s 319 0x00000000 --ra-r----- oracle dba
Upon my testing, I found that database A, B, C and D would get the semaphore ID 16, 16, 17 and 19 respectively during each startup. Database A and B could not coexist because they would try to acquire the same semaphore ID 16 during startup.
Do anyone have some idea on my foundings?

Many thanks.

Regards,
Timmy




7 REPLIES
Lee Tae-kyung
Regular Advisor

Re: Semaphore contention during databases startup

 
I think I am a specialist in IT Korea^^. I am a programmer and SE and DBA
Timmy Sin
Advisor

Re: Semaphore contention during databases startup

Hi Lee,

Thanks for your information.
My problem is that the four databases can coexist in the past. As far as I can remember, no change has been imposed on the server. The current founding is that for each database startup individually, they will acquire the sempahore ID each time(A-16,B-16,C-17,D-19). Two of the databases A and B would acquire the same ID 16 and thus cannot be started if the other one has already been started.

Regards,
Timmy
Lee Tae-kyung
Regular Advisor

Re: Semaphore contention during databases startup

Hi Timmy...

Refer to this document.
********************************************
A shared memory collision has occurred. Oracle uses the ORACLE_HOME and ORACLE_SID to hash a key id. The source of this problem is that a database name can be 8 characters long but a key (for shmget()) is only an integer (4 bytes). Therefore, some hashing must occur to compress the dbname into a key. As with all hashing, there is the possibility of different data hashing to the same key. Changing the name of one of the databases/SIDs causes a different key result from the hashing algorithm.
********************************************

From korea.
I think I am a specialist in IT Korea^^. I am a programmer and SE and DBA
Timmy Sin
Advisor

Re: Semaphore contention during databases startup

Hi Lee,

Thanks for your information again. It matches with my situation. However, if there is a chance that the same key would be resulted, there should be some mechanism to allocate another key. It sounds unreasonable to change the SID or home directory to get around this kind of problem.

Regards,
Timmy
Lee Tae-kyung
Regular Advisor

Re: Semaphore contention during databases startup

Hi Timmy...

As my opinion,
I think that this problem could occur because semmns and semmni is insufficient.

It seems a good idea that semmns and semmni is increased.
...
^_^

Good luck~~
I think I am a specialist in IT Korea^^. I am a programmer and SE and DBA
Brian Crabtree
Honored Contributor

Re: Semaphore contention during databases startup

You should check the "processes" and "sessions" init.ora parameters on both databases. Oracle will attempt to allocate the full number of processes each time the database starts up, and if both databases are attempting to load a large number of processes, it will fail trying to bring up the second instance.

The parameter to set is 'semmni'.

Thanks,

Brian
V. V. Ravi Kumar_1
Respected Contributor

Re: Semaphore contention during databases startup

hi,
try increasing SEMMNS and SEMMNI. typical values are 8000 and 4000 respectively.

regds
Never Say No