Thursday, April 29, 2010

shared memory solaris 10

http://www.akadia.com/services/ora10_sol10_install.html


Short Guide to install Oracle 10 on SUN Solaris 10
This is a short Guide to install Oracle 10.2.0.3 / 64-Bit Edition
on SUN Solaris 10 (SPARC 64-Bit)

Documentation

Oracle® Database Release Notes
10g Release 2 (10.2) for Solaris Operating System (SPARC 64-Bit)

Oracle® Database Installation Guide
10g Release 2 (10.2) for Solaris Operating System (SPARC 64-Bit)

--------------------------------------------------------------------------------

Overview

For our installation, we used the following ORACLE_HOME and ORACLE_SID, please adjust these parameters for your own environment.

ORACLE_HOME = /opt/oracle/product/9.2.0

ORACLE_SID = QUO1

Check Hardware Requirements

Minimal Memory: 1024 MB

To determine the amount of RAM memory installed on your system, enter the following command.

$ /usr/sbin/prtconf

Minimal Swap Space:

To determine the amount of Swap Space installed on your system, enter the following command.

$ /usr/sbin/swap -s

Between 1024 MB and 2048 MB 1.5 times the size of RAM

Between 2049 MB and 8192 MB Equal to the size of RAM

More than 8192 MB 0.75 times the size of RAM

Minimal Disk Space in /tmp: 400 MB

To determine the amount of disk space available in the /tmp directory, enter the following command:

$ df -h /tmp

Operating System Software Requirements

