export ORACLE_BASE=/oracle/app/grid
export ORACLE_HOME=/oracle/app/11.2.0/grid
export ORACLE_SID=+ASM2
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin
export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
export TMOUT=0
oracle用户:
#vim ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=test
export LANG=en_US.UTF-8
export NLS_LANG=american_america.ZHS16GBK
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin:/home/oracle/run
export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp
export GI_HOME=/oracle/app/11.2.0/grid
export PATH=${PATH}:$GI_HOME/bin
export ORA_NLS10=$GI_HOME/nls/data
umask 022
export TMOUT=0
8.配置UDEV:
以下操作需要2个节点都执行:
# cd /etc/udev/rules.d
# vim 99-oracle-asmdevices.rules
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="364862761000560eb82f364f700000014",, OWNER="grid", GROUP="asmadmin", MODE="0660"
其中RESULT的值为磁盘的UUID
获取磁盘UUID的命令如下:
# scsi_id --whitelisted --replace-whitespace --device=/dev/sdb
建议使用脚本将所有磁盘的UUID输出到x.log,然后使用列编辑搞定所有asm磁盘
./test.sh > x.log
执行并核对完99-oracle-asmdevices.rules后,便可以执行命令启动udev了:
# ./sbin/start_udev
# ls -al /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Aug 7 14:57 /dev/asmdisk001
9.安装cvudisk包
# cd $INSTALL_MEDIA/grid/rpm/
## CVUQDISK_GRP=oinstall;export CVUQDISK_GRP --可以在此处自定义安装用户组
# rpm -ivh cvuqdisk-1.0.9-1.rpm
Preparing... ########################################### [100%]
Using default group oinstall to install package
1:cvuqdisk ########################################### [100%]
10.配置SSH互信
# cp $INSTALL_MEDIA/grid/sshsetup/sshUserSetup.sh /home/grid
# cd /home/grid
# chown grid:oinstall sshUserSetup.sh
# su - grid
$ ./sshUserSetup.sh -user grid -hosts "test1 test1-priv test2 test2-priv" -advanced -noPromptPassphrase
$ date;ssh test2 date; ssh test1-priv date; ssh test2-priv date
# cp $INSTALL_MEDIA/grid/sshsetup/sshUserSetup.sh /home/oracle
# cd /home/oracle
# chown oracle:oinstall sshUserSetup.sh
# su - oracle
$ ./sshUserSetup.sh -user oracle -hosts "test1 test1-priv test2 test2-priv" -advanced -noPromptPassphrase
$ ./date;ssh test date; ssh test1-priv date; ssh test2-priv date
11.运行GI的安装前检查