Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Wednesday, January 23, 2013

Install Oracle Database 11gR2 on Solaris 10


Purpose: Installation of Oracle Database 11g Release 2 (11.2.0.2) on Solaris 10 (x86-64)
Environment: Solaris 10 on VMWare, 11gR2 Database

Step 1:  Install Solaris 10
Step3:  Prepare Solaris for  Oracle Database 11gR2

Check to see which of the required packages are already installed.
# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWcslsystem SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWcsl Core Solaris, (Shared Libs)
system SUNWhea SunOS Header Files
system SUNWi1of ISO-8859-1 (Latin-1) Optional Fonts
system SUNWlibC Sun Workshop Compilers Bundled libC
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWxwfnt X Window System platform required fonts
ERROR: information for "SUNWi1cs" was not found
ERROR: information for "SUNWi15cs" was not found
 
Add the "SUNWi1cs" and "SUNWi15cs" packages using the "pkgadd" command.bash-3.2# pwd
/cdrom/sol_10_811_x86/Solaris_10/Product
bash-3.2# pkgadd -d /cdrom/sol_10_811_x86/Solaris_10/Product SUNWi1cs SUNWi15cs
Processing package instance from

X11 ISO8859-1 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
   8 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of [y,n,?] y

Installing X11 ISO8859-1 Codeset Support as

## Installing part 1 of 1.
232 blocks

Installation of was successful.

Processing package instance from

X11 ISO8859-15 Codeset Support(i386) 2.0,REV=2004.10.17.15.04
Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
   6 package pathnames are already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of [y,n,?] y
Installing X11 ISO8859-15 Codeset Support as
## Installing part 1 of 1.
1460 blocks
Installation of was successful.
Modify Hosts File
The "/etc/hosts" file must contain a fully qualified name for the server.
For example.
127.0.0.1 localhost.localdomain localhost
192.168.0.135 s10.localdomain s10 lochost

Create the new groups and users
bash-3.2# groupadd oinstall
bash-3.2# groupadd dba
bash-3.2# groupadd oper
bash-3.2# useradd -g oinstall -G dba -d /export/home/oracle oracle

Create the directories in which the Oracle software will be installed. 
# mkdir /export/home/oracle
# mkdir -p /u01/app/oracle/product/11.2.0.2/db_1
# chown oracle:oinstall /export/home/oracle
# chown -R oracle:oinstall /u01

NOTE:- If you have not partitioned your disks to allow a "/u01" mount point, you may want to install the software in the "/export/home/oracle" directory as follows.

mkdir -p /export/home/oracle/u01
ln -s /export/home/oracle/u01 /u01
mkdir -p /u01/app/oracle/product/11.2.0.2/db_1
chown -h oracle:oinstall /u01
chown -R oracle:oinstall /export/home/oracle/u01
 Set Kernel Parameters
The Oracle 11gR2 installation requires Solaris 10 U6 or later. Check the version and update level using the following command.
# cat /etc/release
As the root user, issue the following command.
Append the following line to the "/etc/user_attr" file.
oracle::::project=oracle

If you've performed a default installation, it is likely that the only kernel parameter you need to alter is "max-shm-memory" to meet the minimum installation requirements. To check the current value issue the following command.
bash-3.2#  prctl -n project.max-shm-memory -i project oracle
project: 100: oracle
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
project.max-shm-memory
        privileged      4.00GB      -   deny                                 -
        system          16.0EB    max   deny                                 -
NOTE:- To reset this value, make sure at least one session is logged in as the oracle user, then from the root user issue the following commands.

# prctl -n project.max-shm-memory -v 4gb -r -i project oracle
# projmod -s -K "project.max-shm-memory=(priv,4gb,deny)" oracle


The first (prctl -n) dynamically resets the value, while the second ( projmod -s -K)makes changes to the "/etc/project" file so the value is persistent between reboots.

# cat /etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
oracle:100::::project.max-shm-memory=(priv,4294967296,deny)

Add the following lines to the "/etc/inittab" file, immediately before the entry for "startd".

tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_smallest_anon_port 9000 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/tcp tcp_largest_anon_port 65500 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/udp udp_smallest_anon_port 9000 > /dev/console
tm::sysinit:/usr/sbin/ndd -set /dev/udp udp_largest_anon_port 65500 > /dev/console

Append the following line to the "/etc/system" file.
set maxusers=16384

Step 4: Reboot your system before attempting to install Oracle.
After reboot, login as the oracle user and add the following lines at the end of the ".profile"  or ".bash_profile" file, making sure you have set the correct ORACLE_BASE value.
 Please remember that ksh shell has .profile and bash has .bash_profile

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH

Step 5: Installation
Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.
bash-3.2$ DISPLAY=localhost:0.0
bash-3.2$
export DISPLAY

Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.
./runInstaller and complete the installation. 

Step 6: Automatic Startup of Oracle Database

Edit the "/var/opt/oracle/oratab" file setting the restart flag for each instance to 'Y'.
orcl:/u01/app/oracle/product/11.2.0/db_1:N
Change last entry from N to Y
orcl:/u01/app/oracle/product/11.2.0/db_1:Y

Create a file named dbora in following directory

/etc/init.d

add following lines to dbora

#!/bin/sh
#echo "Starting Oracle Database" > /dev/console
ORA_HOME=/u01/app/oracle/product/11.2.0/db_1
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi

case "$1" in
'start')
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
;;
'stop')
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
;;
esac

< /dev/null exit 0

1.             Change the group of the dbora file to the OSDBA group (typically dba), and set the permissions to 750:
# chgrp dba dbora 
2.             # chmod 750 dbora
3.             Create symbolic links to the dbora script in the appropriate run-level script directories as follows.
Platform
Symbolic Links Commands
AIX
# ln -s /etc/dbora /etc/rc.d/rc2.d/S99dbora
# ln -s /etc/dbora /etc/rc.d/rc0.d/K01dbora
HP-UX
# ln -s /sbin/init.d/dbora /sbin/rc3.d/S990dbora
# ln -s /sbin/init.d/dbora /sbin/rc0.d/K001dbora
Linux
# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora
Solaris
# ln -s /etc/init.d/dbora /etc/rc0.d/K01dbora 
# ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora

open /u01/app/oracle/product/11.2.0/db_1/bin/dbstart

change

#!/bin/sh

to

#!/bin/bash


change
ORACLE_HOME_LISTENER=$1
to
ORACLE_HOME_LISTENER=$ORACLE_HOME

No comments: