Wednesday, August 26, 2009

Resolv.conf Also........Why?

Edit /etc/resolv.conf and the following lines:
options attempts:5
options timeout:15

In most Unix-like operating systems and others that implement the BIND Domain Name
System (DNS) resolver library, the resolv.conf configuration file contains information that
determines the operational parameters of the DNS resolver routines installed in the operating

The DNS resolver allows a computer connected to a network to convert alpha-numeric
domain names into the numeric IP addresses that are required for access to resources on the
Internet or the local area network. The process of looking up IP addresses from domain
names is called resolving.

The resolv.conf file typically contains directives with the IP addresses of nameservers
available to a host.

resolv.conf is usually located in the /etc directory.

This file is another text file, used by the resolver a library that determines the IP address for a
host name. Following is a sample /etc/resolv.conf file:


Name servers are queried in the order they appear in the file primary, secondary.

If DNS is used for resolving hostnames, we recommend that the fully qualified
hostname,including the domain name extension, be included as an alias within the host
file for both external and virtual IP addresses. In addition, the following entries should be
added to the /etc/resolv.conf file to prevent DNS failures causing subsequent
interruptions to the Oracle Net service:

options attempts:5
options timeout:15

Contributed by: Vinay,Varun and Kalyan

Why edit limits.conf ?

Edit /etc/security/limits.conf and add the following lines:
* soft nofile 4096
* hard nofile 65536
* soft nproc 2047
* hard nproc 16384


Controlling resource usage can be very effective when trying to prevent a local Denial of
Service or restricting the maximum allowed logins for a group or user. However, too strict
settings will impede on your system's behavior and will result in program failures so make
sure that you check each setting first.

/etc/limits is very similar to the limit file /etc/security/limits.conf. The only difference is the
format and that it only works on users or wild cards (not groups). Let's have a look at a
sample configuration:

Here we set the default settings and a specific setting for the user kn. Limits are part of the
sys-apps/shadow package. It is not necessary to set any limits in this file if you have enabled
pam in /etc/make.conf.

You can protect against certain types of denial of service attacks by modifying
/etc/security/limits.conf. This file sets limits on system resources for each user. Since several
major daemons, including the web, name and ftp servers, may run as a particular user, this
has the effect of stopping many attacks against these applications from crippling the entire
machine. Further, many local DoS attacks should be defeated by this action.
Now lets open /etc/security/limits.conf...

Now what we're gonna do is limit how many processes a user may have/run, as well as limit
the maxium size of a file a user may have.

First we add these lines to restrict user processes to a specified amount given here.
# Limit user processes
* soft nproc 2047
* hard nproc 16384

Look above for at the beginning of /etc/security/limits.conf as to what this means.
Now we add the last line to restrict users from having a file over 40 megs in size.
# limits size of any one of users' files" /etc/security/limits.conf
* soft nofile 4096
* hard nofile 65536

Contributed by: Varun,Kalyan and Vinay

What about Kernel Parameters?

Edit /etc/sysctl.conf to edit the kernel parameters required for Applications

vi /etc/sysctl.conf

# semaphores in kernel.sem: semmsl semmns semopm semmni

kernel.sem = 256 32000 100 142

kernel.shmmax = 2288490188

kernel.shmmni = 4096

kernel.shmall = 3279547

fs.file-max = 327679

net.ipv4.ip_local_port_range = 1024 65000

kernel.msgmax = 8192

kernel.msgmni = 2878

kernel.msgmnb = 65535

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144


The SHMMAX parameter is used to define the maximum size (in bytes) for a

shared memory segment and should be set large enough for the largest SGA size.

If the SHMMAX is set incorrectly (too low), it is possible that the Oracle SGA

(which is held in shared segments) may be limited in size. An inadequate

SHMMAX setting would result in the following:

ORA-27123: unable to attach to shared memory segment

You can determine the value of SHMMAX by performing the following:

# cat /proc/sys/kernel/shmmax


As you can see from the output above, the default value for SHMMAX is 32MB.

This is often too small to configure the Oracle SGA. I generally set the SHMMAX

parameter to 2GB.

NOTE: With a 32-bit Linux operating system, the default maximum size of the SGA is 1.7GB.

This is the reason I often set the SHMMAX parameter to 2GB since it requires a larger value for SHMMAX.

