oracle11g rac安裝過程

yhj20041128001發表於2012-08-19

http://www.itpub.net/forum.php?mod=viewthread&tid=1361814

http://www.oracle.com/technetwork/cn/articles/rac11g-setting-100145-zhs.html#top

http://www.oracledatabase12g.com/archives/step-by-step-install-11gr2-rac-on-linux5-by-vbox.html

 


 


/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 505 asmoper
/usr/sbin/groupadd -g 506 asmdba

mkdir /oracle/app/

/usr/sbin/useradd -m -u 1100 -g oinstall -G dba,asmdba,oper -d /oracle/app/oracle -s /bin/bash -c "Oracle Owner" oracle
/usr/sbin/useradd -m -u 1000  -g oinstall -G asmadmin,asmdba,asmoper,oper,dba  -d /oracle/app/grid -s /bin/bash -c "Grid Infrastructure Owner" grid

passwd oracle  echo "oracle"|passwd  --stdin oracle
passwd grid    echo "oracle"|passwd  --stdin grid

chown -R grid:oinstall /oracle/app/
chmod -R 775 /oracle/app/
mkdir -p /oracle/app/oraInventory
chown -R grid:oinstall /oracle/app/oraInventory
chmod -R 775 /oracle/app/oraInventory

chown -R grid:oinstall /oracle/app/grid
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle/app/oracle
chmod -R 775 /oracle/app/grid

vi /etc/security/limits.conf
#ORACLE SETTING

grid                 soft    nproc   2047
grid                 hard    nproc   16384
grid                 soft    nofile  1024
grid                 hard    nofile  65536
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536


vi /etc/pam.d/login
session    required     pam_limits.so

 vi /etc/pam.d/system-auth
password    required      pam_cracklib.so \
               ucredit=0 lcredit=-1 dcredit=-1 credit=-1 minlen=8

# vi /etc/sysctl.conf
#ORACLE SETTING

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 262144
kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.sem = 6000 768000 6000 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


設定時間同步 crontab -e

dev/shm 共享記憶體不足
解決方法:
例如:為了將/dev/shm的大小增加到1GB,修改/etc/fstab的這行:預設的:
none     /dev/shm       tmpfs   defaults        0 0
改成:
none     /dev/shm       tmpfs   defaults,size=1024m        0 0
size引數也可以用G作單位:size=1G。
重新mount /dev/shm使之生效:
# mount -o remount /dev/shm
或者:
# umount /dev/shm
# mount -a
馬上可以用"df -h"命令檢查變化。

修改grid使用者的.bash_profile

#export ORACLE_HOSTNAME=192.168.113.194
export TMP=/tmp;
export TMPDIR=$TMP;
export ORACLE_SID=+ASM1;
export ORACLE_BASE=/oracle/app/oracle;
export ORACLE_HOME=/oracle/app/grid/product/11.2.3/crs_home;
export ORACLE_OWNER=grid
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS";
export THREADS_FLAG=native;
export JAVA_HOME=/usr/local/java
export PATH=$ORACLE_HOME/bin:$JAVA_HOME/bin:$PATH:/usr/local/bin/:;
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
              ulimit -n 65536
  else
   ulimit -u 16384 -n 65536
      fi
    umask 022
fi

修改oracle使用者的.bash_profile


export ORACLE_HOSTNAME=192.168.113.194
export TMP=/tmp;
export TMPDIR=$TMP;
export ORACLE_BASE=/oracle/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/11.2.3/db_1;
export ORACLE_OWNER=oracle
export ORACLE_SID=trac1
export ORACLE_TERM=xterm;
export PATH=$PATH:$ORACLE_HOME/bin:$GRID_HOME/bin:/sbin:/usr/sbin:/bin:/usr/local/bin:.
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS";
export NLS_LANG=american_america.ZHS16GBK
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
         ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
        umask 022
fi

配置對等性關係

在node1,node2上執行
mkdir ~/.ssh
chmod 700 ~/.ssh

ssh-keygen -t rsa
ssh-keygen -t dsa

在node1上執行
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

ssh node2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh node2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys node2:~/.ssh/authorized_keys

 

 cd /etc/udev/rules.d
 touch 99-oracle-asmdevices.rules


KERNEL=="sdb1", NAME="vote1", WNER="oracle", GROUP="oinstall",MODE="0660",ACTION=="add|change"
KERNEL=="sdc1", NAME="vote2", WNER="oracle", GROUP="oinstall", MODE="0660",ACTION=="add|change"
KERNEL=="sdd1", NAME="vote3", WNER="oracle", GROUP="oinstall", MODE="0660",ACTION=="add|change"
KERNEL=="sde1", NAME="DATA1", WNER="oracle", GROUP="oinstall", MODE="0660",ACTION=="add|change"
KERNEL=="sdf1", NAME="DATA2", WNER="oracle", GROUP="oinstall", MODE="0660",ACTION=="add|change"

On RHEL5/OEL5/OL5:
 /sbin/udevcontrol reload_rules
 /sbin/start_udev

 

 

vi /etc/udev/rules.d/63-oracle-raw.rules

ACTION=="add",KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add",KERNEL=="sde1", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add",KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw5 %N"

KERNEL=="raw[1-6]*", WNER="oracle", GROUP="oinstall", MODE="660"


繫結

/bin/raw /dev/raw/raw1 /dev/sdb1
/bin/raw /dev/raw/raw2 /dev/sdc1
/bin/raw /dev/raw/raw3 /dev/sdd1
/bin/raw /dev/raw/raw4 /dev/sde1
/bin/raw /dev/raw/raw5 /dev/sdf1

 

chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chown oracle:oinstall /dev/raw/raw4
chown oracle:oinstall /dev/raw/raw5

chmod 660 /dev/raw/raw1
chmod 660 /dev/raw/raw2
chmod 660 /dev/raw/raw3
chmod 660 /dev/raw/raw4
chmod 660 /dev/raw/raw5

重建EM皆可。

emca -config dbcontrol db -repos recreate -cluster
 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23757700/viewspace-741337/,如需轉載,請註明出處,否則將追究法律責任。

相關文章