SAINORA

HomeBlogsOracle Installation

Oracle Installation

What is difference between ORACLE_BASE and ORACLE_HOME?
ORACLE_BASE contains one or more ORACLE_HOMES (binaries) like 9i,10g,11G etc.

I have a 50 unix servers, what is fastest method to install oracle?
Preferred method is Silent mode installation.
Also you can use tar and extract all the binaries to different servers.
Ref :  http://learnoraclewithus.wordpress.com/category/oracle-videos

Why we need to execute root.sh?
It creates  oratab file in /etc.

What is the prerequisite to install Oracle on linux?
First we need to set the kernel parameters. Actually,  It is not mandatory to set kernel parameters for installing oracle binaries. Kernel parameters are mainly used for allocating instance.So when you create database we need to configure kernel parameters.

There are two main components
Shared memory : SHMMAX , this should be more than the size of your memory structures.
eg. SHMMAX = (SGA+PGA)Instance size  of all the database + 30% of the instance size.
eg. If i have 3 databases  and sizes are
For DB1 SGA=3G , PGA=2G
For DB2 SGA=1G , PGA=3G
For DB3 SGA=1G , PGA=1G
So , SHMMAX will be (3+2+1+3+1+1)= 11G + 30%(11G)=round(11G+3.3)= 15G.
Semaphores : As a DBA we don't know how many users will be accessing one database concurrently.we nned to get the approximate value from client. This can be calculated using
Semaphores  = (processes of all DB ie.processes parameter from DB)*2 +10*no.of databases
eg. If i have 3 databases   with processes parameter

For DB1 = 800 , DB2=1200,DB3=500
(800+1200+500)*2+10*3 = 2500+30=2530

 

How will you configure automatic startup and shutdown options?
1. Edit /etc/oratab and add database entry like   
SID:ORACLE_HOME:Y
2. Create a shell script sssora that takes in  "start" and "stop" as parameter. 
If "start" is passed,  it should call  $ORACLE_HOME/bin/dbstart.
The dbstart script will read the contents of oratab and starts the database that is as Y.

          If "stop" is passed,  it should call  $ORACLE_HOME/bin/dbshut.
The dbstart script will read the contents of oratab and stops the database that is as Y.

#vi sssora
#!/bin/sh -x
#
# file: /etc/init.d/dbora
# chkconfig: 2345 80 30
# description:  sss
#
#

# the user that oracle runs as (default: oracle)
ORACLE=oracle

# database instance id
ORACLE_SID=sss

# ORACLE_HOME (file system) path
ORACLE_HOME=/home/oracle/db_1

PATH=${PATH}:$ORACLE_HOME/bin

export ORACLE_SID ORACLE_HOME PATH

case $1 in
'start')
su - $ORACLE -c $ORACLE_HOME/bin/dbstart
;;
'stop')
su - $ORACLE -c $ORACLE_HOME/bin/dbshut
;;
*)
echo "usage: $0 {start|stop}"
;;
esac

exit

 

 

3. copy the  sssora to /etc/init.d

 

4. Use chkconfig --add sssora - to register the script

chkconfig --level 35 on  - it will create start scripts in run level 3 and 5

chkconfig --level 06 off - it will create Kill scripts in run level 0 and 6.

 

to confirm check

 

[root@sssedu etc]# du -a|grep sss
0       ./rc.d/rc2.d/K30sss
0       ./rc.d/rc5.d/S80sss
0       ./rc.d/rc1.d/K30sss
4       ./rc.d/init.d/sss
0       ./rc.d/rc6.d/K30sss
0       ./rc.d/rc0.d/K30sss
0       ./rc.d/rc4.d/K30sss
0       ./rc.d/rc3.d/S80sss
[root@sssedu etc]#
This command will create start and kill scripts in run level 3 & 5.
There are 7 run levels in Linux environment.

Run-level          Name                    Description  
0                     Halt               Shuts down the system.
1                  Single-User Mode     Mode for administrative tasks.
2                    Multi-User Mode     No network interfaces and services
3                  Multi-User Mode        Networking  Starts the system normally.
4                  Not used                 For special purposes.
5                  With Display         As runlevel 3 + Gui
6                      Reboot               Reboots the system.

Chkconfig command will create start and kill scripts in /etc/rc[runlevel].d folders.
Start will have s00 - s99 and kill have k00 to k99.

 

When you shutdown your linux server kill scripts will be executed in the order

K00
K01
K02
.
.
.K99

When you start your linux server start scripts will be executed in the order

S00
S01
S02
.
.
.
K99

The script /etec/init.d/sssora should be executed at K00 and S99.
K00 - First Db  should go down.

