Installation of Oracle 11g Release 2 on Solaris 11 Express x86 and SPARC


This paper (HOWTO) describes step-by-step installation of Oracle 11g release 2 database software on Solaris 11 Express x86 and SPARC.

This paper covers following steps:

Pre-Instalation Tasks

1. Create oracle User Account

Login as root and create user oracle which belongs to oinstall,dba,asmdba and asmadmin groups.
# groupadd dba
# groupadd oinstall
# groupadd asmdba
# groupadd asmadmin
# echo "oracle localhost:/export/home/&" >> /etc/auto_home
# useradd -g oinstall -G dba,asmdba,asmadmin -m -d /home/oracle -s /bin/bash oracle
# passwd oracle
Note: "#" sign means that you need execute this command as root user.
You can separate ASM and DBA roles between more users. You can create for example "asm" user as ASM administrator. If you don't plan to use ASM then you don't need to create asmdba and asmadmin groups.


2. Setting System parameters

Execute following commands to configure system settings for Oracle.
# projadd -U oracle -K "project.max-shm-memory=(priv,5g,deny)" user.oracle
# projmod -sK "project.max-sem-nsems=(priv,512,deny)" user.oracle
# projmod -sK "project.max-sem-ids=(priv,128,deny)" user.oracle
# projmod -sK "project.max-shm-ids=(priv,128,deny)" user.oracle
Note:
- Use "projects -l user.oracle" command to check the settings.
- Values for max-sem-nsems, max-sem-ids, max-shm-ids as shown in above example are the defaults. You need not to specified them unless you want to set higher values.
More info at http://docs.sun.com/app/docs/doc/817-0404/chapter1-33?a=view
- Example (as above) represents setting for "oracle" user. In case your "dba" group will contain more members than "oracle" user then define limits for group (group.dba) instead of user (user.oracle).


Execute following commands to configure network settings for Oracle.
# ipadm set-prop -p smallest_anon_port=9000 tcp
# ipadm set-prop -p largest_anon_port=65500 tcp
# ipadm set-prop -p smallest_anon_port=9000 udp
# ipadm set-prop -p largest_anon_port=65500 udp
Note: Don't use "ndd" command otherwise settings will not remain persistent.

Check the settings using following command:
# ipadm show-prop|grep anon|egrep 'tcp|udp'
tcp largest_anon_port rw 65500 65500 65535 1024-65535
tcp smallest_anon_port rw 9000 9000 32768 1024-65535
udp largest_anon_port rw 65500 65500 65535 1024-65535
udp smallest_anon_port rw 9000 9000 32768 1024-65535


Edit (as root) /etc/ssh/sshd_config and change LoginGraceTime value:
LoginGraceTime 0


Restart SSH service to reload settings:
# svcadm restart ssh


3. Enviroment settings

Edit the /home/oracle/.bash_profile file and add following lines:
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/112
ORACLE_SID=ORA11GR2
CRS_HOME=/opt/grid/112
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$CRS_HOME/lib
PATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin:$CRS_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
Note: This configuration assumes that user oracle is using Bash as default shell.
CRS_HOME is optional. You don't need to set CRS_HOME in case Grid will be not installed.


Save the .bash_profile and execute following commands for load new enviroment:
cd /home/oracle
. .bash_profile

4. Create base directory for Oracle

Login as root and create base directory for Oracle ($ORACLE_BASE).
# cd /opt
# mkdir oracle
# chown oracle:dba oracle

Optionally if you are going to install the Grid:
# cd /opt
# mkdir grid
# chown oracle:oinstall grid

Download & Install

1. Offline (Local) Repository preparation

Some additional packages are required for succesful instalation of Oracle software. These packages are located in repository. You may skip this step unless your server has internet connectivity so you can use online repository instead. You need to download repository ISO image (splitted to two files).
Download Repository Image part A (x86, SPARC)
Download Repository Image part B (x86, SPARC)

Unzip downloaded files:
unzip sol-11-exp-201011-repo-full-iso-a.zip
unzip sol-11-exp-201011-repo-full-iso-b.zip

Concate unzipped parts of ISO image:
cat sol-11-exp-201011-repo-full.iso-a sol-11-exp-201011-repo-full.iso-b > sol-11-exp-201011-repo-full.iso

Mount ISO image (assume that ISO image is located in /home/oracle directory):
# mount -F hsfs -o ro `lofiadm -a /home/oracle/sol-11-exp-201011-repo-full.iso` /mnt

Set the local repository (as preffered):
# pkg set-publisher -Pe -O file:///mnt/repo/ solaris
Note: If your server has internet connectivity you can set online (remote) repository using a command as shown in next example.

2. Online (Remote) Repository preparation

