dbaXchange.com


Database Resources
- RDBMS Server
-
Database Administration
-
Performance Tuning
-
Backup and Recovery
-
Oracle Utilities

-
SQL and PLSQL
-
Network Administration
-
Client Applications
-
Miscellaneous Stuff

Oracle's technology Sites

http://technet.oracle.com

http://metalink.oracle.com

http://asktom.oracle.com/

http://www.oramag.com


Search this site or the web


Site search Web search powered by FreeFind



 

Category     : Database Resources -> RDBMS Server

DB Version  : Oracle 8i / Oracle 9i

OS Details    : Sun Solaris9

If you had to deal with the "ORA-27123:  unable to attach to shared memory segment" error then chances are that you are facing a "sticky bit" problem. This article is split in to two parts : The first part of this article gives the technical explanation on what a sticky bit means and in the second part of the article we will see where oracle uses the Sticky Bit and also look at ways where we can overcome the errors that can potentially arise due to missing sticky bit attributes on files.

PART 1:

STICKY BIT one-on-one:

There are times when an unprivileged user must be able to perform tasks that require privileges.  A good example is the passwd utility which allows the user to change his or her password but not change the actual file "/etc/passwd" that stores the password.  To find a way around this problem, UNIX allows for programs with proper privileges, to change the files even though the user who runs the program has no "write" or "execute" privileges on the file.  A program that changes its UID  is called a SUID program.
 
When a SUID program is run, its effective UID becomes that of the owner of the file, rather than of the user who is running it.   If a program is SUID or  SGID.  
 
The output of the "ls -al" command will have the x in the display changed to an s
 
CONTENTS   PERMISSION   MEANING
 
---s-----             SUID         A process that executes a SUID program has its
                                         effective UID set to be the UID of the programs owner.
 
-----s--              SGID         A process that executes an SGID program has it
                                         Changed to the programs GID.  Files created by the   
                                         process can have their primary group set to the GID
                                         as well, depending on the permissions of the
                                         directory.
 
-rwsr-sr-t 
 
The first s indicates the program is suid
The second s indicates the program is sgid

An Example of how the sticky bit is shown when the ls command is used on the file: 
 

ls -l /oraclehome/test

-rr-Sr-T 1 oracleuser  dba   24524 Oct  20 2005 /oraclehme/test
 

PART 2:

One situation where sticky bits can potentially cause problems are when you copy the oracle software or the remote login password file to another machine and try to use it at the new location. Chances are that the sticky bit attributes might not have been propagated with the copy in which case you might end up with this error : "ORA-27123:  unable to attach to shared memory segment" when you try to use the program. If you encounter this error then you'll have to manually set the sticky bit on the file(s). Let's take the case of the remote login password file :

With the sticky bit attribute not propagated during a manual copy of the file:

ls -al orapw

 -rw-r----- 1 oracle9i  dba   3584 Oct  20 2005 orapw

Manually set the sticky bit as follows:

chmod 4640 orapw

After the sticky bit's been set:

ls -al orapw

 -rwSr----- 1 oracle9i  dba   3584 Oct  20 2005 orapw