RHEL 6下安裝Oracle 11g R2

來源:互聯網
上載者:User

我在RHEL6 32位上安裝。使用GNOME圖形介面,安裝的時候把Development Tools裡的開發包都安裝上,或者快速安裝後搭建本地yum源再利用群組安裝也可。值得注意的是swap要求至少3G,我的機器為2G實體記憶體。

安裝過程分為兩步,一是修改系統參數,二是軟體及資料庫安裝。

修改系統參數

step1: vi /etc/sysctl.conf, 添加如下參數:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

儲存並使之生效

/sbin/sysctl -p

如果有如下提示錯誤,忽略,因為即使未修改參數也提示有這個錯誤

error: “net.bridge.bridge-nf-call-ip6tables” is an unknown key
error: “net.bridge.bridge-nf-call-iptables” is an unknown key
error: “net.bridge.bridge-nf-call-arptables” is an unknown key
注意: kernel.shmmax’s    的值是實體記憶體的一半。 我的是2G記憶體,所以是1073741824
step2: vi /etc/security/limits.conf,添加:
Oracle  soft  nproc  2047
oracle  hard   nproc  16384
oracle  soft  nofile 1024
oracle  hard  nofile 65536
step3: vi /etc/pam.d/login,添加參數:
session  required  pam_limits.so step4:vi /etc/profile:
if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
    else
        ulimit -u 16384 -n 65536
    fi
fi
step4: vi /etc/csh.login:
if( $USER == “oracle” ) then
    limit maxproc 16384
    limit descriptors 65536
    umask 022
endif
step5: vi /etc/RedHat-release,修改為如下值,成功安裝資料庫後在修改回來:
Red Hat Enterprise Linux Server release 5.0 (Tikanga)
step6: 添加相關使用者及使用者組:
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
echo “oracle”|passwd –stdin oracle (我比較懶,管道命令修改oracle密碼)
Step 6: 建立安裝路徑及修改許可權:
mkdir -p /opt/11g/oracle
chown -R oracle:oinstall /opt/11g/oracle
chmod -R 775 /opt/11g/oracle
mkdir -p /opt/11g/oraInventory
chown -R oracle:oinstall /opt/11g/oraInventory
chmod -R 775 /opt/11g/oraInventory
Step 7:  vi /home/oracle/.bash_profile, 其中ORACLE_SID的值可以自己定,我的設為orcl
TMP=/tmp; export TMP
ORACLE_BASE=/opt/11g/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:/usr/sbin:$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
umask 022
使環境變數生效:
source ~/.bash_profile

  • 1
  • 2
  • 下一頁

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.