Use the latest kernel patch from Sun Microsystems (http://sunsolve.sun.com)

- Download the Patch from: http://sunsolve.sun.com
- Read the README File included in the Patch
- Usually the only thing you have to do is:

$ cd
$ ./install_custer
$ cat /var/sadm/install_data/_log
$ showrev -p

- Reboot the system

To determine your current operating system information:

$ uname -a

To determine which operating system patches are installed:

$ showrev -p

To determine which operating system packages are installed:

$ pkginfo -i [package_name]

To determine if your X-windows system is working properly on your local system, but you can redirect the X-windows output to another system.

$ xclock

To determine if you are using the correct system executables:

$ /usr/bin/which make
$ /usr/bin/which ar
$ /usr/bin/which ld
$ /usr/bin/which nm

Each of the four commands above should point to the /usr/ccs/bin directory. If not, add /usr/ccs/bin to the beginning of the PATH environment variable in the current shell.

Java Runtime Environment (JRE)

The JRE shipped with Oracle10 is used by Oracle Java applications such as the Oracle Universal Installer is the only one supported. You should not modify this JRE, unless it is done through a patch provided by Oracle Support Services. The inventory can contain multiple versions of the JRE, each of which can be used by one or more products or releases. The Installer creates the oraInventory directory the first time it is run to keep an inventory of products that it installs on your system as well as other installation information. The location of oraInventory is defined in /var/opt/oracle/oraInst.loc. Products in an ORACLE_HOME access the JRE through a symbolic link in $ORACLE_HOME/JRE to the actual location of a JRE within the inventory. You should not modify the symbolic link.

Check Software Limits

Oracle10 includes native support for files greater than 2 GB. Check your shell to determine whether it will impose a limit.

To check current soft shell limits, enter the following command:

$ ulimit -Sa

To check maximum hard limits, enter the following command:

$ ulimit -Ha

The file (blocks) value should be multiplied by 512 to obtain the maximum file size imposed by the shell. A value of unlimited is the operating system default and is the maximum value of 1 TB.

Setup the Solaris Kernel

In Solaris 10, you are not required to make changes to the /etc/system file to implement the System V TPC. Solaris 10 uses the resource control facility for its implementation.

Parameter Resource Control Recommended Value
noexec_user_stack NA 1
semsys:seminfo_semmni project.max-sem-ids 100
semsys:seminfo_semmsl process.max-sem-nsems 256
shmsys:shminfo_shmmax project.max-shm-memory 4294967295
shmsys:shminfo_shmmni project.max-shm-ids 100

Many kernel parameters have been replaced by so called resource controls in Solaris 10. It is possible to change resource controls using the prctl command. All shared memory and semaphore settings are now handled via resource controls, so any entries regarding shared memory or semaphores (shm & sem) in /etc/system will be ignored.

Here is the procedure we followed to modify the kernel parameters on Solaris 10 / Oracle 10.2.0.3.

Unlike earlier releases of Solaris, most of the system parameters needed to run Oracle are already set properly, so the only one you need is the maximum shared memory parameter. In earlier versions this was called SHMMAX and was set by editing the /etc/system file and rebooting. With Solaris 10 you set this by modifying a «Resource Control Value». You can do this temporarily by using prctl, but that is lost at reboot so you will need to add the command to the oracle user's $HOME/.profile.

The other option is to create a default project for the oracle user.

# projadd -U oracle -K "project.max-shm-memory=(priv,4096MB,deny)" user.oracle
What this does:

Makes a project named "user.oracle" in /etc/project with the user oracle as it's only member.
# cat /etc/project

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

Because the name was of the form "user.username" it becomes the oracle user's default project.

The value of the maximum shared memory is set to 4GB, you might want to use a larger value here if you have more memory and swap.

No reboot is needed, the user will get the new value
at their next login.
Now you can also modify the max-sem-ids Parameter:

# projmod -s -K "project.max-sem-ids=(priv,256,deny)" user.oracle

Check the Parameters as User oracle

$ prctl -i project user.oracle

project: 100: user.oracle
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.max-contracts
privileged 10.0K - deny -
system 2.15G max deny -
project.max-device-locked-memory
privileged 125MB - deny -
system 16.0EB max deny -
project.max-port-ids
privileged 8.19K - deny -
system 65.5K max deny -
project.max-shm-memory
privileged 4.00GB - deny -
system 16.0EB max deny -
project.max-shm-ids
privileged 128 - deny -
system 16.8M max deny -
project.max-msg-ids
privileged 128 - deny -
system 16.8M max deny -
project.max-sem-ids
privileged 256 - deny -
system 16.8M max deny -
project.max-crypto-memory
privileged 498MB - deny -
system 16.0EB max deny -
project.max-tasks
system 2.15G max deny -
project.max-lwps
system 2.15G max deny -
project.cpu-shares
privileged 1 - none -
system 65.5K max none -
zone.max-lwps
system 2.15G max deny -
zone.cpu-shares
privileged 1 - none -

Create Unix Group «dba»

$ groupadd -g 400 dba
$ groupdel dba

Create Unix User «oracle»

$ useradd -u 400 -c "Oracle Owner" -d /export/home/oracle \
-g "dba" -m -s /bin/ksh oracle

Setup ORACLE environment ($HOME/.bash_profile) as follows

# Setup ORACLE environment
ORACLE_HOME=/opt/oracle/product/10.2.0; export ORACLE_HOME
ORACLE_SID=QUO1; export ORACLE_SID
TNS_ADMIN=/home/oracle/config/10.2.0 export TNS_ADMIN
ORA_NLS10=${ORACLE_HOME}/nls/data; export ORA_NLS10
CLASSPATH=${CLASSPATH}:${ORACLE_HOME}/jdbc/lib/classes12.zip
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_OWNER=oracle; export ORACLE_OWNER
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1; export NLS_LANG
LD_LIBRARY_PATH=/usr/lib:${ORACLE_HOME}/lib:${ORACLE_HOME}/lib32; export LD_LIBRARY_PATH
# Set up the search paths
PATH=/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/usr/sfw/sbin
PATH=$PATH:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/sadm/bin
PATH=$PATH:/usr/sfw/bin:/usr/X11/bin:/usr/j2se/bin
PATH=$PATH:$ORACLE_HOME/bin
Install Oracle Software

To extract the installation archive files, perform the following steps:

$ gunzip filename.cpio.gz
$ cpio -idcmv < filename.cpio

Check oraInst.loc File

If you used Oracle before on your system, then you must edit the Oracle Inventory File, usually located in:
/var/opt/oracle/oraInst.loc

Install with Installer in interactive mode

Install Oracle 10g with Oracle Installer

$ DISPLAY=:0.0
$ export DISPLAY
$ ./runInstaller

Edit the Database Startup Script /var/opt/oracle/oratab

QUO1:/opt/oracle/product/10.2.0:Y

Create Password File

If the DBA wants to start up an Oracle instance there must be a way for Oracle to authenticate this DBA. That is if he is allowed to do so. Obviously, his password can not be stored in the database, because Oracle can not access the database if the instance has not been started up. Therefore, the authentication of the DBA must happen outside of the database.

The init parameter remote_login_passwordfile specifies if a password file is used to authenticate the DBA or not. If it set either to shared or exclusive a password file will be used.

Default location and file name

The default location for the password file is: $ORACLE_HOME/dbs/orapw$ORACLE_SID

Deleting a password file

If password file authentication is no longer needed, the password file can be deleted and the init parameter remote_login_passwordfile set to none.

Password file state

If a password file is shared or exclusive is also stored in the password file. After its creation, the state is shared. The state can be changed by setting remote_login_passwordfile and starting the database. That is, the database overwrites the state in the password file when it is started up. A password file whose state is shared can only contain SYS.

Creating a password file

Password files are created with the orapwd tool.

$ orapwd file=orapwQUO1 password=manager entries=5 force=y

Create a Symbolic Link from $ORACLE_HOME/dbs to the Password.

Create the Database

Edit the CREATE DATABASE File initQUO1.ora and create a symbolic-Link from $ORACLE_HOME/dbs to your Location.

$ cd $ORACLE_HOME/dbs
$ ln -s /home/oracle/config/10.2.0/initQUO1.ora initQUO1.ora
$ ls -l

lrwxrwxrwx 1 oracle dba 39 Jun 5 12:55 initQUO1.ora -> /home/oracle/config/10.2.0/initQUO1.ora
lrwxrwxrwx 1 oracle dba 36 Jun 5 12:58 orapwQUO1 -> /home/oracle/config/10.2.0/orapwQUO1

First start the Instance, just to test your initQUO1.ora file for correct syntax and system resources.

$ cd /export/home/oracle/config/10.2.0/
$ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup nomount
SQL> shutdown immediate

Now you can create the Database

SQL> @initQUO1.sql
SQL> @shutdown immediate
SQL> startup

Check the Logfile: initQUO1.log

Start Listener

$ lsnrctl start LSNRQUO1

Automatically Start / Stop the Database

Solaris 10 has introduced the Solaris Service Management Facility to start / stop Services.

Services that are started by traditional rc scripts (referred to as legacy services) will generally continue to work as they always have. They will show up in the output of svcs(1), with an FMRI based on the pathname of their rc script, but they can not be controlled by svcadm(1M). They should be stopped and started by running the rc script directly.

$ svcs | grep oracle

legacy_run 8:27:00 lrc:/etc/rc3_d/S99oracle

To start the Database automatically on Boot-Time, create or use our Startup Scripts oracle which must be installed in /etc/init.d. Create symbolic Links from the Startup Directories.

lrwxrwxrwx 1 root root S99oracle -> ../init.d/oracle

Install Oracle Options (optional)

You may want to install the following Options:

Oracle JVM
Orcale XML
Oracle Spatial
Oracle Ultra Search
Oracle OLAP
Oracle Data Mining
Example Schemas
cd $ORACLE_HOME/config/10.2.0/addons
./install-addons.bash

Download Scripts for Sun Solaris

These Scripts can be used as Templates. Please note, that some Parameters like ORACLE_HOME, ORACLE_SID and PATH must be adjusted on your own Environment. Besides this, you should check the initSID.ora Parameters for your Database (Size, Archivelog, ...)

Click here for the Download