S99 -  Database should be started after all services are UP.

 

 

 

 

 

 

 

 

How will release memory from OS.
or
When i restart the database  i get unable to allocate shared memory segement.

Answer :
ex: i have two instance sss and +ASM. Iam removing instance "sss"

[oracle@sss-oracle dbs]$ ps -ef|grep pmon
oracle      5848 1  0 09:09 ?      00:00:00 asm_pmon_+ASM
oracle      8974 1  0 10:53 ?      00:00:00 ora_pmon_sss
oracle      9012  5169  0 10:53 pts/2     00:00:00 grep pmon

Below command shows the shared memory and semaphore information.

 

 

[oracle@sss-oracle dbs]$ ipcs

------ Shared Memory Segments --------
key         shmid       owner       perms       bytes       nattch       status     
0x00000000 3309569      root        644         52          2                      
0x00000000 3342339      root        644         16384       2                      
0x00000000 3375108      root        644         268         2                      
0x67c5fb84 4227077      oracle      640         528482304  26                     
0x00000000 3473414      oracle      600         393216      2            dest        
0x00000000 3506183      oracle      600         393216      2            dest        
0x00000000 3538952      oracle      600         393216      2            dest        
0x00000000 3571721      oracle      600         393216      2            dest        
0x00000000 3604490      oracle      600         393216      2            dest        
0x00000000 3637259      oracle      600         393216      2            dest        
0x00000000 3670028      oracle      600         393216      2            dest        
0x00000000 3702797      oracle      600         393216      2            dest        
0x00000000 3735566      oracle      600         393216      2            dest        
0x00000000 3833872      oracle      600         393216      2            dest        
0x2a31a548 4096017      oracle      640         88080384   9                      

------ Semaphore Arrays --------
key         semid       owner       perms       nsems    
0xbd009a8c 393217       oracle      640         44       
0xbcd70ee8 262146       oracle      640         44       

------ Message Queues --------
key         msqid       owner       perms       used-bytes   messages     
Use sysresv -l "DBname" to find out which database has locked the memory.

 

 

[oracle@sss-oracle ~]$ sysresv -l "sss"

IPC Resources for ORACLE_SID "sss" :
Shared Memory:
ID                KEY
4227077           0x67c5fb84
Semaphores:
ID                KEY
393217            0xbd009a8c
Oracle Instance alive for sid "sss"
[oracle@sss-oracle ~]$

Use ipcrm to release the memory.
[oracle@sss-oracle ~]$ ipcrm -s 393217

Now you can see that instance sss is released.

[oracle@sss-oracle ~]$ ps -ef|grep pmon
oracle      5848 1  0 09:09 ?      00:00:00 asm_pmon_+ASM
oracle      8970  5107  0 10:53 pts/1     00:00:00 grep pmon

 

 

Errors faced when i issued :

[oracle@sss-oracle ~]$ sysresv -l "sss"
sysresv: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory
solution :
[oracle@sss-oracle ~]$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib

==============================================================
Errors During installation :

[oracle@dg2 database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Failed <<<<

Exiting Oracle Universal Installer, log for this session can be found at /tmp/OraInstall2013-02-03_08-43-06AM/installActions2013-02-03_08-43-06AM.log

Solution :
Edit /etc/redhat-release as root user and change the entry from
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
to Red Hat Enterprise Linux Server release 4 (Tikanga)
It will work now.

Note : I used Oracle 10g installation on RHEL/OEL 5.

===========================================================

[oracle@dg2 database]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...

Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed

 

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-02-03_08-42-25AM. Please wait ...[oracle@dg2 database]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2013-02-03_08-42-25AM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at sun.security.action.LoadLibraryAction.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
        at sun.awt.DebugHelper.<clinit>(Unknown Source)
        at java.awt.Component.<clinit>(Unknown Source)

 

Solution :

Install libXp-1.0.0-8.1.el5.i386.rpm as root user.

[root@dg2 Server]# rpm -Uvh libXp-1.0.0-8.1.el5.i386.rpm
warning: libXp-1.0.0-8.1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
1:libXp                  ########################################### [100%]

Oracle 10G

sysctl.conf

kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

[root@sssedu sw]# groupadd oinstall
[root@sssedu sw]# groupadd dba
[root@sssedu sw]# useradd -g oinstall -G dba oracle
[root@sssedu sw]# passwd oracle

 

[root@sssedu sw]# mkdir -p /u01/app/oracle/product/10.2.0/db_1
[root@sssedu sw]# chown -R oracle:oinstall /u01

 

 

REf :
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

           

Published on 24th March 2012

Published by Gopinathan D