Set the online (remote) repository (as preffered):
# pkg set-publisher -Pe -O http://pkg.oracle.com/solaris/release solaris


3. Installation of required packages

To check whether required packages are installed on your operating system use following command:
pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWpool SUNWpoolr SUNWsprot SUNWtoo SUNWuiu8 SUNWfont-xorg-core SUNWfont-xorg-iso8859-1 SUNWmfrun SUNWxorg-client-programs SUNWxorg-clientlibs SUNWxwfsw SUNWxwplt
Note: Packages SUNWbtool SUNWlibms SUNWpool SUNWpoolr SUNWsprot SUNWtoo SUNWuiu8 are installed by default.

Install the required packages (from repository) using the pkg command (Note: all dependent packages will be installed as well):
# pkg install compatibility/packages/SUNWxwplt SUNWmfrun SUNWarc SUNWhea SUNWlibm
Note: Packages SUNWbtool SUNWlibms SUNWpool SUNWpoolr SUNWsprot SUNWtoo SUNWuiu8 are installed by default.

4. Platform identification

Execute following command to identify the architecture.
uname -p

Possible outputs:
i386 - Solaris x86 (a.k.a Intel compatible) architecture
sparc - Solaris SPARC architecture


5. Download the Oracle 11g R2 (11.2.0.1.0) software for your architecture from Oracle website or 11.2.0.2.0 from My Oracle Support site.
Extract the files using following command:

For Grid (CRS) software installation:
unzip solaris.x64_11gR2_grid.zip

For Database software installation:
unzip solaris.x64_11gR2_database_1of2.zip
unzip solaris.x64_11gR2_database_2of2.zip


6. Start the Oracle software installation process.

Now the system is prepared for Oracle software installation. To start the installation process execute the following commands:

For Grid (CRS) software installation:
cd grid
./runInstaller

For Database software installation:
cd database
./runInstaller

Post-Instalation Tasks

1. Execute scripts (# means "as root"):
# /opt/oracle/oraInventory/orainstRoot.sh
# /opt/oracle/112/root.sh


2. (Optional) You may consider to use rlwrap for comfortable work with sqlplus, rman or adrci utility.
Resolve dependencies (# means "as root"):
# pkg install SUNWgnu-readline SUNWgcc SUNWgccruntime


Download rlwrap source from http://utopia.knoware.nl/~hlub/uck/rlwrap/

Build and install rlwrap (# means "as root"):
tar xvzf rlwrap-0.37.tar.gz
cd rlwrap-0.37

./configure
make

# make install

echo "alias sqlplus='/usr/local/bin/rlwrap sqlplus'" >> /home/oracle/.bash_profile
echo "alias rman='/usr/local/bin/rlwrap rman'" >> /home/oracle/.bash_profile
echo "alias adrci='/usr/local/bin/rlwrap adrci'" >> /home/oracle/.bash_profile
. /home/oracle/.bash_profile


Common Installation Errors

UX: useradd: ERROR: Unable to create the home directory: No such file or directory.
Create specified directory where home directory will be located. In example for /export/home/oracle home you need to execute "mkdir -p /export/home" directory.

UX: useradd: ERROR: Unable to create the home directory: Operation not applicable.
If you have been specified /home/oracle (or any directory under /home) check /etc/auto_home for relevant entry (See the Pre-Instalation Tasks - Create oracle User Account).


Checking monitor: must be configured to display at least 256 colors >>> Could not execute auto check for display colors using command /usr/openwin/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< Some requirement checks failed. You must fulfill these requirements before continuing with the installation,at which time they will be rechecked.
Solution(s):
1. Install SUNWxwplt package
2. Set DISPLAY variable
3. Execute xhost + on target (set in DISPLAY) computer

Exception in thread "main" java.lang.UnsatisfiedLinkError:
... libmawt.so: ld.so.1: java: fatal: libXm.so.4: open failed: No such file or directory

Solution: Install the SUNWmfrun package.

# pkg install SUNWi1of SUNWxwfnt
Creating Planpkg: The following pattern(s) did not match any packages in the current catalog.
Try relaxing the pattern, refreshing and/or examining the catalogs:
SUNWi1of
SUNWxwfnt

Solution: None available. These two packages are not present in repository. Ignore errors during OUI prerequisites check (Oracle will be working fine).

[INS-13001] Environment does meet minimum requirements. Are you sure you want to continue?
Solution: If you are installing 11.2.0.1.0 version (this version doesn't know Solaris 11) you can answer "Yes" or if you have access to My Oracle Support you can download 11.2.0.2.0 version (patch nr: 10098816) and install it directly.


Last update: 22-11-2010 (DD-MM-YYYY). Comments, suggestions, questions, errors (also grammatical :) )? Feel free to contact me. You can also leave me a comment in the relevant post on my blog