----------------------------------------------------------------
1 Confirm madatory rpm package is installed
----------------------------------------------------------------
1 Confirm madatory rpm package is installed
----------------------------------------------------------------
binutils glibc-* glibc-common-* glibc-devel-* libgcc-* libstdc++-* libstdc++-devel make
gcc-* gcc-c++-* libaio-* libXp-* compat-libstdc-* compat-gcc-* compat-db-* openmotif-*
--------------------------------------------
2 Create oracle group and user
--------------------------------------------
groupadd oinstall
groupadd dba
gcc-* gcc-c++-* libaio-* libXp-* compat-libstdc-* compat-gcc-* compat-db-* openmotif-*
--------------------------------------------
2 Create oracle group and user
--------------------------------------------
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba
-------------------------------------------------
3 Create dir and change ownership
-------------------------------------------------
3 Create dir and change ownership
-------------------------------------------------
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chown -R oracle:oinstall /u01
-------------------------------------
4 Configure OS related file
-------------------------------------
--1) /etc/sysctl.conf
4 Configure OS related file
-------------------------------------
--1) /etc/sysctl.conf
#N GBytes, >=half of physical memory
kernel.shmmax = 1024*1024*1024*N
#Value*4096>=SGA,4096 is the OS pagesize
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 200 128
fs.file-max = 870400
net.ipv4.ip_local_port_range = 1024 65000
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 250 32000 200 128
fs.file-max = 870400
net.ipv4.ip_local_port_range = 1024 65000
#Default is 262144
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
#Config hugepages for memory performance.
#value of hugetlb_shm_group is dba group,from `id oracle`;
#nr_hugepages from executed hugepages_setting.sh after DB SGA config
#Which need to change when memory/sga change
#value of hugetlb_shm_group is dba group,from `id oracle`;
#nr_hugepages from executed hugepages_setting.sh after DB SGA config
#Which need to change when memory/sga change
vm.hugetlb_shm_group=111
vm.nr_hugepages=6656
vm.nr_hugepages=6656
#async IO limit, default value may cause oracle AIO limited issue
fs.aio-max-nr= 10485760
fs.aio-max-nr= 10485760
-- hugepages_setting.sh
#!/bin/bash
#
# hugepages_settings.sh
#
# Linux bash script. to compute values for the
# recommended HugePages/HugeTLB configuration
#
# Note: This script. does calculation for all shared memory
# segments available when the script. is run, no matter it
# is an Oracle RDBMS shared memory segment or not.
# Check for the kernel version
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
# End
--2) /etc/security/limits.conf
#Default install
#oracle soft nproc 2047
#oracle hard nproc 16384
#oracle soft nofile 1024
#oracle hard nofile 65536
#oracle hard nproc 16384
#oracle soft nofile 1024
#oracle hard nofile 65536
oracle soft nproc 3096
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 870400
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 870400
#Enable hugepages for oracle and lock SGA
#Value of memlock is nr_hugepages*Hugepagesize, hugepagesize is from /proc/meminfo
oracle soft memlock 12720128
oracle hard memlock 12720128
#Value of memlock is nr_hugepages*Hugepagesize, hugepagesize is from /proc/meminfo
oracle soft memlock 12720128
oracle hard memlock 12720128
--3) /etc/pam.d/login
session required /lib/security/pam_limits.so
--4)Disable selinux
/etc/sysconfig/selinux
SELINUX=disabled
--------------------------------
5 Config oracle profile
--------------------------------
vi .bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2/db_1
export ORACLE_SID=pzfjd
export ORACLE_TERM=xterm
export LANG=en_US
export ORACLE_HOME=$ORACLE_BASE/product/10.2/db_1
export ORACLE_SID=pzfjd
export ORACLE_TERM=xterm
export LANG=en_US
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27064837/viewspace-752862/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27064837/viewspace-752862/