Oracle Corporate Support
                                 Problem Repository

1. Prob# 1011991.6  OVERVIEW OF UNIX FILE SYSTEM
2. Soln# 2060045.6  OVERVIEW OF UNIX FILE SYSTEM


1. Prob# 1011991.6  OVERVIEW OF UNIX FILE SYSTEM

Problem ID          : 1011991.6
Affected Platforms  : Generic: not platform specific
Affected Products   : Oracle7 Server
Affected Components : RDBMS Generic
Affected Oracle Vsn : Generic

Summary:
OVERVIEW OF UNIX FILE SYSTEM

+=+

Problem Description:
====================

This entry is an introduction to the Unix file system and covers the following
topics:

	* File System Structure
	* Ownership of Files
	* Permissions of Files
	* Showing Ownership and Permissions
	* Changing Ownership and Permissions


+==+

Diagnostics and References:

 * {3072.6,Y,100}     BASIC INFORMATION
 * {6932.6,Y,100}     FILE SYSTEM


2. Soln# 2060045.6  OVERVIEW OF UNIX FILE SYSTEM

Solution ID         : 2060045.6
For Problem         : 1011991.6
Affected Platforms  : Generic: not platform specific
Affected Products   : Oracle7 Server
Affected Components : RDBMS Generic
Affected Oracle Vsn : Generic

Summary:
OVERVIEW OF UNIX FILE SYSTEM

+=+

		Overview of the UNIX File System
		================================

File System Structure
---------------------
The UNIX file system is a hierarchical structure made up of files and
special files called directories.

    Files
    - - -
    UNIX files contain information: text, data, executable programs, etc.

    Directories
    - - - - - -
    Directories provide a structure for organizing files.  Directories
    located under other directories are called subdirectories.  Files are
    grouped under directories beginning with the "root" directory in a
    branching structure.

              root/
              ----
               /
              /  \
             /    \
            /      \
           /        \
        bin/         home/  ($ORACLE_HOME)
        ---          ----
        cd            /\
        chmod        /  \
        chown      bin/  rdbms/
        chgrp      ---   ----
        ls               /|\
        pwd             / | \
                       /  |  \
                      /   |   \
                     /    |    \
                  admin/  |    lib/
                  -----        ---
                         doc/
                         ---
Ownership
---------
Each file and directory has three associated ownership statuses.  Each
ownership type has a permissions status assigned to it.  These three
ownership types are associated with every file:

    o   user    the owner of the file or directory
    o   group   members of the group associated with the file or directory
    o   other   everyone else (also called "world", or "public")

The default "user" is the creator of the file or directory.  The default
"group" is the group the file creator belongs to.  Other consists of
everyone else on the system.

Permissions
-----------
Permissions determine the kind of access users are granted to a file.  The
three kinds of permissions are:
    o   r    read allows reading of a file
    o   w    write allows writing to a file
    o   x    execute allows executing a file or searching a directory

These permissions are set on or off for each of the three ownership
types: "user", "group", and "world".

    Setuid Permissions
    - - - - - - - - -
    In addition there are "setuid" permissions:
    o   s    set "user" ID on execution
    o   s    set "group" ID on execution

    Setting the "uid" bit of an executable file causes it to be run as if its
    owner was running it.

    Setting the "gid" bit of an executable file causes it to be run as if a
    member of its group was running it.

    Setting the "sticky" bit of an executable file causes its process to be
    pinned in memory, preventing the process from being swapped out.  This
    improves the performance of the executable.

    Setting the "sticky" bit a directory, however, performs a different
    function.  If the "sticky" bit of a directory is set, then the files
    placed in that directory can only be removed by the file's true owner, no
    matter what the read, write, or execute permissions of the file may be set
    to.  Typically, this this is done for the /temp directory where many users
    will temporarily store their files.




Showing Ownership and Permissions
---------------------------------
Use the UNIX command "ls" to display ownership and permission
information.  For example, to see the ownership and permissions
of the "oracle" executable type:
    %  ls -l  $ORACLE_HOME/bin/oracle
    -rwsr-s--x   1 usupport dba      7100499 Mar 15 09:30 oracle

Note that when the "setuid" or "setgid" bits of an executable are set, an "s"
replaces the "x" for user or group permissions.

Changing Ownership and Permissions
----------------------------------
The user, group, and permissions for any file can be changed
using the following UNIX commands.  Change the:
    o  user with "chown"
    o  group with "chgrp"
    o  permissions with "chmod"

The command "man <command name>" on any UNIX system will display
a manual page for that command.


NOTE:

Permissions are constructed from the OR of any of the following modes:

    0444      Allow read by owner, group, other
    0222      Allow write by owner, group, other
    0111      Allow execute (search in directory) by owner, group, other
    4000      Set user ID on execution
    20#0      Set group ID on execution if # is 7, 5, 3, or 1
              Enable mandatory locking if # is 6, 4, 2, or 0
              This bit is ignored if the file is a directory

For example:

    rwx------

    0400      read by owner
    0200      write by owner
  + 0100      execute (search in directory) by owner
    ----
     700      read, write, and execute (search) by owner


    rwsr-x--x

    0440      read by owner, group
    0200      write by owner
    0111      execute (search in directory) by owner, group, and other
  + 4000      Set user ID on execution
    ----
    4751      read, write, and execute (search) by owner
              read, and execute (search) by group and other
              set user ID on execution


+==+

References:

 ref: {4538.6}     PRE-1011995.6
 ref: {4539.6}     PRE-1008884.6