Showing posts with label Oracle Install. Show all posts
Showing posts with label Oracle Install. Show all posts

Install Oracle 11gr2 on Ubuntu 10.04

The procedure described here is based on that posted by Don Seiler here
and by a number of articles by Tim Hull on his oracle-base website.

Download the Software
Download the Oracle software from OTN.
You need to login at Oracle Technology Network.I used a 32-bit version in this installation.

Unpack the (two) downloaded files
You should end up with the installation files under a directory "database."
$ unzip
$ unzip

Check and/or configure the server name
Make sure that the file "/etc/hosts" contain a fully qualified name for the server.

Consider Hardware requirements
(a) Memory
Oracle recommends at least 1Gb of RAM and 2Gb of swap space on the host. If you're installing the software on a virtual machine, adjust the memory size accordingly, or you will have a tremendous amount of swap activity. Check the RAM size and the configured swap space with:
$ grep MemTotal /proc/meminfo
MemTotal:         3087664Kb
$ grep Swaptotal /proc/meminfo
SwapTotal:        3502128Kb

(b) Disk space
You'll need at least 1GB in the /tmp directory.
On a 32-bit architecture, the oracle software will use close to 4GB in disk, and an initial database will use around 2GB.
In this way, plan to have around 6GB free in the partition in which you'll install oracle.

Consider Software requirements
(a) Installing Pre-requisite Packages
As pointed out in this and this other OTN Notes, you should start by checking whether some libraries are installed and install them, in case they're not.
$ sudo su -    # login as root
# apt-get install build-essential libaio1 libaio-dev libmotif3 libtool
# apt-get install expat alien ksh pdksh unixODBC unixODBC-dev
# apt-get install sysstat elfutils libelf-dev binutils
# apt-get install lesstif2 lsb-cxx lsb-rpm

You can also check whether a package is installed using the dpkg command:
# dpkg --get-selections | grep expat
expat                                           install
libexpat1                                       install
libxml-sax-expat-perl                           install

A few other initial arrangements:
# apt-get install vim-runtime         // to ensure vi arrow keys will work 
# apt-get install vim                 // properly
# apt-get install ssh                 // to enable remote ssh connectivity

Update the libstdc++ package
Ubuntu 10.04 comes with newer version (libstdc++6) of the Standard C++ Library than the one required by Oracle 11gR2 (libstdc++5).
Oracle might update this requirement in future patches or versions, but for now, the OUI will crash if you don't address this issue. So you will have to manually download and copy the libstdc++5 files onto Ubuntu 10.04.

You can look up a list of mirrors to download the 32 or 64-bit versions of this package at
// check info on the package
//choose a mirror to download the package.

So to install the 32-bit library you need to (1) download the libsctdc++5 package; (2) unpack it into a new directory; (3) copy the library to the appropriate diretory on your system; and (4) create a symbolic link in that directory:
$ wget
$ dpkg -x libstdc++5_3.3.6-20~lucid1_i386.deb lib32bit
$ sudo cp lib32bit/usr/lib/ /usr/lib/
# cd /usr/lib
# ln -s

Now a few more adjustments, to allow the some of the installation scripts to find the expected directories and files on a mostly debian system...
(a) some scritps are expect to find a /usr/bin rather than /bin, so create some symbolic links to address this issue:
# ln -s /usr/bin/awk /bin/awk             // (post-installation)
# ln -s /usr/bin/basename /bin/basename   // makefile
# ln -s /usr/bin/rpm /bin/rpm

Set Kernel Parameters
Oracle recommend the following minimum parameter settings.

The current values for each parameter can be tested using the following command.
# /sbin/sysctl -a | grep <param-name>

To adjust kernel parameters, create or edit the /etc/sysctl.conf file. By specifying the values in the /etc/sysctl.conf file, they persist when you restart the system. You should backup this file prior to adding the lines below:
# Values for Oracle 11gR2
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65535
Finally, to load the new values on the kernel immediately, run:
# /sbin/sysctl -p

Configure appropriate user resource limits

Oracle recommends minimum soft and hard limits for some resources assigned to the installation owner (usually the user oracle).

To set the appropriate resource 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
You can check the current value for soft and hard resources with ulimit:

$ ulimit -{S|H}{n|u|s}

where {n|u|s} - nofile | nproc | stack

