centos 6 安装 oracle

step 1

echo "## Oracle stuff  " >> /etc/sysctl.conf
echo "fs.aio-max-nr = 10488576 ">> /etc/sysctl.conf
echo "fs.file-max = 6815744 ">> /etc/sysctl.conf
echo "kernel.shmall = 2097152 ">> /etc/sysctl.conf
echo "kernel.shmmax = 536870912 ">> /etc/sysctl.conf
echo "kernel.shmmni = 4096 ">> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128 ">> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500 ">> /etc/sysctl.conf
echo "net.core.rmem_default = 262144 ">> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304 ">> /etc/sysctl.conf
echo "net.core.wmem_default = 262144 ">> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586 ">> /etc/sysctl.conf
/sbin/sysctl -p
 

vim /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"


## 文件存储位置
mkdir /data
cd /data/
mkdir file
mkdir temp
mkdir soft
chmod -R 777 file
chmod -R 777 temp
cd /
ln -s /data/file pqsoft
ln -s /data/temp temp

step 2

groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle 
echo "oracle" | passwd --stdin oracle
cd /data
mkdir oracle
chown -R oracle:oinstall /data/oracle
chmod -R 775 /data/oracle
mkdir oraInventory
chown -R oracle:oinstall /data/oraInventory
chmod -R 775 /data/oraInventory

step 3

echo "# Oracle stuff  " >> /etc/security/limits.conf
echo "oracle soft nproc 2047" >> /etc/security/limits.conf
echo "oracle hard nproc 16384" >> /etc/security/limits.conf
echo "oracle soft nofile 1024" >> /etc/security/limits.conf
echo "oracle hard nofile 65536" >> /etc/security/limits.conf
echo "oracle soft stack 10240" >> /etc/security/limits.conf

step 4

echo "session required /lib/security/pam_limits.so" >> /etc/pam.d/login

step 5

vim /home/oracle/.bash_profile
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 
export ORACLE_SID=pqsoft 
export PATH=$ORACLE_HOME/bin:$PATH 
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib 
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib 
export NLS_LANG=AMERICAN_CHINA.ZHS16GBK 

source /home/oracle/.bash_profile
yum clean metadata
yum makecache

#!/bin/bash
 
yum -y install \
binutils \
compat-libcap1  \
compat-libstdc++-33 \
compat-libstdc++-33*.i686 \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc*.i686 \
glibc \
glibc-devel \
glibc-devel*.i686 \
ksh \
libgcc*.i686 \
libgcc \
libstdc++ \
libstdc++*.i686 \
libstdc++-devel \
libstdc++-devel*.i686 \
libaio \
libaio*.i686 \
libaio-devel \
libaio-devel*.i686 \
make \
sysstat \
unixODBC \
unixODBC*.i686 \
unixODBC-devel \
unixODBC-devel*.i686 \
libXp

yum groupinstall -y "X Window System"


rpm -ivh jdk-7u71-linux-x64.rpm

#oracle 密码时效限制取消
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED ;

你可能感兴趣的:(centos 6 安装 oracle)