Wednesday, January 28, 2009

ORA-27123: unable to attach to shared memory segment

Hello,

Of late, in one of our test unix (Sun Solaris) boxes, a database user is trying to connect to the database, but getting an error ORA-27123: unable to attach to shared memory segment” with permission denied issue.

Initially we thought that there might be an issue with SGA memory area or may be an issue with the shared memory segments and semaphores for the instance allocated. But later we found that the permission on ORACLE_HOME directory got changed accidentally with the full permission.

Here are our findings:

$ sqlplus testusr/password@testdb

SQL*Plus: Release 10.2.0.2.0 - Production on Tue Jan 27 20:53:44 2009

Copyright (c) 1982, 2005, Oracle. All Rights Reserved.

ERROR:
ORA-01034: ORACLE not available
ORA-27123: unable to attach to shared memory segment
SVR4 Error: 13: Permission denied
As per Oracle Error Messages:

Error: ORA-27123: unable to attach to shared memory segment
Cause: shmat() call failed
Action: check permissions on segment, contact Oracle support
Check the oracle executable file permission.

$ cd $ORACLE_HOME/bin
$ ls -l oracle
-rwxrwxr-x 1 oracle dba 119582976 Feb 3 2008 oracle
Here the oracle file permission has -rwxrwxr-x i.e. 775, but this file must have the permission -rwsr-s- -x i.e. 6751

Change the permissions for oracle file.

$ cd $ORACLE_HOME/bin
$ chmod 6751 oracle
$ ls -l oracle
-rwsr-s--x 1 oracle dba 119582976 Feb 3 2008 oracle
After changing the permissions on oracle executable file, all the users are now able to connect to the database without any errors.

Note: For further information refer the Oracle Metalink Note ID: 1011995.6 Subject: COMMON ORACLE PERMISSION PROBLEMS ON UNIX.

Regards,
Sabdar Syed

10 comments:

Unknown said...

Dear Sabdar,

Very nice and useful explanation.
Keep it up.

Regards,
Mujeeb, DBA , Abu Dhabi.

lelle_oracle said...

Working solution, thanks a lot!

Waqar A. said...

Hey Sabdar,
Thanks, it works.

Ricardo Vidal said...

Hi Sabdar,

Nice explanation but i want to append one more cause. Sometimes this error rise up after making changes to size of some parameters like sga_max_size and applying them; In case like that, usually is the kernel parameters failure at the sizing. I mean that shmmax must be bigger than sga_max_size (at least 10% bigger).

I wish this append help u!

Regards,
Ricardo, DBA, Madrid

Unknown said...

A very nice answer to fix the issue

keep it up

regards,
Sravan India.

Anonymous said...

HI Sabdar,

The explanation what u given is very useful in fixing the issue


regards,
Sravan India.

Ganesh Shankaran said...

Thank you!! This was an extremely accurate and concise solution to the problem. Keep it up!

Anonymous said...

it is very useful sabdar

Abdul Kareem Affan said...

good post.... really helpful... keep up the good work.

zoot suit said...

Thanks for the brief explanation,It help me a lot.