Create User and Groups
You may choose (and oracle recommends that you do) to create one software owner to own each oracle software installation. Usually, the, you'd (1) create the user oracle for the database software; (2) create the user grid for the Oracle Restart and oracle ASM; and (3) create at least the groups dba and oinstall. (If you'll have grid infrastructure and oracle server owned by separate users, you may also want to create the asmdba, asmadmin and asmoper groups.)

Users grid and oracle should have oinstall as their primary group.
The dba group identifies operating system user accounts that have database administrative privileges (the SYSDBA privilege). For simplicity, we'll create only the user oracle and the oinstall group.

First create the oinstall and dba groups
$ sudo su -
# addgroup oinstall
# addgroup dba 
Then create the oracle user and assign it to those groups:
# useradd -g oinstall -G dba -d /home/oracle -s /bin/bash oracle
# passwd oracle                    // enter new password for the user
# mkdir /home/oracle
# chown -R oracle:dba /home/oracle 

user and group information are commonly kept in the files:
// has the same general format across Linux platforms.
// provides a list of the user accounts on the system.
// root directly edit the file, or use 'adduser' (Debian)
// or 'useradd' commands to add a new user.


// encrypted password file. Not typically directly edited.

username:encrypted password:11843:0:99999:7:::

// lists the existing groups and who is in each group.
// groups can be managed by directly creating new lines in the
// file or through 'groupadd' and 'addgroup' (Debian)


(If you plan to use Oracle Restart or Oracle ASM and plan have the grid infrastructure and the oracle server software owned by separate users (e.g. grid and oracle), you should also consider creating the asmdba,asmadmin and asmoper groups.)

You can also check whether the user oracle and group oinstall already exist on the machine with:

# grep oinstall /etc/group
# id oracle
# id grid

You may choose (in compliance with OFA) to create a partition for the oracle software, which you can mount on /u01. Then you can create the directory where the software will be installed and change the ownership of /u01 to oracle:oinstall
# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01 
# chmod -R 775 /u01/app/oracle 

Configure oracle user shell's environment variables
Logged as oracle, update the .bash_profile by adding the lines below:

# Oracle Settings
TMP=/tmp; export TMP

ORACLE_HOSTNAME=ubuntu104.localdomain; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
PATH=/usr/sbin:$PATH; export PATH
EDITOR=/usr/bin/vi; export EDITOR

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
    ulimit -u 16384 -n 65536

If you have downloaded the oracle software before creating the oracle user, you may need to change ownership of the directory database created after you unpacked the installation files.
# chown -R oracle:oinstall /path/database

To run the installation, run the commands below, logged in as oracle:

$ cd database
$ ./runInstaller

Prerequisites check failure
During the installation process, the OUI will probably indicate that a number of minimum requrirements for installation were not met. It will complain of not finding a number of packages and it may complain that the OS is not running in the expected run level. You may ignore these errors by clicking on the "Ignore All" box on the upper right corner.
The packages were not found because the installer thinks it is installing on a Red Hat-like Linux system, and search them on an (empty) rpm database. This is ok because you've installed these packages early on. The issue of the run level is a similar "misunderstanding." The system is running on level 2, which is equivalent to the expected by the OUI. So, ignore and proceed.

As you follow the installation screens, choose whether to install the software only or to create the started database. You may choose to create the database latter using the dbca (db configuration assistant).


Install Oracle XE 10gr2 on Ubuntu 10.4

Oracle XE 10.2 licence limitations
Before you install, please consider the restrictions below. Oracle XE is offered as a free server for developers and small applications. The only way to overcome the limitations indicated below is to use the standard or enterprise editions.

(a) XE Server will use only one CPU
- If installed on a computer with more than one CPU (including dual-core CPUs), Oracle XE will consume, at most, processing resources equivalent to one CPU. In other words, even with available CPUs, Oracle XE will not do concurrent processing of CPU-intensive queries.

(b) Only one instance per computer
- Only one installation of Oracle XE can be performed on a single computer. This will not affect any existing installation or new installations of Standard or Enterprise Editions. In addition, users can run only one instance of Oracle XE on each individual computer.

(c) Maximum 4Gb of user data
- The maximum amount of user data in an Oracle XE database cannot exceed 4Gb. (In the oracle XE 11g - beta version, this limit was increased to 11Gb). If the user data grows beyond the 4Gb limit, then an ORA-12592 error will occur.

