Skip to content

DBAzine.com

Sections
Personal tools
You are here: Home » 10g » Oracle10g Articles » Orientation to the Linux Filesystem Hierarchy for Oracle10g Users
Who Are You?
I am a:
Mainframe True Believer
Distributed Fast-tracker

[ Results | Polls ]
Votes : 3548
 

Orientation to the Linux Filesystem Hierarchy for Oracle10g Users

by Sheryl Calish

Before Oracle 10g can be installed on Linux, there are several tasks that need to be performed. For someone preparing to install Oracle 10g on a Linux operating system for the first time, however, there is one extra and critical task: to gain a basic familiarity with the Linux environment.

This basic familiarity should include subjects such as knowing how to get around the File System Hierarchy (FSH) and knowing where to find things within that hierarchy. With this knowledge, you will be better able to monitor and administer an Oracle 10g database on a Linux system.

Unlike Windows, which puts all application files in one directory, a UNIX-compatible system like Linux distributes application files into different directories based on characteristics like function, variability, and shareability in accordance with the FSH, published by the Filesystem Hierarchy Standard Group.

In this article, I hope to prepare new Linux users for an installation of Oracle 10g on Linux by providing an overview of Linux Filesystem Hierarchy, with special attention to the directories and files pertinent to an installation of Oracle 10g.

The Filesystem Hierarchy Standard (FHS)

The FHS provides a standard set of guidelines for file organization in Linux. In Linux, files are managed by the operating system as opposed to the programs they belong to, as they are in Windows. This means they are distributed about the filesystem based on certain characteristics. Although this may be a bit confusing to new users, the FHS actually aids application installation software and allows users to predict the location of installed files and directories.

Linux organizes files by their usage characteristics, which includes:

shareable files, which can be stored on one host and used by others
unshareable files, which are system-specific configuration files that must be

      • stored locally on that system
      • static files, which never change
      • variable files, which do change

The FHS also aids in disk partitioning. By allowing files that change often to be grouped together, this system is designed to facilitate back up decisions. You don’t necessarily need to back up files in static directories, as they can be restored from installation media.

Major Directories

So now, with these basics in mind, let’s take a look at the major directories and some of the files in them that are of most interest to Oracle 10g users.

/boot, / (root) and /root

According to the FSH, the root filesystem needs to be able to boot, restore, recover and/or repair the system. The FSH also recommends that this filesystem be kept small because:

      • it is sometimes loaded from very small media
      • it contains many files that, even in a networked system, are unshareable, like system-specific configuration files
      • the smaller the root filesystem, the less likely it is to be corrupted by a system crash

The /boot directory contains the unshareable and static configuration files needed by the boot loader. This data is used before the kernel executes user programs. On booting, the first task is to load the Linux kernel, which is usually /vmlinuz or /boot/vmlinuz. On some systems, with multiple kernel images, you may see /boot/vmlinuz[-kernel-version].

The / and /root directories are not the same. The root directory, denoted by “/,” is the parent directory from which all other directories are mounted:

$ ls /
bin   media  opt  proc  sbin  u01  usr boot  dev    etc 
home  lib    mnt  root  tmp   u02  var

while /root is the home directory for the root user. Since the superuser, who logs in as /root may keep extra tools that would be used for repair and recovery, it is here instead of under the /home directory with other users.

/bin, /sbin and /lib

Both /bin and /sbin contain essential system binaries. Because these two directories contain all the commands you would need to boot, repair, or recover your system, it makes sense to leave these in the root filesystem partition.

The /bin directory contains the commands you would need for minimum operability, as when you need to repair your system from a start-up disk. It also contains commands that users other than the system administrator would use.

/sbin, on the other hand, contains the rest of the commands needed for system administration by the root user. Within this directory you can find the file /sbin/init, which is the father of all processes. It loads all services, user-space tools, and all partitions. You can configure /sbin/init by making changes in the /sbin/inittab file.

The file /sbin/sysctl is used to check the kernel parameters in preparation for installation of Oracle 10g.

# /sbin/sysctl -a | grep shm
scalish@linux:~> /sbin/sysctl -a | grep shm
kernel.shmmni = 4096kernel.shmall = 2097152
kernel.shmmax = 2147483647
kernel.shm-use-bigpages = 0

# /sbin/sysctl -a | grep sem
kernel.sem = 250        32000   100     256

# /sbin/sysctl -a | grep file-max
fs.file-max = 52320
scalish@linux:~> /sbin/sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 32768    61000

/lib contains shared library images, like those of the C compiler. Some of the files here are needed by binaries in /bin and /sbin, as well as by Oracle 10g.

/etc

The /etc directory is unshareable and static because it contains host-specific system configuration files. These are important configuration files you will want to back up because they are useful for repairing and for doing upgrades to your system.

The first script to be executed by init on system start up is /etc/init.d/boot. It is the master script for configuring the boot process, and is located in /etc/init.d/boot. It sets the environment path, starts swap, initializes the system, executes the filesystem check, and initializes the hardware.

/etc/inittab is the main configuration file that is executed on start up. It sets the default runlevel and tells init how to handle each runlevel. Scripts for configuring the different runlevels are found in the /etc/init.d directory. (Note: Some distributions put the runlevel scripts into the /etc/rc.d directory instead of /etc/init.d.)

/etc/fstab is the file of interest to users of Oracle 10g RAC, as it is necessary to add a line here when you add a new disk. All partitions listed in this file are mounted by /sbin/init.

Red Hat users must set the needed Oracle 10g kernel parameters at runtime by editing /etc/sysctl.conf as follows:

# cat >> /etc/sysctl.conf <<EOF
> kernel.shmall = 2097152
> kernel.shmmax = 2147483648
> kernel.shmmni = 4096
> kernel.sem = 250 32000 100 128
> fs.file-max = 65536
> net.ipv4.ip_local_port_range = 1024 65000
> EOF

SuSE 8.0 uses the /etc/init.d/oracle file installed by SuSE’s orarun program to set the kernel parameters required by Oracle. It is also used to automatically start Oracle on boot if the entry in /etc/oratab is set to “Y” at the end of the following line of code:

oracle_sid:$ORACLE_HOME:Y

/etc/profile.d/oracle.sh and /etc/profile.d/oracle.csh set the login environment variable setting for Oracle in the Bourne and c-shells respectively. The /etc/oraInst.loc file records the location of the oraInventory directory, which keeps an inventory of products that Oracle Universal Installer has installed.

$ more /etc/oraInst.loc
inventory_loc=/opt/oracle/oraInventory
inst_group=

/etc/init.d/oracleasm loads and initializes the new ASM driver in Oracle 10g.

/etc/X11/XF86Config — the configuration file for Xfree86 versions 3 and 4, the X Window system.

/usr and /opt

Both of these directories hold shareable static data. The /usr directory itself holds read-only data. However, /usr/local can be written to when installing software that is local to the system, like a browser, for example.

To add the required groups and users needed for an Oracle 10g installation, you would use

# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/useradd -m -g oinstall -G dba oracle

/usr/sbin/rcoracle can be used to set kernel parameters and other environment variables needed by Oracle dynamically. And the /usr/local/bin/ directory holds locally installed hardware. Most pertinent to Oracle 10g users are the following files under /usr/local/bin:

ls -l /usr/local/bin
total 12
-rwxr-xr-x    1 oracle   root         2316 Aug 27  2002 coraenv
-rwxr-xr-x    1 oracle   root         2415 Aug 27  2002 dbhome
-rwxr-xr-x    1 oracle   root         2548 Aug 27  2002 oraenv

The file oraenv is used to condition a user’s environment for access to an ORACLE database and /usr/local/bin/coraenv is used to condition a user’s environment for the C shell, while /usr/local/bin/dbhome is used to locate the ORACLE_HOME for a given sid. Most user-executable commands reside in the /usr/bin subdirectory, including /usr/bin/raw, which is used for creating raw devices.

Space for add-on applications is reserved in /opt. Some distribuitions, such as SuSE, prefer to put the Oracle 10g software here by default. Optimal Flexible Architecture (OFA) for Oracle 10g, however, recommends that you create a separate partition mounted on /u01 for the database software.

/var and /tmp

As the name suggests the /var directory holds files such as log files that vary quite a bit.

The /tmp directory is for applications that need temporary files to operate. The FHS recommends that here will be preserved from one invocation to the next. FHS also recommends that the /tmp directory contents be deleted when a system is booted.

/dev and /proc

Device files that allow programs to communicate with the system’s hardware and peripherals, such as /dev/, are located in /dev.

The /proc directory is a pseudo-file system generated by the kernel that contains a treasure trove of interesting information that is useful for monitoring system performance. Some files, however, are only readable by the root user.

Click here for a listing of all the files in the /proc system. The numbered entries in the directory listing above correspond to process ID (PID). For instance,

Each PID directory holds even more information

$ls /proc/1107
. .. cmdline cwd environ exe fd maps mem root stat statm status

Delving even further into the /proc/1107 directory, the current working directory for a process, cwd, shows the Oracle initialization files used by that PID:

$ ls /proc/1107/cwd
. .. init.ora initdw.ora initora1.ora lkBH orapwora1 spfileora1.ora

A few of the other interesting tidbits you can find in /pric include your system's version information:

$ cat /proc/version
Linux version 2.4.18-4GB (root@Pentium.suse.de) (gcc version
2.95.3 20010315 (SuSE)) #1 Wed Mar 27
13:57:05 UTC 2002

and hardware information:

$ cat /proc/cpuinfo
processor       : 0v
endor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Celeron (Coppermine)
stepping        : 3
cpu MHz         : 697.896
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep 
mtrr pge mca cmov pat pse36 mmx fxsr sse bogomips : 1392.64

Some of the /proc files are human readable and others are not, so utilities exist that makes the information more presentable. Unfortunately, that topic is beyond the scope of this article.

/home

User directories are placed in the /home directory as is the oracle user.

$ ls /home
bluher oracle sheryl test

This is not the same as the ORACLE_HOME, which is the location of the Oracle 10g software held in a shell environment variable.

echo $ORACLE_HOME
/opt/oracle/product/oracle

/media and /mnt

The /media directory is the mount point for removable media, like floppy disks, cdroms, and zip disks. Some distributions use the /mnt directory for this instead, but since this was traditionally used as a temporary mount point in UNIX-based systems, the FHS recommends using the /media directory instead.

And More

Although we have covered all the major directories required for compliance with the Filesystem Hierarchy Standard, this is by no means all of the files used by a Linux implementation. I have tried to cover here the files that would be of most interest to a user of Oracle 10g. Taking the time to explore your filesystem files is a worthwhile endeavor for Linux newcomers and veterans alike.

--

Sheryl Calish is an Oracle developer, specializing in Linux, for Blue Heron Consulting. She is also founding chair for the Central Florida Oracle Users Group.


Contributors : Sheryl Calish
Last modified 2005-04-18 03:30 PM
Transaction Management
Reduce downtime and increase repeat sales by improving end-user experience.
Free White Paper
Database Recovery
Feeling the increased demands on data protection and storage requirements?
Download Free Report!
 
 

Powered by Plone