On a 32-bit Linux operating system, without Physical Address Extension (PAE), the physical

memory is divided into a 3GB user space and a 1GB kernel space. It is therefore possible to

create a 2.7GB SGA, but you will need make several changes at the Linux operating system

level by changing the mapped base. In the case of a 2.7GB SGA, you would want to set the

SHMMAX parameter to 3GB.

This is method I use most often.

This method sets the SHMMAX on startup by inserting the

following kernel parameter in the /etc/sysctl.conf startup file:

# echo "kernel.shmmax=2147483648" >> /etc/sysctl.conf

•If you wanted to dynamically alter the value of SHMMAX without rebooting the machine, you

can make this change directly to the /proc file system. This command can be made

permanent by putting it into the /etc/rc.local startup file:

# echo "2147483648" > /proc/sys/kernel/shmmax

•You can also use the sysctl command to change the value of SHMMAX:

# sysctl -w kernel.shmmax=2147483648


We now look at the SHMMNI parameters. This kernel parameter is used to set the

maximum number of shared memory segments system wide. The default value for

this parameter is 4096. This value is sufficient and typically does not need to be


You can determine the value of SHMMNI by performing the following:

# cat /proc/sys/kernel/shmmni



Finally, we look at the SHMALL shared memory kernel parameter. This parameter

controls the total amount of shared memory (in pages) that can be used at one

time on the system. In short, the value of this parameter should always be at least:


The default size of SHMALL is 2097152 and can be queried using the following


# cat /proc/sys/kernel/shmall


From the above output, the total amount of shared memory (in bytes) that can be

used at one time on the system is:


= 2097152 * 4096

= 8,589,934,592 bytes

The default setting for SHMALL should be adequate for our Oracle installation.

NOTE: The page size in Red Hat Linux on the i386 platform is 4096 bytes. You can, however,


bigpages which supports the configuration of larger memory page sizes.



When configuring our Linux database server, it is critical to ensure that the maximum number

of file handles is large enough. The setting for file handles designate the number of open files

that you can have on the entire Linux system.

Use the following command to determine the maximum number of file handles for the entire


# cat /proc/sys/fs/file-max


Oracle recommends that the file handles for the entire system be set to at least 65536. In

most cases, the default for Red Hat Linux is 103062

This is method I use most often. This method sets the maximum number of file handles

(using the kernel parameter file-max) on startup by inserting the following kernel parameter in

the /etc/sysctl.conf startup file:

# echo "fs.file-max=65536" >> /etc/sysctl.conf

•If you wanted to dynamically alter the value of all semaphore kernel parameters without

rebooting the machine, you can make this change directly to the /proc file system. This

command can be made permanent by putting it into the /etc/rc.local startup file:

# echo "65536" > /proc/sys/fs/file-max

NOTE: It is also possible to query the current usage of file handles using the following


# cat /proc/sys/fs/file-nr

1140 0 103062

In the above example output, here is an explanation of the three values from the file-nr


•Total number of allocated file handles.

•Total number of file handles currently being used.

•Maximum number of file handles that can be allocated. This is essentially the value of filemax

- (see above).

NOTE: If you need to increase the value in /proc/sys/fs/file-max, then make sure that the

ulimit is set properly. Usually for 2.4.20 it is set to unlimited. Verify the ulimit setting my

issuing the ulimit command:

# ulimit




The /proc/sys/net/ipv4/ip_local_port_range defines the local port range that is used by TCP

and UDP traffic to choose the local port. You will see in the parameters of this file two

numbers: The first number is the first local port allowed for TCP and UDP traffic on the server,

the second is the last local port number. For high-usage systems you may change its default

parameters to 32768-61000 -first-last.

The default setup for the ip_local_port_range parameters under Red Hat Linux is: "1024


To change the values of ip_local_port_range, type the following command on your terminal:

[root@deep] /# echo "32768 61000" >/proc/sys/net/ipv4/ip_local_port_range

You must restart your network for the change to take effect.

[root@deep] /# /etc/rc.d/init.d/network restart



msg queues I use message queue's to pass messages around. I use the same queue to

send and receive messages. This is actually very bad (now that I think about it), cause you

might fill up the queue, and cause a deadlock (hmm, that appears to be happening!). anyway

to increase the sizes put bigger sizes into


The max number of bytes per message (redhat 7.2 default = 8192)


The total size of the queue. (redhat 7.2 default = 16384)


Number of messages. (redhat 7.2 default = 16)

Basically these low numbers make message queues pretty useless in a high traffic

application. Probably you can just up these numbers to be pretty large

msgmax: ( default 2048 )

The parameter "msgmax" is the maximum number of bytes that can be in

any one message. msgsnd() will give the error EINVAL if a message is

longer than this.

msgmnb: ( default 4096 )

The parameter "msgmnb" is the maximum number of message bytes that

can be on any one queue at a given time. If a message would cause a

queue to grow larger than this, that msgsnd() would either block

until space was available, or would give the error EAGAIN if user

specified non-blocking mode. For obvious reasons "msgmnb" must be at

least as large as "msgmax", however, it is probably good to set it to

some integral number of "msgmax." This way, a few messages of the

maximum size could be queued at any time. However, making "msgmnb"

too large compared to the total bytes available for messages (see

below) may allow one queue to hog the message system.

msgmni: ( default 50 )

The parameter "msgmni" is the number of message queue ids available

to the system. Each message queue requires one id. msgget() gives

the error ENOSPC if all the ids have been used up.

Contributed by:Vinay, Kalyan and Varun

Tuesday, August 18, 2009

12.0.4 Installation on OEL5/RHEL5


Pre-install steps for R12:
rpm -ivh binutils-
rpm -ivh binutils-
rpm -ivh compat-binutils215-
rpm -ivh compat-libcwait-2.1-1.i386.rpm
rpm -ivh compat-libstdc++-3.2-1.i386.rpm
rpm -ivh compat-libstdc++-egcs-1.1.2-1.i386.rpm
rpm -ivh openmotif21-debuginfo-2.1.30-11.EL5.i386.rpm
rpm -ivh libXp-1.0.0-11.fc9.i386.rpm
rpm -ivh openmotif21-2.1.30-11.EL5.i386.rpm
rpm -ivh compat-oracle-el5-1.0-5.i386.rpm
rpm -ivh xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386.rpm
rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm
rpm -ivh sysstat-7.0.2-1.el5.i386.rpm

Add the following lines in the file /etc/sysctl.conf
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
# /sbin/sysctl -p

# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba –d /oraDB oracle
# useradd -g oinstall -G dba –d /oraAPP applmgr
Change Passwords for users
# passwd oracle
# passwd applmgr

Note: While creating user (oracle/applmgr) we should not assign a directory to the user if it is a mount-point. If we do so, the default profile will not be set correctly to the users.

useradd -g dba oracle
useradd -g dba applmgr
# vi /etc/resolv.conf
options attempts:5
options timeout:15

# vi /etc/hosts localhost.localdomain localhost
ip_address node_name.domain_name node_name

# vi /etc/sysconfig/network

# vi /etc/security/limits.conf
hard nofile 65535
soft nofile 4096
hard nproc 16384
soft nproc 2047

Add the following lines to the /etc/profile:
if [ $USER = "oracle" ]; then
ulimit -u 16384
ulimit -n 65536

Oracle HTTP Server Patch (on OEL 5 and RHEL 5 only)
Download and apply the patch 6078836 from OracleMetaLink to fix an issue with the Oracle HTTP Server bundled with the E-Business Suite technology stack.

Link to Motif library for Oracle Application Server 10.1.2 (on OEL 5 and RHEL 5 only)
Perform the following command (as root on your system) to update a required link to a Motif library prior to relinking or patching the 10.1.2 Application Server Oracle Home:

#unlink /usr/lib/
# ln -s /usr/X11R6/lib/ /usr/lib/

Run the rapidwiz under stage as root user

Here is an example. Your stage location may vary.
$ cd /Stage12/startCD/Disk1/rapidwiz
$ ./RapidWizVersion
$ cd /Stage12/startCD/Disk1/rapidwiz
$ ./RapidWiz

Set the environment in the apps owner profile and DB owner's profile ie applmgr and oracle in our case.
vi .bash_profile
and enter the path to the consolidate env file
. /path to env file/APPSCONTEXT_NAME.env
Save and exit

Run the bash_profile by typing
$. .bash_profile

Same has to be done in oracle user bash_profile by sourcing the env in the $RDBMS_ORACLE_HOME.

Contributed by Kalyan and Vinay, my team-mates.