1、虚拟机配置
2、上传oracle软件包(在第一个节点上传即可)
-rw-r--r-- 1 root root 1395582860 Nov 7 2014 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 root root 1151304589 Nov 7 2014 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r-- 1 root root 1205251894 Nov 7 2014 p13390677_112040_Linux-x86-64_3of7.zip
3、配置Yum源用于安装oracle依赖包(两个节点都要做)
[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ls -l
total 4
-rw-r--r-- 1 root root 71 Aug 21 05:54 kobe.repo
[root@localhost yum.repos.d]# cat kobe.repo
[kobe]
name=kobe
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=0
4、挂载光盘(两个节点都要)
[root@localhost yum.repos.d]# mkdir /mnt/cdrom
[root@localhost yum.repos.d]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
5、安装oracle依赖包
6、/etc/hosts文件配置
第一个节点
192.168.1.53 itpux1
#public ip ent1
192.168.1.53 itpux1
192.168.1.54 itpux2
#priv ip ent2
192.168.40.133 itpux1prv
192.168.40.134 itpux2prv
#vip ip
192.168.1.128 itpux1vip
192.168.1.129 itpux2vip
#scan ip
192.168.1.185 itpuxscan
第二个节点
192.168.1.54 itpux2
#public ip ent1
192.168.1.53 itpux1
192.168.1.54 itpux2
#priv ip ent2
192.168.40.133 itpux1prv
192.168.40.134 itpux2prv
#vip ip
192.168.1.128 itpux1vip
192.168.1.129 itpux2vip
#scan ip
192.168.1.185 itpuxscan
7、配置主机名
第一个节点
[root@localhost yum.repos.d]# hostname itpux1
[root@localhost yum.repos.d]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=itpux1
第二个节点
[root@localhost yum.repos.d]# hostname itpux2
[root@localhost yum.repos.d]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=itpux2
8、添加用户和组
[root@itpux1 ~]# /usr/sbin/groupadd -g 501 oinstall
[root@itpux1 ~]# /usr/sbin/groupadd -g 502 dba
[root@itpux1 ~]# /usr/sbin/groupadd -g 503 oper
[root@itpux1 ~]# /usr/sbin/groupadd -g 504 asmadmin
[root@itpux1 ~]# /usr/sbin/groupadd -g 505 asmoper
[root@itpux1 ~]# /usr/sbin/groupadd -g 506 asmdba
[root@itpux1 ~]# /usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
[root@itpux1 ~]# /usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
[root@itpux1 ~]#
[root@itpux1 ~]# echo "oracle" |passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[root@itpux1 ~]# echo "grid"|passwd --stdin grid
Changing password for user grid.
passwd: all authentication tokens updated successfully.
9、创建目录
[root@itpux1 ~]# mkdir -p /u01/app/grid
[root@itpux1 ~]# mkdir -p /u01/app/11.2.0/grid
[root@itpux1 ~]# chown -R grid:oinstall /u01
[root@itpux1 ~]# mkdir -p /u01/app/oraInventory
[root@itpux1 ~]# chown -R grid:oinstall /u01/app/oraInventory
[root@itpux1 ~]# mkdir -p /u01/app/oracle
[root@itpux1 ~]# chown -R oracle:oinstall /u01/app/oracle
[root@itpux1 ~]# chmod -R 775 /u01
10、
oracle hard stack 32768
12、[root@itpux1 ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
[root@itpux1 ~]# setenforce 0
13、
[root@itpux1 ~]# service iptables stop
[root@itpux1 ~]# chkconfig iptables off
14、
15、
16、停止ntp服务
[root@itpux1 ~]# service ntpd status
ntpd is stopped
[root@itpux1 ~]# chkconfig ntpd off
[root@itpux1 ~]# cp /etc/ntp.conf /etc/ntp.conf.bak
[root@itpux1 ~]# rm -rf /etc/ntp.conf
17、[grid@itpux1 ~]$ cat .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 PS1
umask 022
alias sqlplus="rlwrap sqlplus"
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=itpux1
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
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@itpux1 ~]$ cat .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 PATHfi
节点2
[grid@itpux2 ~]$ cat .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 PS1
umask 022
alias sqlplus="rlwrap sqlplus"
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=itpux2
ORACLE_SID=+ASM2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
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@itpux2 ~]$ cat .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
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_HOSTNAME=itpux2
export ORACLE_UNQNAME=itpuxdb
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=itpuxdb2; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/11.2.0/db_1/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
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
设置asm磁盘
第一个节点:
raw配置
vi /etc/udev/rules.d/60-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"
ACTION=="add", KERNEL=="sdg1",RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add",KERNEL=="raw*", OWNER="grid", GROUP="asmadmin", MODE="660"
start_udev
ll /dev/raw
raw -qa
第二个节点:
vi /etc/udev/rules.d/60-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"
ACTION=="add", KERNEL=="sdg1",RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add",KERNEL=="raw*", OWNER="grid", GROUP="asmadmin", MODE="660"
partprobe
raw -qa
start_udev
ll /dev/raw