onsdag 6. juni 2012

Oracle Database 11g Release 2 (11.2.0.2) Installation On Solaris 10 (x86-64)



This is my experience of installing Oracle 11g R2 on Solaris 10 based on instructions from the oracle-base.com web page.

For this installation you need Solaris 10 (x86-64) and ORACLE Database 11g R2. Both things you can download from ORACLE’s web page. I assume that you have Solaris 10 installed already so let’s proceed with the ORACLE.
When I’ve tried for first time to install this combination, I got some errors like that ORACLE can’t access some of the installation files. It took me a lot of time to figure it out what happened. Well, as a root, I’ve unpacked ORACLE installation files but the whole installation process is conduct with an oracle user. Off course, that was a privileges issue. SO, my advice is: do not extract yet installation files before oracle user is created. OR, you can extract them as a root and play a little bit with the privileges. I took the first option.


SOLARIS SETUP

Log in
Log in as root user.

Check hosts-file
The "/etc/hosts" file must contain a fully qualified name for the server.
<IP-address>  <fully-qualified-machine-name>  <machine-name>
Usually, this is done already by Solaris installation so there is not much to worry about.
Here is mine:
::1     localhost
127.0.0.1       localhost
192.168.10.1    SolarisORA.testdomain.com      loghost

Set Kernel Parameters
This is something that should not bother you much for now but in order to ORACLE “glide” on your Solaris, you need to setup kernel of the operating system. First, check the release of the Solaris. You need Solaris 10 U6 at least, to run ORACLE 11g R2 database. You probably don’t need this if you download nowadays Solaris but still…
# cat /etc/release
                    Oracle Solaris 10 9/10 s10x_u9wos_14a X86
     Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
                            Assembled 11 August 2010
#
We need to add a new project entry to the /etc/project file, so, as root, issue the following command.
# projadd oracle
In some the the installation guides I saw that they recommend next move to edit /etc/user_attr file but in my case that didn’t work. I got a password inconsistency problem. As a workaround, I’ve delayed this step after creating oracle user.  SO, let’s create it:
# groupadd oinstall
# groupadd dba
# groupadd oper

# useradd -g oinstall -G dba -d /export/home/oracle oracle
# mkdir /export/home/oracle
# chown oracle:oinstall /export/home/oracle
# passwd -r files oracle
Here you’ll must enter a password for oracle user and pay attention on password requirements.
Create the directories in which the Oracle software will be installed.
# mkdir -p /u01/app/oracle/product/11.2.0.2/db_1
# chown -R oracle:oinstall /u01
In my case, installation is performed on separate hard disk which is mounted on “/u01” partition which is some kind of standard. How to mount hard disk on “/u01”, you can find also on my blog.
If you will just test the database and won’t use any extern hard disk, you can 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

Now, at last, you must edit and apend "/etc/user_attr" file:
oracle::::project=oracle

Next, we’ll play little bit with a memory. Open new terminal window and login as oracle user. In first terminal window when you still have a root session, issue the following command:

# prctl -n project.max-shm-memory -i project oracle

You’ll get the output something like:


project: 100: oracle
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT
project.max-shm-memory
        privileged       510MB      -   deny                                 -
        system          16.0EB    max   deny                                 -
#
We need to change max-shm-memory parameter value so issue the following commands as root but keep terminal window with oracle user logged in active
# 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 dynamically resets the value, while the second makes changes to the "/etc/project" file so the value is persistent between reboots. You can check what those commands did to the /etc/project file:
# cat /etc/project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
oracle:100::::project.max-shm-memory=(priv,4294967296,deny)
#
Next, add the following lines to the “/etc/inittab” file, 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
That’s it, now we need few more steps to complete the system preparation.
Reboot the Solaris.

We need to check for those necessary packages in Solaris. Check to see which of the required 13 packages are already installed.
# pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibC SUNWlibm SUNWlibms SUNWsprot \
  SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWcsl

system      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.
# pkgadd -d /cdrom/sol_10_811_x86/Solaris_10/Product SUNWi1cs SUNWi15cs

Processing package instance <SUNWi1cs> from
< /cdrom/sol_10_811_x86/Solaris_10/Product>

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.

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

Using </> as the package base directory.
## Processing package information.
## Processing system information.
   16 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 <SUNWi1cs> [y,n,?] y

Installing X11 ISO8859-1 Codeset Support as <SUNWi1cs>

## Installing part 1 of 1.

Installation of <SUNWi1cs> was successful.

Processing package instance <SUNWi15cs> from </cdrom/sol_10_106_x86/Solaris_10/Product>

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.

This appears to be an attempt to install the same architecture and
version of a package which is already installed.  This installation
will attempt to overwrite this package.

Using </> as the package base directory.
## Processing package information.
## Processing system information.
   21 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 <SUNWi15cs> [y,n,?] y

Installing X11 ISO8859-15 Codeset Support as <SUNWi15cs>

## Installing part 1 of 1.

Installation of <SUNWi15cs> was successful.
#
Now, say goodbye for now to the root user and create a new session with an oracle user. Edit or create a “/export/home/oracle/.profile“ file and add the following lines:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

# Select the appropriate ORACLE_BASE
ORACLE_HOSTNAME=SolarisORA.testdomain.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=ORASOL; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.2/db_1; export ORACLE_HOME
ORACLE_SID=ORASOL; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH

Just in case you are using X emulation then set the DISPLAY environmental variable.
# DISPLAY=<machine-name>:0.0; export DISPLAY

Finally, unzip the files “solaris.x64_11gR2_database_1of2.zip” and “solaris.x64_11gR2_database_2of2.zip”  in the “/u01” directory.
You should now have a single directory called "database" containing installation files in “/u01” partition.

Finally!
Go to “/u01/database directory” and start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.
./runInstaller
Important is that you choose right OSDBA group (oinstall), set database name, set administrative password and choose database edition.
 
Also, you must set the Inventory location and inventory group name (oinstall):
 
After the installation…
Edit the "/var/opt/oracle/oratab" file setting the restart flag for each instance to 'Y'.
ORCLMAN:/u01/app/oracle/product/11.2.0.2/db_1:Y

Ingen kommentarer:

Legg inn en kommentar