Wednesday, April 22, 2009

10g Release 2 (10.2) Installation

=======================================================================
http://www.oracle.com/pls/db102/homepage

http://download.oracle.com/docs/cd/B19306_01/install.102/b15667/preface.htm

Oracle® Database Installation Guide
10g Release 2 (10.2) for Linux x86-64
Part Number B15667-03

Hardware Requirements
=====================
At least 1 GB of physical RAM

Swap Space
==========
RAM Swap Space
Up to 512 MB 2 times the size of RAM
Between 1024 MB and 2048 MB 1.5 times the size of RAM
Between 2049 MB and 8192 MB Equal to the size of RAM
More than 8192 MB 0.75 times the size of RAM

400 MB of disk space in the /tmp directory

Between 1.5 GB and 3.5 GB of disk space for the Oracle software, depending on the installation type

1.2 GB of disk space for a preconfigured database that uses file system storage (optional)

To ensure that the system meets these requirements:
===================================================
To determine the physical RAM size, enter the following command:
# grep MemTotal /proc/meminfo
If the size of the physical RAM is less than the required size, then you must install
more memory before continuing.

To determine the size of the configured swap space, enter the following command:
# grep SwapTotal /proc/meminfo
If necessary, refer to the operating system documentation for information about
how to configure additional swap space.

To determine the available RAM and swap space, enter the following command:
# free

To determine the amount of disk space available in the /tmp directory, enter the following command:
# df -k /tmp

If there is less than 400 MB of free disk space available in the /tmp directory, then
complete one of the following steps:
Delete unnecessary files from the /tmp directory to meet the disk space
requirement.
Set the TEMP and TMPDIR environment variables when setting the oracle
user's environment
Extend the file system that contains the /tmp directory. If necessary, contact your system administrator for information about extending file systems.

To determine the amount of free disk space on the system, enter the following command:
# df -k

The following table shows the approximate disk space requirements for software
files for each installation type:

Installation Type Requirement for Software Files (GB)
Enterprise Edition 1.9
Standard Edition 1.9
Custom (maximum) 2.0

To determine whether the system architecture can run the software, enter the following command:
# grep "model name" /proc/cpuinfo

Checking the Software Requirements

To determine which distribution and version of Linux is installed, enter the following command:
# cat /proc/version

To determine whether the required kernel is installed, enter the following command:
# uname -r


The following is sample output displayed by running this command on a Red Hat
Enterprise Linux 3.0 system:
2.4.21-27.EL
In this example, the output shows the kernel version (2.4.27) and errata level
(27.EL) on the system.

Kernel version The system must be running the following kernel version (or a later version):
Red Hat Enterprise Linux 3.0:
2.4.21-27.EL
Note: This is the default kernel version.
Red Hat Enterprise Linux 4.0:
2.6.9-11.EL
SUSE Linux Enterprise Server 9.0:
2.6.5-7.201

To determine whether the required packages are installed, enter commands similar to the following:
# rpm -q package_name
install rpm
rpm -Uvh gcc-3.4.4-2.x86_64.rpm

#Checking/Updating the redhat-release File

Verify that the redhat-release RPM is installed on your Red Hat system:

#rpm -q redhat-release

On RHEL AS 4 (for 10g R1), RH9, and FC 1 you have to change the /etc/redhat-release file to make Oracle 10g believe it's running on a supported release.
Regarding RHEL AS 4, the installer for 10g 10.1.0.3 does not recognize RHEL AS 4 as a supported release but 10g R2 OUI does.

To change the /etc/redhat-release file, you can simply copy/paste the following commands:

#su - root
cp /etc/redhat-release /etc/redhat-release.orig
cat > /etc/redhat-release << EOF
Red Hat Enterprise Linux AS release 3 (Taroon)
EOF


Checking the Network Setup
==========================

Configuring Name Resolution

When you run Oracle Universal Installer, an error may occur if name resolution is not
set up. To avoid this error, before you begin installation, you must ensure that host
names are resolved only through the /etc/hosts file.
To ensure that host names are resolved only through the /etc/hosts file:

Verify that the /etc/hosts file is used for name resolution. You can do this by checking the hosts file entry in the nsswitch.conf file as follows:
# cat /etc/nsswitch.conf | grep hosts

The output of this command should contain an entry for files.

Verify that the host name has been set by using the hostname command as follows:
# hostname

The output of this command should be similar to the following:
myhost.mycomputer.com

Verify that the domain name has not been set dynamically by using the domainname command as follows:
# domainname

This command should not return any results.

Verify that the hosts file contains the fully qualified host name by using the following command:
# cat /etc/hosts | grep `eval hostname`

The output of this command should contain an entry for the fully qualified host
name and for localhost.
For example:
192.168.100.16 myhost.us.mycompany.com myhost
127.0.0.1 localhost localhost.localdomain
If the hosts file does not contain the fully qualified host name, then open the file
and make the required changes in it.

