Beruflich Dokumente
Kultur Dokumente
Contents
Introduction
Example Configuration
Install the Linux Operating System
Install Required Linux Packages for Oracle
Create oracle User and Directories
Configure the Linux Operating System for Oracle
Network Configuration
Download Oracle Database Software
Pre-Installation Tasks
Install Oracle Database
Install Oracle Database Examples
Configure Oracle Networking
Create the Oracle Database
Post Database Creation Tasks - (Optional)
Configure Automatic Database Starting and Stopping
Miscellaneous Options
About the Author
Introduction
This article is a comprehensive guide for installing Oracle Database 11g Release 2 (11.2.0.1) on the Red
Hat Enterprise Linux 6 (RHEL6) operating environment. The example database created in this guide will
use the local file system for all physical database file storage (data files, control files, online redo log files,
fast recovery area).
Supported Platforms
Update! As of May 2012, Oracle announced support for running Oracle 11.2.0.3 or higher
on Oracle Linux 6 and Red Hat Enterprise Linux 6. See Certification Information for Oracle
Database on Linux x86-64 [ID 1304727.1] on the My Oracle Support (MOS) site for more
information.
The requirements for installing Oracle Database 11g Release 2 on RHEL6 or OL6 64-bit
(x86-64) can be found using MOS Note [ID 1441282.1].
I will provide a completely new guide that documents the full install in a future article.
At the time of this writing (29-Dec-2011), Red Hat Enterprise Linux 6 (RHEL6) and Oracle
Linux 6 (OL6) are not certified or supported for use with any Oracle Database version. While
this guide provides instructions for successfully installing Oracle Database 11g Release 2 on
the RHEL6 operating system, it should be used for experimental, training, or evaluation
purposes only.
Be sure to use only certified/supported combinations of Oracle Database version and OS
version for any type of mission critical system, which you can find under the Certifications
tab of My Oracle Support (MOS). The Certify information on MOS is the only official source
for Oracle certification.
Both 32-bit (x86) and 64-bit (x86_64) architectures are covered in this guide. Unless otherwise noted, the
installation steps are the same for either. Having said that, one of the first decisions to make before
continuing with this guide is which architecture you will be using. Both Oracle and Linux must be installed
on the same operating system architecture. For example, 32-bit Oracle is only supported to run on 32-bit
Linux OS and 64-bit Oracle is only supported to run on 64-bit Linux OS.
Oracle 64-bit (x86-64) for Linux is supported on AMD64/EM64T and Intel Processor Chips
that adhere to the x86-64 architecture with supported Linux releases. Running Oracle 32-bit
on AMD64/EM64T (64-bit OS) is not supported.
Oracle 32-bit (x86) running on AMD64/EM64T with a 32-bit OS is, however, supported.
Oracle Documentation
While this guide provides detailed instructions for successfully installing a complete Oracle Database
11g Release 2 system, it is by no means a substitute for the official Oracle documentation (see list
below). In addition to this guide, users should also consult the following Oracle documents to gain a full
understanding of alternative configuration options, installation, and administration with Oracle Database.
Oracle's official documentation site is docs.oracle.com.
Release Notes
New Features Guide
Universal Installer and OPatch User's Guide
Database Installation Guide
Database Quick Installation Guide
Database Quick Installation Guide
Database Administrator's Guide
Database Concepts
Database Examples Installation Guide
Oracle Database 11g Release 2 (11.2) software installed on a local file system
(namely /u01/app/oracle/product/11.2.0/dbhome_1).
A fully configured general-purpose Oracle 11g database that makes use of the local file system
for physical database file storage (data files, control files, online redo log files, fast recovery area).
Optional instructions are included to put the new database into Archive Log Mode.
Oracle Enterprise Manager Database Control running and can be accessed using a Web
browser.
Installing the Oracle Database software on a system that has an existing Oracle software
installation. The installation in this article describes installing Oracle Database 11g Release 2
(11.2) on a system with no previous Oracle installation.
Installing Oracle Grid Infrastructure for a Cluster and Oracle Real Application Clusters (RAC). For
a complete discussion on installing Oracle RAC 11g Release 2 (11.2) and creating a clustered
database, see my article Building an Inexpensive Oracle RAC 11g R2 on Linux - (RHEL 5.5).
Example Configuration
This section describes the hardware and Oracle configuration parameters that will be used in this guide.
Hardware
The machine used for this guide will consist of an AMD Athlon 64 X2 Dual Core Processor 3800+
running CentOS Release 6.2 (x86_64). The server has 4GB of memory and contains four (4) internal hard
disks that will be configured using Logical Volume Manager (LVM). Four LVM Volume Groups will be
created along with separate logical volumes used to store the Linux operating system, swap, Oracle
Database Software, database files, and the fast recovery area.
Oracle Server Configuration
Machine Name
IP Address
e1.idevelopment.info
ard Drive
ev/sda
192.168.1.106
Processor
Operation Environment
Physical Disks
Partition
Size - (MB)
/dev/sda1
500
/dev/sda2
36,363
Type
Usage
ext4
Boot Volume
LVM
Mount Point
/boot
vg_testnode1
Physical Disks
ard Drive
Partition
Size - (MB)
Type
Usage
Mount Point
ev/sdb
/dev/sdb1
36,863
LVM
vg_orasoftware
ev/sdc
/dev/sdc1
36,863
LVM
vg_oradata
ev/sdd
/dev/sdd1
36,863
LVM
vg_orafra
Logical Volumes
VM Volume Group
Logical Volume
Size - (MB)
lv_root
_testnode1
Type
30,248
lv_swap
6,112
Usage
ext4
Linux OS
swap
Swap
Mount Po
/
_orasoftware
lv_orasoftware
36,860
ext4
/u01
_oradata
lv_oradata
36,860
ext4
Database Files
/u02
_orafra
lv_orafra
36,860
ext4
/u03
Oracle Configuration
The following is an introduction to some of the configuration parameters and directory paths that will be
used for installing the Oracle Database Software and creating a fully functional Oracle 11g database.
Oracle Software Owner
O/S User
501)
Primary Group
oinstall (501)
Supplementary Groups
Home Directory
/home/oracle
Database
Database
Version
Oracle Database 11g Release 2 (11.2.0.1.0) for Linux x86-64
Oracle SID
testdb1
Directory
Base directory
/u01/app/oracle
/u01/app/oracle/product/11.2.0/dbhome_1
Data directory
/u02/app/oracle/oradata
/u02/app/oracle/oradata/db_name1
/u03/app/oracle/fast_recovery_area
/u03/app/oracle/fast_recovery_area/db_name1
This guide adheres to the latest Optimal Flexible Architecture (OFA) standard for Oracle Database
11g Release 2 (11.2) for Linux.
Although this article is written to work with Red Hat Enterprise Linux 6 (RHEL6) or Oracle
Linux 6 (OL6), I will actually be using a Red Hat Linux clone named CentOS. To read more
about CentOS, please visit their website at www.centos.org.
Note that CentOS is not certified or supported for use with any Oracle Database version.
Installing the Oracle database on CentOS should be used for experimental, training, or
evaluation purposes only. Be sure to use only certified/supported combinations of Oracle
Database version and OS version for any type of mission critical system, which you can find
under the Certifications tab of My Oracle Support (MOS). The Certify information on MOS is
the only official source for Oracle certification.
Although I have used Red Hat Fedora in the past, I wanted to switch to a Linux environment that would
guarantee all of the functionality contained with Oracle. This is where CentOS comes in. The CentOS
project takes the Red Hat Enterprise Linux source RPMs and compiles them into a free clone of the Red
Hat Enterprise Server product. This provides a free and stable version of the Red Hat Enterprise Linux
(AS/ES) operating environment that I can use for Oracle testing and development. I have moved away
from Fedora as I need a stable environment that is not only free, but as close to the actual Oracle
supported operating system as possible. While CentOS is not the only project performing the same
functionality, I tend to stick with it as it is stable and reacts fast with regards to updates by Red Hat.
Download CentOS
Use the links below to download CentOS 6.2 for either x86 or x86_64 depending on your hardware
architecture.
InfraRecorder
UltraISO
Magic ISO Maker
Install CentOS
After downloading and burning the CentOS images (ISO files) to a DVD, insert CentOS Disk #1 into the
server, power it on, and answer the installation screen prompts as noted below.
CentOS Basic Installation
Screen Name
Response
Boot Screen
Media Test
Welcome to
CentOS
Language
Selection
Screen
Shot
Response
Keyboard
Selection
Storage Options
Storage Device
Warning
Host Name
Select
Connection
Manually
Configure
IP Address
Time Zone
Screen
Shot
Response
Set Root
Password
Partition Type
Select System
Drive(s)
(optional)
Disk Partitioning
Available
RAM
Swap Space
Required
Between 1 GB
and 2 GB
Between 2 GB
and 16 GB
Equal to the
size of RAM
More than 16
GB
16 GB
Screen
Shot
Response
Boot Loader
Installation Type
Package Group
Selection
Screen
Shot
Response
Reboot System
Post Installation
Wizard
Welcome Screen
License
Agreement
Create User
Screen
Shot
Response
Screen
Shot
continue.
Kdump
Reboot System
Login Screen
User Desktop
Disable Firewall
Use the following steps to disable the firewall.
GUI
1. Open the "Firewall Configuration" dialog (System > Administration > Firewall).
2. Click the [Close] button on the startup dialog and type in the "root" password if requested.
3. On the resulting dialog, click the [Disable] button, followed by the [Apply] button on the toolbar.
OK
OK
OK
OK
]
]
]
[
[
[
SELINUX=disabled
Once the change is complete, restart the server.
ksh-20100621
libaio-0.3.107
libaio-0.3.107 (32 bit)
libaio-devel-0.3.107
libaio-devel-0.3.107 (32 bit)
libgcc-4.4.4
libgcc-4.4.4 (32 bit)
libstdc++-4.4.4
libstdc++-4.4.4 (32 bit)
libstdc++-devel-4.4.4
libstdc++-devel-4.4.4 (32 bit)
make-3.81
numactl-devel-2.0.3
sysstat-9.0.4
unixODBC-2.2.14
unixODBC-2.2.14 (32 bit)
unixODBC-devel-2.2.14
Each of the packages listed above can be found on the CentOS 6 for x86_64 DVDs.
Starting with Oracle Database 11g Release 2 (11.2.0.2), all the 32-bit packages, except
forgcc-32bit-4.3 (SUSE Linux Enterprise Server 11), listed in this section are no longer
required for installing a database on Linux x86-64. Only the 64-bit packages are required.
For any Oracle Database 11g release before 11.2.0.2; however, both the 32-bit and 64-bit
packages listed in this section are required.
The installation described in this guide will install the 32-bit packages. Although many of
these packages are unnecessary for 11.2.0.2 onwards on Linux x86-64, having them
present will not cause a problem.
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
cd /
eject
libaio-0*i686*
libaio-devel-0*x86_64*
libaio-devel-0*i686*
libgcc-4*x86_64*
libgcc-4*i686*
libstdc++-4*x86_64*
libstdc++-4*i686*
libstdc++-devel-4*x86_64*
libstdc++-devel-4*i686*
make-3*x86_64*
numactl-devel-2*x86_64*
sysstat-9*x86_64*
unixODBC-2*x86_64*
unixODBC-2*i686*
unixODBC-devel-2*x86_64*
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
rpm -Uvh
cd /
eject
compat-libcap1*i686*
compat-libstdc++-33*i686*
elfutils-libelf-0*i686*
elfutils-libelf-devel-0*i686*
gcc-4*i686*
gcc-c++-4*i686*
glibc-2*i686* nss-softokn-freebl-3*i686*
glibc-common-2*i686*
glibc-devel-2*i686*
glibc-headers-2*i686*
kernel-headers-2*i686*
ksh-*i686*
libaio-0*i686*
libaio-devel-0*i686*
libgcc-4*i686*
libgomp-4*i686*
libstdc++-4*i686*
libstdc++-devel-4*i686*
make-3*i686*
numactl-devel-2*i686*
sysstat-9*i686*
unixODBC-2*i686*
unixODBC-devel-2*i686*
Description
OS
Group
Name
OS
Grou
p ID
OS Users
Assigned to
this Group
Oracle Inventory
and Software
Owner
oinst
all
501
oracle
dba
502
oracle,
jhunter
Database
Administrator
Oracle
Privile
ge
Oracle
Group
Name
SYSDB
A
OSDBA
Description
Database
Operator
OS
Group
Name
OS
Grou
p ID
OS Users
Assigned to
this Group
Oracle
Privile
ge
Oracle
Group
Name
oper
503
oracle,
jhunter
SYSOP
ER
OSOPER
OS Group Descriptions
The database being created in this guide will not make use of Automatic Storage
Management (ASM) and therefore will not create or assign the ASM related OS groups
[root@testnode1
[root@testnode1
[root@testnode1
[root@testnode1
~]#
~]#
~]#
~]#
--------------------------------------------------.bash_profile
--------------------------------------------------OS User:
oracle
# ORACLE_HOME
# --------------------------------------------------# Specifies the directory containing the Oracle
# Database software.
# --------------------------------------------------ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
# --------------------------------------------------# ORACLE_PATH
# --------------------------------------------------# Specifies the search path for files used by Oracle
# applications such as SQL*Plus. If the full path to
# the file is not specified, or if the file is not
# in the current directory, the Oracle application
# uses ORACLE_PATH to locate the file.
# This variable is used by SQL*Plus, Forms and Menu.
# --------------------------------------------------ORACLE_PATH=/u01/app/oracle/dba_scripts/sql:$ORACLE_HOME/rdbms/admin; export ORACLE_PATH
#
#
#
#
#
#
#
--------------------------------------------------SQLPATH
--------------------------------------------------Specifies the directory or list of directories that
SQL*Plus searches for a login.sql file.
--------------------------------------------------SQLPATH=/u01/app/oracle/dba_scripts/sql; export SQLPATH
# --------------------------------------------------# ORACLE_TERM
# --------------------------------------------------# Defines a terminal definition. If not set, it
# defaults to the value of your TERM environment
# variable. Used by all character mode products.
# --------------------------------------------------ORACLE_TERM=xterm; export ORACLE_TERM
# --------------------------------------------------# NLS_DATE_FORMAT
# --------------------------------------------------# Specifies the default date format to use with the
# TO_CHAR and TO_DATE functions. The default value of
# this parameter is determined by NLS_TERRITORY. The
# value of this parameter can be any valid date
# format mask, and the value must be surrounded by
# double quotation marks. For example:
#
#
NLS_DATE_FORMAT = "MM/DD/YYYY"
#
# --------------------------------------------------NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
#
#
#
#
#
--------------------------------------------------TNS_ADMIN
--------------------------------------------------Specifies the directory containing the Oracle Net
Services configuration files like listener.ora,
# --------------------------------------------------# THREADS_FLAG
# --------------------------------------------------# All the tools in the JDK use green threads as a
# default. To specify that native threads should be
# used, set the THREADS_FLAG environment variable to
# "native". You can revert to the use of green
# threads by setting THREADS_FLAG to the value
# "green".
# --------------------------------------------------THREADS_FLAG=native; export THREADS_FLAG
# --------------------------------------------------# TEMP, TMP, and TMPDIR
# --------------------------------------------------# Specify the default directories for temporary
# files; if set, tools that create temporary files
# create them in one of these directories.
# --------------------------------------------------export TEMP=/tmp
export TMPDIR=/tmp
# --------------------------------------------------# UMASK
# --------------------------------------------------# Set the default file mode creation mask
# (umask) to 022 to ensure that the user performing
# the Oracle software installation creates files
# with 644 permissions.
# --------------------------------------------------umask 022
Verify That the User nobody Exists
Before installing the software, complete the following procedure to verify that the user nobody exists on
the system.
1. To determine if the user exists, enter the following command.
A separate OSDBA group (dba), whose members include oracle, and who are granted the
SYSDBA privilege to administer the Oracle Database.
A separate OSOPER group (oper), whose members include oracle, and who are granted
limited Oracle database administrator privileges.
An Oracle Database software owner (oracle), with the oraInventory group as its primary group,
and with the OSDBA (dba) and OSOPER (oper) group as its secondary group.
OFA-compliant mount points /u01, /u02, and /u03 that will be used for the Oracle software
installation, data files, and recovery files.
Resource Shell
Limit
Item in
limits.c
onf
Soft
Limit
Hard Limit
Open file
descriptors
nofile
at
least
1024
at least 65536
Number of
processes available
to a single user
nproc
at
least
2047
at least 16384
stack
at
least
10240
KB
at least 10240
KB, and at most
32768 KB
oracle
oracle
oracle
oracle
oracle
soft
hard
soft
hard
soft
nproc
nproc
nofile
nofile
stack
2047
16384
1024
65536
10240
Add the following line to the /etc/pam.d/login file, if it does not already exist.
session
required
pam_limits.so
Depending on your shell environment, make the following changes to the default shell startup file in order
to change ulimit settings for the Oracle installation owner.
For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file.
kernel.shmmax = 4294967295
kernel.shmall = 2097152
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 = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 1048576
RHEL/OL/CentOS 6 already comes configured with default values defined for the following
kernel parameters.
kernel.shmmax
kernel.shmall
The default values for these two kernel parameters should be overwritten with the
recommended values defined in this guide.
# +---------------------------------------------------------+
# | KERNEL PARAMETERS FOR ORACLE DATABASE 11g R2 ON LINUX
|
# +---------------------------------------------------------+
# +---------------------------------------------------------+
# | SHARED MEMORY
|
# +---------------------------------------------------------+
# Maximum size (in bytes) for a shared memory segment
kernel.shmmax = 4294967295
# Maximum amount of shared memory (in pages) that
# can be used at one time on the system and should be at
# least ceil(SHMMAX/PAGE_SIZE)
kernel.shmall = 2097152
# Maximum number of shared memory segments system wide
kernel.shmmni = 4096
# +---------------------------------------------------------+
# | SEMAPHORES
|
# +---------------------------------------------------------+
# SEMMSL_value SEMMNS_value SEMOPM_value
kernel.sem = 250 32000 100 128
SEMMNI_value
# +---------------------------------------------------------+
# | NETWORKING
|
# ----------------------------------------------------------+
# Defines the local port range that is used by TCP and UDP
# traffic to choose the local port
net.ipv4.ip_local_port_range = 9000 65500
# Default setting in bytes of the socket "receive" buffer which
# may be set by using the SO_RCVBUF socket option
net.core.rmem_default = 262144
# Maximum setting in bytes of the socket "receive" buffer which
# may be set by using the SO_RCVBUF socket option
net.core.rmem_max = 4194304
# Default setting in bytes of the socket "send" buffer which
# may be set by using the SO_SNDBUF socket option
net.core.wmem_default = 262144
[root@testnode1
kernel.shmall =
kernel.shmmax =
kernel.shmmni =
vm.hugetlb_shm_group = 0
[root@testnode1 ~]# /sbin/sysctl -a | grep sem
kernel.sem = 250
32000
100
128
[root@testnode1 ~]# /sbin/sysctl -a | grep ip_local_port_range
net.ipv4.ip_local_port_range = 9000
65500
[root@testnode1 ~]# /sbin/sysctl -a | grep 'core\.[rw]mem' | sort
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
[root@testnode1 ~]# /sbin/sysctl -a | egrep 'file-max|aio-max' | sort
fs.aio-max-nr = 1048576
fs.file-max = 6815744
Memory
The minimum required RAM for Oracle Database 11g Release 2 running on the Linux platform is 1 GB
(although 2 GB or more of RAM is highly recommended).
Use the following command to check the amount of installed RAM on the system.
Between 1 GB and 2 GB
Between 2 GB and 16 GB
More than 16 GB
16 GB
Use the following command to determine the size of the configured swap space.
On Linux, the HugePages feature allocates non-swappable memory for large page tables
using memory-mapped files. If you enable HugePages, then you should deduct the memory
allocated to HugePages from the available RAM before calculating swap space.
If necessary, additional swap space can be configured by creating a temporary swap file and adding it to
the current swap. This way you do not have to use a raw device or even more drastic, rebuild your
system.
1. As root, make a file that will act as additional swap space, let's say about 500MB.
free
2811532
3786740
6258680
shared
0
buffers
49456
cached
925752
tmpfs
2.0G
288K
2.0G
1% /dev/shm
Network Configuration
During the Linux OS install, we already configured the IP address and host name for the database node.
This sections contains additional network configuration steps that will prepare the machine to run the
Oracle database.
Note that the Oracle database server should have a static IP address configured for the public network
(eth0 for this guide). Do not use DHCP naming for the public IP address; you need a static IP address.
Confirm the Node Name is Not Listed in Loopback Address
Ensure that the node name (testnode1) is not included for the loopback address in
the /etc/hosts file. If the machine name is listed in the in the loopback address entry as below:
127.0.0.1
127.0.0.1
<IP-address>
<fully-qualified-machine-name>
<machine-name>
For example.
127.0.0.1
192.168.1.106
1. Check to ensure that the firewall option is turned off. If the firewall option is stopped (like it is in
my example below) you do not have to proceed with the following steps.
Oracle Database 11g Release 2 base release (11.2.0.1) is available through the Oracle Software Delivery
Cloud (eDelivery) or OTN. If you do not currently have an account with Oracle OTN or eDelivery, you will
need to create one. This is a free account. Oracle offers a development and testing license free of charge.
No support, however, is provided and the license does not permit production use. A full description of the
license agreement is available on OTN.
Oracle Database 11g Release 2 (11.2.0.2) and (11.2.0.3) are only available through My Oracle Support
(MOS) and are listed as patch sets in this section.
Access to MOS requires an Oracle Single Sign On (SSO) account (which is the same account used for
OTN) and a valid Customer Support Identifier (or CSI). MOS requires a paid software license and support
contract and is the only place to download critical updates and patch sets. Starting with the release of the
11.2.0.2 patch set for Oracle Database 11g Release 2, Oracle Database patch sets are full installations of
the Oracle Database software (you do not need to download and install 11.2.0.1 first).
Log in as the Oracle software owner (oracle) and download the Oracle Database and Oracle Examples
(optional) software to an install directory. For example /home/oracle/software/oracle.
Relea
se
Location
Oracle Database
11g Release 2
11.2.0.
1
OTN / eDelivery /
MOS
linux.x64_11gR2_database_1of
2.zip
linux.x64_11gR2_database_2of
2.zip
Oracle Database
11g Release 2 Examples
11.2.0.
1
OTN / eDelivery /
MOS
linux.x64_11gR2_examples.zip
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
Relea
se
MOS Patch
Set
Oracle Database
11g Release 2
11.2.0.
2
10098816
p10098816_112020_Linux-x8664_1of7.zip
p10098816_112020_Linux-x8664_2of7.zip
Oracle Database
11g Release 2 Examples
11.2.0.
2
10098816
p10098816_112020_Linux-x8664_6of7.zip
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
~]$
~]$
~]$
~]$
~]$
mkdir -p /home/oracle/software/oracle
mv p10098816_112020_Linux-x86-64_1of7.zip /home/oracle/software/orac
mv p10098816_112020_Linux-x86-64_2of7.zip /home/oracle/software/orac
mv p10098816_112020_Linux-x86-64_6of7.zip /home/oracle/software/orac
cd /home/oracle/software/oracle
Relea
se
MOS Patch
Set
Oracle Database
11g Release 2
11.2.0.
3
10404530
p10404530_112030_Linux-x8664_1of7.zip
p10404530_112030_Linux-x8664_2of7.zip
Oracle Database
11g Release 2 Examples
11.2.0.
3
10404530
p10404530_112030_Linux-x8664_6of7.zip
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
[oracle@testnode1
You should now have a single directory called database and the optional examples directory containing
the Oracle installation files.
[oracle@testnode1 ~]$ id
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),503(oper)
11.2.0.1: The installer shows multiple "missing package" failures because it does not recognize
several of the newer version packages that were installed. These "missing package" failures can
be ignored as the packages are present. The failure for the "pdksh" package can be ignored
because it is no longer part of RHEL6 and we installed the "ksh" package in its place.
11.2.0.2: The installer should only show a single "missing package" failure for the "pdksh"
package. The failure for the "pdksh" package can be ignored because it is no longer part of
RHEL6 and we installed the "ksh" package in its place.
Screen
Name
Response
Config
ure
Securi
ty
Updat
es
To stay informed with the latest security issues, enter your e-mail
address, preferably your My Oracle Support e-mail address or user
name in the Email field. You can select the "I wish to receive security
updates via My Oracle Support" check box to receive security updates.
Enter your My Oracle Support password in the "My Oracle Support
Password" field.
For the purpose of this example, un-check the security updates checkbox and click the [Next] button to continue.
Acknowledge the warning dialog indicating you have not provided an
email address by clicking the [Yes] button.
Install
ation
Option
Grid
Option
s
Produc
t
Langu
ages
Datab
ase
Edition
Install
Scree
n
Shot
Screen
Name
Response
ation
Locati
on
follows.
Oracle Base: /u01/app/oracle
Software
Location: /u01/app/oracle/product/11.2.0/dbhome_1
Create
Invent
ory
Since this is the first install on the host, you will need to create the
Oracle Inventory. Use the default values provided by the OUI.
Inventory Directory: /u01/app/oraInventory
oraInventory Group Name: oinstall
Operat
ing
Syste
m
Group
s
Prereq
uisite
Checks
Summ
ary
Install
Produc
t
Execut
e
Config
uratio
n
scripts
[root@testnode1 ~]#
/u01/app/oraInventory/orainstRoot.sh
Within the same console window stay logged in as the root user
account and execute the root.sh script.
[root@testnode1 ~]#
Scree
n
Shot
Screen
Name
Response
Scree
n
Shot
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
[11.2.0.1.0]
[root@testnode1 ~]#
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
[11.2.0.2.0]
[root@testnode1 ~]#
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
[11.2.0.3.0]
At the end of the installation, click the [Close] button to exit the OUI.
11.2.0.1: The installer shows multiple "missing package" failures because it does not recognize
several of the newer version packages that were installed. These "missing package" failures can
be ignored as the packages are present. The failure for the "pdksh" package can be ignored
because it is no longer part of RHEL6 and we installed the "ksh" package in its place.
11.2.0.2: The installer should only show a single "missing package" failure for the "pdksh"
package. The failure for the "pdksh" package can be ignored because it is no longer part of
RHEL6 and we installed the "ksh" package in its place.
Screen
Name
Installation
Location
Response
Screen
Shot
me_1
Prerequisit
e Checks
Summary
Install
Product
Finish
At any time during the network configuration, if you have a question about what you are being asked to
do, click the Help button on the configuration screen.
Screen Name
Response
Welcome
Listener
Action
Oracle Net
Listener
Name
Select
Protocols
TCP/IP
Protocol
More
Listeners?
Listener
Configuration
Done
Welcome
Select
Naming
Methods
Naming
Methods
Configuration
Done
Welcome
Screen Shot
[oracle@testnode1 ~]$ ps -ef | grep lsnr | grep -v 'grep' | awk '{print $9}'
LISTENER
[oracle@testnode1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 31-DEC-2011 22:32:27
Copyright (c) 1991, 2009, Oracle.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=testnode1.idevelopment.info)(PORT=
STATUS of the LISTENER
-----------------------Alias
LISTENER
Version
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date
31-DEC-2011 22:14:25
Uptime
0 days 0 hr. 18 min. 3 sec
Trace Level
off
Security
ON: Local OS Authentication
SNMP
OFF
Listener Parameter File
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.o
Listener Log File
/u01/app/oracle/diag/tnslsnr/testnode1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testnode1.idevelopment.info)(PORT=1521)))
The listener supports no services
The command completed successfully
Response
Welcome
Screen
Operations
Database
Templates
Database
Identification
Database naming.
Global Database Name: testdb1.idevelopment.info
SID Prefix: testdb1
Note: I used idevelopment.info for the database domain.
You may use any database domain. Keep in mind that this
domain does not have to be a valid DNS domain.
Management
From the "Enterprise Manager" tab, you can leave the default
Screen Shot
Screen Name
Response
Options
Database
Credentials
Database File
Locations
Recovery
Configuration
Database
Content
Initialization
Parameters
Database
Storage
Creation
Options
Database
Creation
Process
End of
Database
Creation
Screen Shot
When the DBCA has completed, you will have a fully functional Oracle Database 11g Release 2 database
running.
Test Database Connectivity
Verify that the TNS listener is running (lsnrctl status) then log in to the new instance to verify
database connectivity and perform a few queries.
Fixed Size
Variable Size
Database Buffers
Redo Buffers
1336904
973081016
671088640
11718656
bytes
bytes
bytes
bytes
3. Enable archiving.
Archive Mode
Enabled
USE_DB_RECOVERY_FILE_DEST
74
76
76
ORACLE_PATH=$ORACLE_BASE/dba_scripts/sql:.:$ORACLE_HOME/rdbms/admin
export ORACLE_PATH
The ORACLE_PATH environment variable should already be set in
the .bash_profile login script that was created in the section Create Login Script for the
oracle User Account.
Now that the DBA Scripts Archive for Oracle has been unzipped and the UNIX environment variable
($ORACLE_PATH) has been set to the appropriate directory, you should now be able to run any of the
SQL scripts in the $ORACLE_BASE/dba_scripts/sql while logged into SQL*Plus from any directory.
For example, to query tablespace information while logged into the Oracle database as a DBA user:
SQL> @dba_tablespaces
Status
-------ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
Tablespace Name
-----------------EXAMPLE
SYSAUX
SYSTEM
TEMP
UNDOTBS1
USERS
TS Type
-----------PERMANENT
PERMANENT
PERMANENT
TEMPORARY
UNDO
PERMANENT
avg
sum
Ext. Mgt.
---------LOCAL
LOCAL
LOCAL
LOCAL
LOCAL
LOCAL
Seg. Mgt.
Tablespace Size
Used (
--------- ------------------ --------AUTO
157,286,400
8
AUTO
629,145,600
48
MANUAL
734,003,200
70
MANUAL
67,108,864
6
MANUAL
560,988,160
41
AUTO
5,242,880
------------------ --------2,153,775,104
6 rows selected.
To obtain a list of all available Oracle DBA scripts while logged into SQL*Plus, run the help.sql script.
SQL> @help.sql
========================================
Automatic Shared Memory Management
========================================
asmm_components.sql
1,76
========================================
Automatic Storage Management
========================================
asm_alias.sql
asm_clients.sql
asm_diskgroups.sql
asm_disks.sql
asm_disks_perf.sql
asm_drop_files.sql
asm_files.sql
asm_files2.sql
asm_templates.sql
< --- SNIP --- >
perf_top_sql_by_buffer_gets.sql
perf_top_sql_by_disk_reads.sql
========================================
Workspace Manager
========================================
wm_create_workspace.sql
wm_disable_versioning.sql
wm_enable_versioning.sql
wm_freeze_workspace.sql
wm_get_workspace.sql
wm_goto_workspace.sql
wm_merge_workspace.sql
wm_refresh_workspace.sql
wm_remove_workspace.sql
wm_unfreeze_workspace.sql
wm_workspaces.sql
Oracle Restart can only manage 11.2 resources. Oracle Database releases prior to 11.2;
however, can coexist on the same server but without being managed by Oracle Restart.
When using Oracle Restart, you can use Service Control Utility (SRVCTL), a command-line interface, to
manage Oracle processes (database instance, listener, ASM instance). With SRVCTL, you can manage
the Oracle Restart configuration, see the status of processes managed by Oracle Restart, and start or
stop processes such as the Oracle Database. SRVCTL has been enhanced to support single instance
databases with Oracle Restart on standalone servers and on clusters with Oracle Clusterware.
Oracle Restart is a component of Oracle Grid Infrastructure for a Standalone Server which is a separate
install from the Oracle Database software. Installing Oracle Grid Infrastructure for a Standalone Server is
required in order to use Oracle Restart and must be installed in a separate home (known as Grid home)
from the database Oracle home. Using the latest Optimal Flexible Architecture (OFA), Oracle Grid
Infrastructure for a Standalone Server would be installed as the Oracle software owner (oracle) and the
Oracle home directory would be /u01/app/oracle/product/11.2.0/grid. Note that you can install
Oracle Grid Infrastructure for a Standalone Server first and the database later or vice-versa. If Oracle Grid
Infrastructure for a Standalone Server is installed first, then components like the database and TNS
listener get automatically added to the Oracle Restart configuration. In the case where the database is
configured first and Grid later, the components will need to be manually added to the Oracle Restart
configuration.
If you want to use Oracle ASM or Oracle Restart, then you must install Oracle Grid
Infrastructure for a Standalone Server before you install and create the database.
Otherwise, you must manually register the database with Oracle Restart.
Also note that Oracle Restart is used in single-instance (non-clustered) environments only.
Although the Oracle grid infrastructure for a Standalone Server install is fairly straightforward, I opted to
forgo discussing how to use Oracle Restart to automatically start/stop the Oracle instance in this guide. I
provide a separate guide on configuring Oracle Restart on a standalone server. Although now
deprecated, automatic database startup and shutdown using the su command method is still available in
Oracle Database 11g Release 2.
Automatic Database Startup/Shutdown using "su" Command
This section contains the recommended method defined by Oracle for automating database startup and
shutdown of Oracle Database 10g and Oracle Database 11g Release 1 (11.1) instances on Linux. The
method described in this section is referred to as the "su" command method. This method can be used
with any RHEL or RHEL clone distribution, including Oracle Linux, up to and including RHEL 6.
Edit the /etc/oratab file and set the restart flag (the last field) to "Y" for the instance you want to
automatically startup and shutdown. For the purpose of this example, the only instance defined in
the /etc/oratab file is testdb1:
...
testdb1:/u01/app/oracle/product/11.2.0/dbhome_1:Y
...
Next, create a text file named /etc/init.d/dbora as the root user, containing the following.
#!/bin/sh
# chkconfig: 345 99 10
#
#
#
#
#
#
#
ORA_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
;;
esac
Note that the /etc/init.d/dbora script listed above may look a little different from a
similar one used for Oracle9i most notably the omission of the commands to start/stop
the Oracle TNS listener process. As of Oracle Database 10g Release 2, the dbstartscript
includes the commands to automatically start/stop the listener.
Final Notes
The /etc/init.d/dbora script defined in this section uses the "su -" command to run the Oracle
scripts dbstart and dbshut.
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Change the value of ORACLE_HOME to specify the correct Oracle home
# directory for your installation.
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
#
# Change the value of ORACLE to the login name of the
# oracle owner at your site.
#
ORACLE=oracle
PATH=${PATH}:$ORACLE_HOME/bin
HOST=`hostname`
PLATFORM=`uname`
export ORACLE_HOME PATH
#
if [ ! "$2" = "ORA_DB" ] ; then
if [ "$PLATFORM" = "HP-UX" ] ; then
remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
exit
else
rsh $HOST -l $ORACLE $0 $1 ORA_DB
exit
fi
fi
#
case $1 in
'start')
$ORACLE_HOME/bin/dbstart $ORACLE_HOME
;;
'stop')
$ORACLE_HOME/bin/dbshut $ORACLE_HOME
;;
*)
esac
#
exit
Note that this method relies on the presence of an RSH server, which requires additional packages and
configuration. The RSH server does not get installed by default on many Linux distributions (and for good
reason!).
Given the RSH server (and other r* packages) do not get installed by default, the DBA would need to
locate and install them before this method could be used:
# -- Install the rhs and rsh-server packages from the OS CD/DVD -# rpm -Uvh --force rsh-*
#
#
#
#
I completely disagree with the recommendation to use rsh and prefer to stick with using the su command
method. Furthermore, using the rsh method can be problematic when attempting to use it under Fedora
Core 5 and Fedora Core 6 where rsh is deprecated.
Miscellaneous Options
This final section contains several miscellaneous options that may be of use to newcomers of Oracle 11g.
Enterprise Manager - Database Console
During the database creation section, we asked for DBCA to create the Enterprise Manager Database
Console application. The DBCA will automatically start the OEM Database Console application. To check
for the process, type the following:
https://testnode1.idevelopment.info:1158/em
Login:
User Name: SYSTEM
Password: <The password you chose during installation>
Connect As: Normal
The emctl start dbconsole / emctl stop dbconsole commands can be placed in
the/etc/init.d/dbora script to be started and stopped when the database server is
cycled.
Notice that in the above example, we didn't just run the oraenv script, but rather, we sourced it by using
a dot followed by a space and then the script name oraenv. When sourcing the oraenv script, it will
prompt you for the ORACLE_SID, (defined in your /etc/oratab file), you want to switch to. In the above
example, if an entry exists for testdb1, then all Oracle related environment variables would be set to
access this database.