Professional Documents
Culture Documents
Oracle DB 11g
Oracle DB 11g
Installation of Oracle Database 11g Release 2 (11.2) x86_64 on Oracle Enterprise Linux 5 Update 5 on the file
system (ie without ASM) or GRID.
2 Articles Related
Oracle Database Installation
PowerCenter Installation and Configuration (9.0.1 for OEL Linux 64Bit)
3 Prerequisites
Linux OEL installation
Oracle Database Oracle Validated Configuration RPM for a Linux Installation
If your installation files are in the Windows directory, you can mount it :Linux Samba How to mount/map
a Windows Share on Linux
4 Preinstallation Requirements
login as root
4.1 Memory
RAM: At least 4 GB
[root@di‐rep‐db ~]# grep MemTotal /proc/meminfo
MemTotal: 4344304 kB
swap space
The following table describes the relationship between installed RAM and the configured swap space
requirement:
RAM Swap Space
Between 4 GB and 8 GB 2 times the size of RAM
Between 8 GB and 32 GB 1.5 times the size of RAM
More than 32 GB 32 GB
To determine the size of the configured swap space, enter the following command:
[root@di‐rep‐db ~]# grep SwapTotal /proc/meminfo
SwapTotal: 10860752 kB
To determine the available RAM and swap space, enter the following command:
[root@di‐rep‐db ~]# free
total used free shared buffers cached
Mem: 4344304 4215960 128344 0 13892 3913024
‐/+ buffers/cache: 289044 4055260
Swap: 10860752 0 10860752
Add Swap space if needed.
4.2 System Architecture
Verify that the processor architecture matches the Oracle software release that you want to install.
[root@di‐rep‐db ~]# uname ‐m
x86_64
4.3 Disk Space
4.3.1 Disk space requirements
The following tables describe the disk space requirements on Linux x86:
4.4 Operating System (Distribution) and kernel
Check that you have the minimal operating system and kernel.
Minimal Distribution
Oracle Linux 4 Update 7
Oracle Linux 5 Update 2
Oracle Linux 5 Update 5 (only if using Oracle Unbreakable Enterprise Kernel)
[root@di‐rep‐db ~]# cat /etc/enterprise‐release
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
[root@di‐rep‐db ~]# uname ‐r
2.6.18‐194.el5
4.5 Package RPM
Oracle recommends that you install your Linux operating system with the default software packages
(RPMs), unless you specifically intend to perform a minimal installation.
The following packages (or later versions) must be installed:
binutils2.17.50.0.6
compatlibstdc++333.2.3
compatlibstdc++333.2.3 (32 bit)
elfutilslibelf0.125
elfutilslibelfdevel0.125
gcc4.1.2
gccc++4.1.2
glibc2.524
glibc2.524 (32 bit)
glibccommon2.5
glibcdevel2.5
glibcdevel2.5 (32 bit)
glibcheaders2.5
ksh20060214
libaio0.3.106
libaio0.3.106 (32 bit)
libaiodevel0.3.106
libaiodevel0.3.106 (32 bit)
libgcc4.1.2
libgcc4.1.2 (32 bit)
libstdc++4.1.2
libstdc++4.1.2 (32 bit)
libstdc++devel 4.1.2
make3.81
numactldevel0.9.8.x86_64
sysstat7.0.2
The numa package link for Linux x86 is /usr/lib and Linux x8664 is /usr/lib64/
To determine whether the required packages are installed, enter commands similar to the following:
rpm ‐qa | grep beginning_of_the_package_name
[root@di‐rep‐db Server]# rpm ‐qa | grep elfutils
elfutils‐libelf‐devel‐static‐0.137‐3.el5
elfutils‐libelf‐devel‐0.137‐3.el5
elfutils‐libelf‐0.137‐3.el5
If a package is not installed, then install it from the Linux distribution media or download the required
package version from the Linux vendor's Web site.
rpm ‐Uvh binutils*
rpm ‐Uvh compat‐libstdc++*
rpm ‐Uvh elfutils‐libelf*
rpm ‐Uvh gcc*
rpm ‐Uvh glibc*
rpm ‐Uvh ksh*
rpm ‐Uvh libaio*
rpm ‐Uvh libgcc*
rpm ‐Uvh libstdc++*
rpm ‐Uvh make*
rpm ‐Uvh numactl‐devel*
rpm ‐Uvh sysstat*
4.6 Database Connectivity
4.6.1 Oracle ODBC Drivers
If you intend to use ODBC, then install the most recent ODBC Driver Manager for Linux. Download and
install the Driver Manager from the following URL:
http://www.unixodbc.org
Linux RPMs are also available on this Web site.
To use ODBC, you must also install the following additional ODBC RPMs, depending on your operating
system
Distribution On Linux x8664
OEL 4 unixODBC2.2.11 (32 bit) or later
unixODBCdevel2.2.11 (64 bit) or later
unixODBC2.2.11 (64 bit ) or later
OEL 5 unixODBC2.2.11 (32 bit) or later
unixODBCdevel2.2.11 (64 bit) or later
unixODBC2.2.11 (64 bit) or later
4.6.2 Oracle JDBC/OCI Drivers
You can use JDK 6 Update 10 (Java SE Development Kit 1.6 u10) or JDK 5 (1.5.0_16) with the JNDI
extension with the Oracle Java Database Connectivity and Oracle Call Interface drivers. However, these
are not mandatory for the database installation. Please note that IBM JDK 1.5 is installed with this
release.
5 Parameters
5.1 Installation Fixup Scripts
During installation, for certain prerequisite check failures, you can click Fix & Check Again to generate a
fixup script (runfixup.sh). You can run this script as a root user to complete the required preinstallation
steps.
The fixup script does the following:
Checks and sets kernel parameters to values required for successful installation, including:
Shared memory parameters
Semaphore parameters
Open file descriptor and UDP send/receive parameters
Sets permissions on the Oracle Inventory directory.
Reconfigures primary and secondary group memberships for the installation owner, if necessary, for
the Oracle Inventory directory, and for the operating system privileges groups.
Sets up virtual IP and private IP addresses in /etc/hosts.
Sets shell limits to required values, if necessary.
Installs the Cluster Verification Utility packages (cvuqdisk rpm).
Using fixup scripts will not ensure that all the prerequisites for installing Oracle Database are satisfied. You
must still verify that all the preinstallation requirements are met to ensure a successful installation.
5.2 Network Setup
5.2.1 DNS
Verify the value of the DNS configuration file /etc/resolv.conf. The nameserver must be not set or set to
a valid DNS server and you can add the two timeout parameters.
5.2.2 Disable secure linux
Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as
follows:
SELINUX=disabled
Alternatively, this alteration can be done using the GUI tool.
5.3 Operating System Groups
Log in as root.
5.3.1 Installation Groups
Create OS groups.
/usr/sbin/groupadd ‐g 501 dba
/usr/sbin/groupadd ‐g 505 oper
The ASM group are not needed.
5.3.2 Creating the Oracle Inventory Group
When you install Oracle software on the system for the first time, Oracle Universal Installer creates
the oraInst.loc file.
If the oraInst.loc file does not exist, then create the Oracle Inventory group by entering the following
command:
# /usr/sbin/groupadd oinstall
5.4 Software Owners
The software owner is used to own and start the installation of an oracle database. You have typically two
software owner:
oracle, for the database software
and grid for the Oracle Restart owner user.
5.4.1 Creation
As we install a single database, we need only the oracle user. To create it, enter a command similar to
the following:
[root@@di‐rep‐db ~]# /usr/sbin/useradd ‐u 501 ‐g oinstall ‐G dba,oper oracle
In the preceding command:
The u option specifies the user ID. Using this command flag is optional, as you can allow the
system to provide you with an automatically generated user ID number. However, you must make
note of the oracle user ID number, as you require it later during preinstallation.
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 include the OSDBA group, and
the OSOPER group.
Verify your user:
[root@di‐rep‐db /]# id oracle
uid=501(oracle) gid=502(oinstall) groups=502(oinstall),501(dba),505(oper)
Set the password of the oracle user:
[root@di‐rep‐db /]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
For info, password = pwd
5.4.2 Shell limits
To improve the performance of the software, you must increase the following shell limits for the Oracle
installation owners:
Shell Limit Item in limits.conf
Maximum number of open file descriptors nofile
Maximum number of processes available to a single user nproc
Maximum size of the stack segment of the process stack
To increase the shell limits: Depending on your environment, make the following changes for all Oracle
installation owners. The steps below only show the user oracle.
Add the following lines to the /etc/security/limits.conf file: (the following example shows only the
software account owner oracle):
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
5.5 Kernel Parameters
The kernel parameter values shown in the following section are minimum values only.
Verification of the semaphore parameters:
[root@di‐rep‐db ~]# /sbin/sysctl ‐a | grep sem
kernel.sem = 250 32000 100 142
If the current value for any parameter is greater than the value listed in this table, then the
Fixup scripts do not change the value of that parameter.
To get the value of a parameter:
[root@di‐rep‐db /]# /sbin/sysctl ‐a | grep fs.aio‐max‐nr
fs.aio‐max‐nr = 65536
Using a text editor, create or edit the /etc/sysctl.conf file, and add or edit lines similar to the following as it's
explain in this article: Linux Kernel Parameter Management (sysctl.conf)
fs.aio‐max‐nr = 1048576
fs.file‐max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
The minimum value required for shmmax is 0.5 GB. However, Oracle recommends that you set the
value of shmmax to 2.0 GB for optimum performance of the system.
5.6 Directories
5.6.1 Oracle base directory
The Oracle base directory is a toplevel directory for Oracle software installations.
To create an appropriate directory:
Check the free disk space on each mounted file system using the following command:
# df ‐h
Create the Oracle Base Directory
mkdir ‐p /u01/app/oracle
chown ‐R oracle:oinstall /u01/app/oracle
chmod ‐R 775 /u01/app/oracle
chmod ‐R 775 /u01/app
set the ORACLE_BASE environment variable for the user Oracle to specify the Oracle base
directory that you have created.
5.6.2 OraInventory
The Oracle Inventory directory (oraInventory) stores an inventory of all software installed on the system.
mkdir ‐p /u01/app/oraInventory
chown ‐R oracle:oinstall /u01/app/oraInventory
chmod ‐R 775 /u01/app/oraInventory
5.6.3 Oracle Home Directory
The Oracle home directory is the directory where you choose to install the software for a particular
Oracle product.
Oracle Universal Installer creates this directory path that you specify under the Oracle base directory
and then you do not need to create this directory.
5.7 Configuring the oracle User's Environment
You run Oracle Universal Installer from the oracle account. However, before you start Oracle Universal
Installer you must configure the environment of the oracle user.
Login as the oracle user
5.7.1 Tmp Directory
At least 1 GB of disk space in the /tmp directory
[root@di‐rep‐db ~]# df ‐h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00‐LogVol00
77G 13G 61G 18% /
If necessary, enter commands similar to the following to create a temporary directory on the file system
that you identified, and set the appropriate permissions on the directory:
$ sudo mkdir /mount_point/tmp
$ sudo chmod a+wr /mount_point/tmp
# exit
Enter commands similar to the following to set the TMP and TMPDIR environment variables for the
Bourne, Bash, or Korn shell:
$ TMP=/mount_point/tmp
$ TMPDIR=/mount_point/tmp
$ export TMP TMPDIR
5.7.2 Hostname on Multi homed/Alias computer
You can install Oracle Database on:
A multihomed computer. It is associated with multiple IP addresses. This is typically achieved by
having multiple network cards on the computer. Each IP address is associated with a host name.
In addition, you can set up aliases for the host name.
A computer with multiple aliases: it is registered with the naming service under a single IP but with
multiple aliases. The naming service resolves any of those aliases to the same computer.
Before installing Oracle Database on such a computer, set the ORACLE_HOSTNAME environment
variable to the computer whose host name you want to use. Oracle Universal Installer uses the
ORACLE_HOSTNAME environment variable setting to find the host name. If ORACLE_HOSTNAME is
not set and you are installing on a computer that has multiple network cards, then Oracle Universal
Installer determines the host name from the /etc/hosts file.
Example of /etc/hosts file with direpdb.hotitem.local as hostname
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 di‐rep‐db.hotitem.local di‐rep‐db
127.0.0.1 localhost.localdomain localhost
Clients must be able to access the computer either by using this host name or by using aliases for this
host name. To verify this, ping the host name from the client computers using the short name (host
name only) and the full name (host name and domain name). Both tests must be successful.
Use the following procedure to set the ORACLE_HOSTNAME environment variable. For example, if the
fully qualified host name is somehost.us.example.com, then enter the following commands for the
Bourne, Bash, or Korn shell:
$ ORACLE_HOSTNAME=di‐rep‐db.hotitem.local
$ export ORACLE_HOSTNAME
5.7.3 environment variable
To set the environment variable, we will modify the shell startup script.
Do not install Oracle Database 11g Release 2 (11.2) software into an existing Oracle home.
Verify your shell
[root@di‐rep‐db ~]# echo $SHELL
/bin/bash
Add the following lines at the end of the login configuration file which depend of your shell.
For the Bash shell, add the following environment variables to the /home/oracle/.bash_profile file.
# Umask
umask 022
# Tmp Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
# Multiple Alias Home Setting
ORACLE_HOSTNAME=di‐rep‐db.hotitem.local; export ORACLE_HOSTNAME
# Installation setting
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_SID=orcl; export ORACLE_SID
# Path setting
PATH=/usr/sbin:$PATH; export PATH
Some installation changes the default profile but as you have environment variables that can be
different from one user to another (such as ORACLE_HOME), the login script is preferred rather than
the default profile
6 Installation
Follow this article to know how to show a linux remote windows with X:Linux How to display remote clients
(such as firefox, installation screen) with the X Server CygwinX ?
6.1 Login as oracle
Enter the following commands to ensure that the ORACLE_HOME and TNS_ADMIN environment
variables are not set:
unset ORACLE_HOME
unset TNS_ADMIN
6.2 Run the installer
The installation files are on the hard disk, then we change in the directory to the database directory and
enter the runInstaller command.
If the installation files are on installation media, enter commands similar to the following,
where directory_path is the path of the database directory on the installation media:
/directory_path/runInstaller
Oracle Universal Installer automatically installs the Oraclesupplied version of the JRE. This version is
required to run Oracle Universal Installer and several Oracle assistants. Do not modify the Java Runtime
Environment (JRE) except by using a patch provided by Oracle Support Services.
[oracle@di‐rep‐db ~]$ cd /mnt/kiosque/database
[oracle@di‐rep‐db database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 64696 MB Passed
Checking swap space: must be greater than 150 MB. Actual 7659 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011‐06‐15_09‐27‐30PM. Please wait
6.3 Configure Security Updates
Next
6.4 Installation Option
You can choose one of this options:
Create and Configure a Database: This option creates a new database along with sample schemas.
Install Database Software Only: This option only installs the database binaries. To configure
database, you must run Oracle Database Configuration Assistant after the software installation.
Upgrade an Existing Database: This option installs the software binaries in a new Oracle home. At
the end of the installation, you can upgrade the existing database.
Choose “Create and configure an database”. Click Next
6.5 System Class
You can choose one of the following options:
Desktop Class: Choose this option if you are installing on a laptop or desktop class system. This
option includes a starter database and allows minimal configuration. This option is designed for those
who want to get up and running with the database quickly.(The ORACLE_HOSTNAME Environment
Variable must be set)
Server Class: Choose this option if you are installing on a server class system, such as what you
would use when deploying Oracle in a production data center. This option allows for more advanced
configuration options. Advanced configuration options available using this option include Oracle RAC,
Automatic Storage Management, backup and recovery configuration, integration with Enterprise
Manager Grid Control, and more finegrained memory tuning, among many others.
Choose “Server Class” and click Next
6.6 Steps
Grip Option: Single instance database installation: This option installs the database and the listener.
Install Type: Choose “Advanced Install”
Product Language: English
Database Edition: Enterprise
Installation Location
Create Inventory
By default, the Oracle Inventory directory is not installed under theOracle Base directory. This is
because all Oracle software installations share a common Oracle Inventory, so there is only one Oracle
Inventory for all users, whereas there is a separate Oracle Base for each user.
Configuration Type: General Purpose
Database Identifier
Configuration Option: Choose Unicode, uncheck the Security and install the Sample Schemas
Management Options: Database Control
Database Storage: File System (/u01/app/oracle/oradata)
Backup and recovery: Don't enable backup
Schema Password: pwd for all account
Operating System Group (dba, oper)
Prerequisite check. If you don't have enough swap space (minimum 1.5 the total amount of physical
memory), check in this article on how to increase it : Linux Swap / Paging
6.7 Configuration script
When you run the root.sh script, the script prompts you for the path of the local bin directory and
automatically copies the oraenv, coraenv, and dbhome scripts to the directory that you specify. The default
local bin directory is /usr/local/bin. If you do not run the root.sh script, then you can manually copy the
oraenv or coraenv and dbhome scripts from the $ORACLE_HOME/bin directory to the local bin directory.
[root@di‐rep‐db database]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@di‐rep‐db kiosque]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product‐specific root actions will be performed.
Finished product‐specific root actions.
6.8 Finish
Try then connect to the database control of the machine using the user name SYSTEM and connect as
SYSDBA:
https://hostname:1158/em
7 Postinstallation Tasks
When you install Oracle Database, some options are enabled and others are disabled. If you want to enable or
disable a particular database feature for an Oracle home, then shut down the database and use the chopt tool.
7.1 Environment variable
For the Bash shell, add the following environment variables to the /home/oracle/.bash_profile file.
# For the path setting, ORACLE_HOME
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
7.2 Backup of root.sh
Oracle recommends that you back up the root.sh script ($ORACLE_HOME/root.sh) after you complete an
installation. If you install other products in the same Oracle home directory, then Oracle Universal
Installer updates the contents of the existing root.sh script during the installation. If you require information
contained in the original root.sh script, then you can recover it from the backed up root.sh file.
7.3 PL/SQL recompilation
Start the script utlrp.sql as sys. This script recompiles all PL/SQL modules that might be in an invalid state,
including packages, procedures, and types.
@?/rdbms/admin/utlrp.sql
8 Getting Started
Getting Started
8.1 Status verification
lsnrctl status
emctl status dbconsole
8.2 Start
lsnrctl start
emctl start dbconsole
[oracle@di‐rep‐db ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 13 15:35:43 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> startup
ORA‐01031: insufficient privileges
SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 619360256 bytes
Fixed Size 1338280 bytes
Variable Size 423625816 bytes
Database Buffers 188743680 bytes
Redo Buffers 5652480 bytes
Database mounted.
Database opened.
8.3 Database Console
[oracle@di‐rep‐db database]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
https://di‐rep‐db.hotitem.local:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/di‐rep‐db.hotitem.local_direp
9 Support
9.1 Very slow connection through the listener
Verify the value of the DNS configuration file resolv.conf. The nameserver must be not set or set to a
valid DNS server and you can add the two timeout parameters