(d) Maximum 1Gb RAM
- An Oracle XE database will use at most 1Gb of RAM, even if more is available.

(e) No native support for HTTPS
- HTTPS is not supported natively with the HTTP listener built into Oracle Database XE. If you want HTTPS support, use an alternative Web listener, such as Apache, that does provide HTTPS support, and provide proxies for the URLs provided by Oracle Database XE.

With the limitations indicated above and with the idea of providing a RDBMS with a small footprint, it is not surprising that many of the features available in the Standard and Enterprise editions are not included with Oracle XE. Some of these are partitioning, OLAP, clusterware, the "Packs" (change and configuration management, diagnostic and tuning). See the full list here.

Installation Requirements
(a) Kernel requirements
The installation program checks for the kernel parameter settings below. If the current parameter values are less than the values listed below, they will be modified by the installation program.
semmsl, semmns, semmni, semopm250, 32000, 128, 100
shmax, shmmni, shmall536870912, 4096, 2097152

(b) Required packages
You need to have glibc and libaio installed.

Download the software
You need to be logged in on your OTN account. You may use the link below:
Download the debian package (.deb).

(a) To install the package, run the command below. The installation program automatically creates user oracle, if it not yet exists.

(b) Alternative Installation mode
On Debian-based systems such as Ubuntu, you can download and install the .deb package through these steps:

(1) Edit the /etc/apt/sources.list and add:
# Repository for Oracle XE
deb unstable main non-free

(2) install with:
$ sudo apt-get update
$ sudo apt-get install oracle-xe

(c) Configuring default ports, passwords, and startup options.
When prompted, run the command below. It allows you to change the default http and listener ports, set up the initial password for SYS and SYSTEM, and decide whether the server will be automatically started during boot:

Oracle Database 10g Express Edition Configuration
This will configure on-boot properties of Oracle Database 10g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for Oracle Application Express [8080]:

Specify a port that will be used for the database listener [1521]:

Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:n

Starting Oracle Net Listener...Done
Configuring Database...
Starting Oracle Database 10g Express Edition Instance...Done
Installation Completed Successfully.

Set the Oracle XE Environment Variables

bash shell configuration scripts:
// executed during initial login
// executed in each new terminal window

To connect to the XE server you must set your environment variables. One way to do it is to edit your .bashrc login script and include the line below. After this when you open a new terminal window the environment variables will be automatically set.

$ vi ~/.bashrc
# paste the two lines below at the end of the file:
# set Oracle XE environment variables
. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/ 

If you are using the bash shell, the execution of the script may produce the error message below:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/ 114: [[: not found

To fix this problem, edit the file indicated in the error message. As root (or though sudo) you need to tell the script to use the proper shell. In this case:

$ sudo vi /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/
change the first line in the file 
from #! /bin/sh 
to   #! /bin/bash 

Acessing the database
After the installation, the database should be up and running.
To use the XE database, you can go to the Database Home Page in the Oracle Database XE graphical user interface.:
http://host:port/apex or httpL// (if you kept the default port for the http listener)

The installation creates a database and an instance named XE.

Starting and Shutting down
You can startup the database either through the Desktop Menus:
Applictations -> Oracle Database 10g Express Edition -> Start Database
or using SQL*Plus:
# Log in as a user who is a member of the dba group
$ sqlplus / as sydba
SQL> startup

If all went well, you should see:

ORACLE instance started.

Total System Global Area 805306368 bytes
Fixed Size 1261444 bytes
Variable Size 218103932 bytes
Database Buffers 583008256 bytes
Redo Buffers 2932736 bytes
Database mounted.
Database opened.

Network connections
The Listener manages database (default port 1521) and HTTP (default port 8080) connections.
To manage the listener (status/start/shutdown) you need to be logged in as oracle.
LSNRCTL> start

Starting /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version - Production
System parameter file is /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora
Log messages written to /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=niels.blump)(PORT=1521)))

Version TNSLSNR for Linux: Version - Production
Start Date 13-JAN-2011 09:14:42
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: xxxx
Default Service XE
Listener Parameter File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora
Listener Log File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/log/listener.log
Listening Endpoints Summary...
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully