Oracle Install Tips - 10g on RHEL5
yum -y install setarch-2*
yum -y install make-3*
yum -y install glibc-2*
yum -y install libaio-0*
yum -y install compat-libstdc++-33-3*
yum -y install compat-gcc-34-3*
yum -y install compat-gcc-34-c++-3*
yum -y install gcc-4*
yum -y install libXp-1*
yum -y install openmotif-2*
yum -y install compat-db-4*
Base X
Binutils, compat-db, compat-gcc-34, compat-gcc-34-c++, compat-libstdc+
+-33, elfutils-libelf-devel, gdd, gdd-c++, gdb, gdbm, glibc, glibc-
common, glibc-devel, ksh, libXp, libXtst, libaio, libaio-devel, libgcc,
libgnome, libstdc++, libstdc++-devel, make, setarch, sysstat,
unixODBC, unixODBC-devel, util-linux, xorg-x11-xinit, compat-libstdc+
+-296
32 bit packages for 64 bit installation: glibc-devel, libaio, glibc, libgcc,
compat-libstdc++, openssl, libXp, libXtst
Determine hugepages requirement (database should be running for this)
#!/bin/bash
KERN=`uname -r | awk -F. '{ printf("%d.%d\n",$1,$2); }'`
# Find out the HugePage size
HPG_SZ=`grep Hugepagesize /proc/meminfo | awk '{print $2}'`
# Start from 1 pages to be on the safe side and guarantee 1 free HugePage
NUM_PG=1
# Cumulative number of pages required to handle the running shared memory segments
for SEG_BYTES in `ipcs -m | awk '{print $5}' | grep "[0-9][0-9]*"`
do
MIN_PG=`echo "$SEG_BYTES/($HPG_SZ*1024)" | bc -q`
if [ $MIN_PG -gt 0 ]; then
NUM_PG=`echo "$NUM_PG+$MIN_PG+1" | bc -q`
fi
done
# Finish with results
case $KERN in
'2.4') HUGETLB_POOL=`echo "$NUM_PG*$HPG_SZ/1024" | bc -q`;
echo "Recommended setting: vm.hugetlb_pool = $HUGETLB_POOL" ;;
'2.6') echo "Recommended setting: vm.nr_hugepages = $NUM_PG" ;;
*) echo "Unrecognized kernel version $KERN. Exiting." ;;
esac
cp /etc/security/limits.conf{,.orig} #to backup
oracle soft nproc 15360
oracle hard nproc 16384
oracle soft nofile 64512
oracle hard nofile 65536oracle soft memlock <Memlock is calculated by the number of huge pages allocated * 1024 *2>
oracle hard memlock <see above>
groupadd dba
useradd -g dba oracle; echo "mypass" |passwd --stdin oracle
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle.dba /u01
Determine best settings for kernel parameters in sysctl.conf:
cp /etc/sysctl.conf{,.orig} #to backup file
Obtain the total memory from the system
mem=$(free|grep Mem|awk '{print$2}')
Convert the value of $mem to bytes
totmem=$(echo "$mem*1024"|bc)
Get the Hugepagesize from /proc/meminfo
huge=$(grep Hugepagesize /proc/meminfo|awk '{print $2}')
Calculate what 75% of the total memory on the system for SHMMAX
max=$(echo "$totmem*75/100"|bc)
Divide the SHMMAX value by the Hugepagesize to get SHMALL
all=$(echo "$max/$huge"|bc)
Set the SHMMAX value in the /etc/sysctl.conf file
echo "kernel.shmmax = $max" >> /etc/sysctl.conf
Set the SHMALL value in the /etc/sysctl.conf file
echo "kernel.shmall = $all" >> /etc/sysctl.conf
# Controls the maximum shared segment size, in bytes - see kernel and hugepages infokernel.shmmax = 68719476736# Controls the maximum number of shared memory segments, in pageskernel.shmall = 4294967296kernel.sem = 250 32000 100 142fs.file-max = 104032net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_intvl = 60
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_syn_retries = 2net.core.rmem_default = 1048576net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 4194304
net.ipv4.tcp_rmem = 4096 262144 4194304
net.ipv4.tcp_wmem = 4096 262144 4194304vm.swappiness = 0
vm.overcommit_memory = 2
vm.dirty_background_ratio = 3
vm.dirty_ratio = 15
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
dev.rtc.max-user-freq = 1024
run sysctl -p #activates new kernel parameters
- cfq (Completely Fair Queuing)
- deadline
- noop
- anticipatory
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TEST; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
Start vncserver with (install with yum -y install vnc-server if necessary):
vncserver
vncpasswd
Extract cpio with:
cpio -idmv < 10201_database_linux_x86_64.cpio
cd to directory where cpio command was run
./database/runInstaller
download latest patch and unzip
./Disk1/runInstaller
sar and dstat is useful for stats on server - yum -y install sysstat dstat
man sar and dstat are your friends
Network:
HOSTNAME=$(grep HOSTNAME /etc/sysconfig/network|awk -F= '{print $2}')
hostname $HOSTNAME
GATEWAY=$(ip route list |grep default |awk '{print $3}')
echo "GATEWAY=$GATEWAY" >> /etc/sysconfig/network
DEFDEV=$(ip route list|grep default|awk '{FS=" "; print $5}')
IPADDR=$(ip addr show $DEFDEV |grep inet |grep -v inet6|awk '{print $2}'|awk -F/
'{print $1}')
echo "IPADDR=$IPADDR" >> /etc/sysconfig/network-scripts/ifcfg-$DEFDEV
sed -i 's/dhcp/static/' /etc/sysconfig/network-scripts/ifcfg-$DEFDEV
BCAST=$(ip addr show eth0 |grep inet |grep -v inet6|awk '{print $4}')
echo "BROADCAST=$BCAST" >> /etc/sysconfig/network-scripts/ifcfg-$DEFDEV
echo "NETMASK=255.255.255.0" >> /etc/sysconfig/network-scripts/ifcfg-$DEFDEV
No comments:
Post a Comment