Setting the ORACLE_HOSTNAME Environment Variable
=================================================
Use the following procedure to set the ORACLE_HOSTNAME environment variable.
For example, if the fully qualified host name is somehost.us.acme.com, then enter
one of the following commands:
Bourne, Bash, or Korn shell:
$ ORACLE_HOSTNAME=somehost.us.acme.com
$ export ORACLE_HOSTNAME
C shell:
% setenv ORACLE_HOSTNAME somehost.us.acme.com


Creating Required Operating System Groups and Users
===================================================
The following operating system groups and user are required if you are installing
Oracle Database:

The OSDBA group (dba)
You must create this group the first time you install Oracle Database software on
the system. It identifies operating system user accounts that have database
administrative privileges (the SYSDBA privilege). The default name for this group
is dba.

The OSOPER group (oper)
This is an optional group. Create this group if you want a separate group of
operating system users to have a limited set of database administrative privileges
(the SYSOPER privilege). By default, members of the OSDBA group also have the
SYSOPER privilege.

The following operating system group and user are required for all installations:

The Oracle Inventory group (oinstall)
You must create this group the first time you install Oracle software on the system.
The usual name chosen for this group is oinstall. This group owns the Oracle
inventory, which is a catalog of all Oracle software installed on the system.

The Oracle software owner user (typically, oracle)

You must create this user the first time you install Oracle software on the system.
This user owns all of the software installed during the installation. This user must
have the Oracle Inventory group as its primary group. It must also have the
OSDBA and OSOPER groups as secondary groups.

Creating the Oracle Inventory Group
===================================
Determining Whether the Oracle Inventory Group Exists

When you install Oracle software on the system for the first time, Oracle Universal
Installer creates the oraInst.loc file. This file identifies the name of the Oracle
Inventory group and the path of the Oracle Inventory directory.
To determine whether the Oracle Inventory group exists, enter the following command:

# more /etc/oraInst.loc

If the output of this command shows the oinstall group name, then the group already exists.
If the oraInst.loc file exists, then the output from this command is similar to the following:

inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
The inst_group parameter shows the name of the Oracle Inventory group,oinstall.

Creating the Oracle Inventory Group

If the oraInst.loc file does not exist, then create the Oracle Inventory group by entering the following command:

# /usr/sbin/groupadd oinstall

Creating the OSDBA Group
========================
To determine whether the OSDBA group exists, enter the following command:
# grep dba /etc/group

If the OSDBA group does not exist or if you require a new OSDBA group, then create it as follows.In the following command, use the group name dba unless a group with
that name already exists.

# /usr/sbin/groupadd dba

Creating the Oracle Software Owner User
=======================================
Determining Whether an Oracle Software Owner User Exists
To determine whether an Oracle software owner user named oracle exists, enter the following command:
# id oracle

If the oracle user exists, then the output from this command is similar to the following:
uid=440(oracle) gid=200(oinstall) groups=201(dba),202(oper)


Creating an Oracle Software Owner User
======================================
If the Oracle software owner user does not exist or if you require a new Oracle
software owner user, then create it as follows. In the following procedure, use the user
name oracle unless a user with that name already exists.

To create the oracle user, enter a command similar to the following:

# /usr/sbin/useradd -g oinstall -G dba[,oper] oracle
In this command:
The -g option specifies the primary group, which must be the Oracle

Inventory group, for example oinstall
The -G option specifies the secondary groups, which must include the OSDBA

group and if required, the OSOPER group. For example, dba or dba,oper

Set the password of the oracle user:

# passwd oracle

#To create the oracle account and groups, execute the following commands:

su - root
groupadd dba # group of users to be granted SYSDBA system privilege
groupadd oinstall # group owner of Oracle files
useradd -c "Oracle software owner" -g oinstall -G dba oracle
passwd oracle

Configuring Kernel Parameters
====================================
Using any text editor, create or edit the /etc/sysctl.conf file, and add or edit lines similar to the following:

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
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

By specifying the values in the /etc/sysctl.conf file, they persist when you
restart the system.
On SUSE systems only, enter the following command to ensure that the system
reads the /etc/sysctl.conf file when it restarts:
# /sbin/chkconfig boot.sysctl on

Setting Shell Limits for the oracle User
========================================
To improve the performance of the software on Linux systems, you must increase the
following shell limits for the oracle user:

Shell Limit Item in limits.conf Hard Limit
=========== ==============================
Maximum number of open file descriptors nofile 65536

Maximum number of processes available to a single user nproc 16384


To increase the shell limits:
Add the following lines to the /etc/security/limits.conf file:

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:
session required pam_limits.so

Depending on the oracle user's default shell, make the following changes to the default shell start-up file:
For the Bourne, Bash, or Korn shell, add the following lines to the
/etc/profile file (or the /etc/profile.local file on SUSE systems):
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
For the C shell (csh or tcsh), add the following lines to the
/etc/csh.login file (or the file on SUSE
systems)/etc/csh.login.local:
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
endif

Identifying or Creating an Oracle Base Directory
================================================
Identifying an existing Oracle Inventory directory

Enter the following command to view the contents of the oraInst.loc file:

# more /etc/oraInst.loc
If the oraInst.loc file exists, then the output from this command is similar to
the following:
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall

identifying existing Oracle home directories

Enter the following command to view the contents of the oratab file:
# more /etc/oratab
If the oratab file exists, then it contains lines similar to the following:
*:/u03/app/oracle/product/10.2.0/db_1:N
*:/opt/orauser/infra_904:N
*:/oracle/9.2.0:N

Before deciding to use an existing Oracle base directory for this installation, ensure
that it satisfies the following conditions:
It should not be on the same file system as the operating system.

It must have sufficient free disk space, as follows:

Requirement Free Disk Space
The Oracle base directory will contain only Up to 3 GB
software files.
Up to 4 GB
The Oracle base directory will contain both
software and database files (not recommended for
production databases).

To determine the free disk space on the file system where the Oracle base directory
is located, enter the following command:
# df -h oracle_base_path


To create the Oracle base directory and specify the correct owner, group, and permissions for it:
Enter commands similar to the following to create the recommended subdirectories in the mount point directory that you identified and set the
appropriate owner, group, and permissions on them:

# mkdir -p /mount_point/app/oracle_sw_owner
# chown -R oracle:oinstall /mount_point/app/oracle_sw_owner
# chmod -R 775 /mount_point/app/oracle_sw_owner
For example, if the mount point you identify is /u01 and oracle is the user name of the Oracle software owner, then the recommended Oracle base directory path is
as follows:
/u01/app/oracle


Configuring the oracle User's Environment
=========================================
Set the default file mode creation mask (umask) to 022 in the shell startup file.

Set the DISPLAY environment variable.

To set the oracle user's environment:
Start a new terminal session, for example, an X terminal (xterm).

Enter the following command to ensure that X Window applications can display on this system:
$ xhost fully_qualified_remote_host_name
For example:
$ xhost somehost.us.acme.com
If you are not already logged in to the system where you want to install the software, then log in to that system as the oracle user.
If you are not logged in as the oracle user, then switch user to oracle:

$ su - oracle

To determine the default shell for the oracle user, enter the following command:

$ echo $SHELL

Open the oracle user's shell startup file in any text editor:
Bourne shell (sh), Bash shell (bash), or Korn shell (ksh):

$ vi .bash_profile
C shell (csh or tcsh):

% vi .login

Enter or edit the following line, specifying a value of 022 for the default file mode creation mask:

umask 022

If the ORACLE_SID, ORACLE_HOME, or ORACLE_BASE environment variable is set in the file, then remove the appropriate lines from the file.
Save the file, and exit from the editor.

To run the shell startup script, enter one of the following commands:

Bash shell:

$ . ./.bash_profile
Bourne or Korn shell:

$ . ./.profile
C shell:

% source ./.login

If you are not installing the software on the local system, then enter a command similar to the following to direct X applications to display on the local system:

Bourne, Bash, or Korn shell:

$ DISPLAY=local_host:0.0 ; export DISPLAY
C shell:

% setenv DISPLAY local_host:0.0

In this example, local_host is the host name or IP address of the system that
you want to use to display Oracle Universal Installer (your workstation or PC).


Installation Tasks
=====================

Downloading the Installation Archive Files

To download the installation archive files from Oracle Technology Network:
Use any browser to access the software download page from Oracle Technology
1.
Network:
http://www.oracle.com/technology/software/

Navigate to the download page for the product that you want to install.
2.
On the download page, identify the required disk space by adding the file sizes for
3.
each required file.
The file sizes are listed next to the file names.
Select a file system with enough free space to store and expand the archive files.
4.
In most cases, the available disk space must be at least twice the size of all of the
archive files.
On the file system that you selected in step 4, create a parent directory for each
5.
product, for example OraDB10g, to hold the installation directories.
Download all of the installation archive files to the directory that you created in
6.
step 5.
Verify that the files you downloaded are the same size as the corresponding files
7.
on Oracle Technology Network.


Extracting the Installation Files
=================================
To extract the installation archive files, perform the following steps:
If necessary, change directory to the directory that contains the downloaded
1.
installation archive files.
To uncompress each file, enter a command similar to the following:
2.
$ gunzip filename.cpio.gz
This command creates files with names similar to the following:
filename.cpio
To extract the installation files, enter a command similar to the following:
3.
$ cpio -idmv < filename.cpio

Installing the Oracle Database Software

If the installation files are on disc, enter commands similar to the following,where directory_path is the path of the database directory on the DVD:
$ cd /tmp
$ /directory_path/runInstaller