Tuesday, January 25, 2011

Oracle 10g Installation on Solaris 10 Kernel Parameter

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

No comments: