万博manbetx官方网页云技术 Oracle 企业IT技术咨询 全国范围工程师上门服务
 工作时间
周一至周五 :8:30-17:30
周六至周日 :10:00-16:00
 联系方式
售前技术:18672322163
商务合作:17771306897
新闻详情

Redhat 6.5安装Oracle 11g RAC

1.编辑虚拟机,设置网卡;
2.设置IP地址: vi /etc/sysconfig/network-scripts/
3.修改主机名
修改文件  vi /etc/sysconfig/network
即时生效  hostname RAC1
修改主机名与IP对应关系:  vi /etc/hosts
192.168.123.201  rac1
192.168.123.202  rac2
192.168.56.11     rac1priv
192.168.56.22     rac2priv
192.168.123.211  rac1vip
192.168.123.212  rac2vip
192.168.123.200  racscanip
4.配置yum源:
光驱挂载:
创建挂载点 mkdir /mnt/yum
挂载: mount -o loop /dev/cdrom  /mnt/yum
ISO 挂载方法:
新建文件夹: mkdir /soft
上传Redhat ISO到redhat文件夹
mount -o loop /soft/rhel-server-6.10-x86_64-dvd.iso /mnt/yum

vi /etc/yum.repos.d/yum.repo

[server]
name=server
baseurl=file:///mnt/yum
enable=1
gpgcheck=0
配置yum源
yum install -y  binutils-* compat-libstdc++-33-* elfutils-libelf-* elfutils-libelf-devel-* gcc-* gcc-c++-* glibc-* glibc-common-* glibc-devel-* glibc-headers-* ksh-* libaio-* libgcc-* libstdc++-*  make-* sysstat-* unixODBC-*  unixODBC-devel-* compat-libcap*
比单机安装多安装 compat-libcap*
5.修改系统参数
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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

sysctl -p

vi /etc/security/limits.conf
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

6.增加组、用户、目录
groupadd -g 1000 oinstall
groupadd -g 1100 asmadmin
groupadd -g 1200 dba
groupadd -g 1300 asmdba
groupadd -g 1301 asmoper
useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid grid
useradd -u 1101 -g oinstall -G dba,asmdba -d /home/oracle oracle
echo grid | passwd --stdin grid
echo oracle | passwd --stdin oracle

mkdir -p /oracle/app/oraInventory
chown -R grid:oinstall /oracle/app/oraInventory
chmod -R 775 /oracle/app/oraInventory
mkdir -p /oracle/11.2.0/grid
mkdir -p /oracle/app/grid
chown -R grid:oinstall /oracle/app/grid
chown -R grid:oinstall /oracle/11.2.0/grid
chmod -R 775 /oracle/11.2.0/grid
mkdir -p /oracle/app/oracle
mkdir /oracle/app/oracle/cfgtoollogs
chown -R oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle/app/oracle
mkdir -p /oracle/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /oracle/app/oracle/product/11.2.0/db_1
chmod -R 775 /oracle/app/oracle/product/11.2.0/db_1
7.配置环境变量、互信
rac1
su - grid
vi .bash_profile
export ORACLE_SID=+ASM1
export ORACLE_BASE=/oracle/app/grid
export ORACLE_HOME=/oracle/11.2.0/grid
export PATH=$ORACLE_HOME/bin:$PATH
rac2
su - grid
vi .bash_profile
export ORACLE_SID=+ASM2
export ORACLE_BASE=/oracle/app/grid
export ORACLE_HOME=/oracle/11.2.0/grid
export PATH=$ORACLE_HOME/bin:$PATH
rac1
su - oracle
export ORACLE_SID=+racdb1
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
rac2
su - oracle
export ORACLE_SID=+racdb2
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
rac1
root用户执行
/soft/grid/sshsetup/sshUserSetup.sh -user grid -hosts "rac1 rac2" -advanced -noPromptPassphrase
/soft/grid/sshsetup/sshUserSetup.sh -user oracle -hosts "rac1 rac2" -advanced -noPromptPassphrase
rac1&rac2
su - grid
ssh rac1 date
ssh rac2 date
ssh rac1priv date
ssh rac2priv date
su - oracle
ssh rac1 date
ssh rac2 date
ssh rac1priv date
ssh rac2priv date

8.配置裸设备
vi /etc/udev/rules.d/60-raw.rules
ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="raw*", OWNER="grid", GROUP="asmadmin", MODE="660"
start_udev
ls -l /dev/raw
在RAC2上
partprobe
start_udev
ls -l /dev/raw
9.关闭各项服务
关闭服务
service iptables stop
chkconfig autofs off
chkconfig acpid off
chkconfig sendmail off
chkconfig cups-config-daemon off
chkconfig cpus off
chkconfig xfs off
chkconfig lm_sensors off
chkconfig gpm off
chkconfig openibd off
chkconfig pcmcia off
chkconfig cpuspeed off
chkconfig nfslock off
chkconfig iptables off
chkconfig ip6tables off
chkconfig rpcidmapd off
chkconfig apmd off
chkconfig sendmail off
chkconfig arptables_jf off
chkconifg microcode_ctl off
chkconfig rpcgssd off
chkconfig ntpd off
10、开始安装
上传软件包并解压
cd /soft/grid/
./runInstaller
step 5 of 16
SCAN NAME:racscanip
step 6 of 16
rac1 rac1vip
rac2 rac2vip
step 7 of 16
eth0 172.168.56.0 public
eth1 10.10.10.0   private
step 8 of 16
Oracle ASM
step 9 of 16
Disk Group Name:griddg
Redundancy:External
Disk Path:/dev/raw/raw3
step 13 of 16
Oracle Base:/oracle/app/grid
Software Location:/oracle/11.2.0/grid