ORACLE 11g RAC安装搭建手册 下载本文

vi /etc/sysctl.conf ###ORACLE SETTING

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

kernel.shmmax=17179869184 kernel.shmall=4194304 kernel.shmmni=4096

kernel.sem=250 32000 100 128

net.ipv4.ip_local_port_range=9000 65500 net.core.rmem_default=4194304 net.core.wmem_default=262144 net.core.rmem_max=4194304 net.core.wmem_max=1048576 fs.aio-max-nr=1048576 fs.file-max=6815744

net.ipv4.conf.all.arp_ignore=1 (4)执行命令(rac1、rac2) sysctl -p

(5)修改rac1和rac2的profile,在末尾添加 vi /etc/profile

if [ $USER =\ if [ $SHELL = \ ulimit -p 16384 ulimit -n 65536 else

ulimit -u 16384 -n 65536 fi umask 022 fi

(6)执行命令(rac1、rac2) source /etc/profile

(7)修改rac1和rac2的/etc/csh.login vi /etc/csh.login

if ( $USER = \

limit maxproc 16384 limit descriptors 65536 endif EOFCSH

(8)修改grid用户的环境变量 rac1

su - grid

vi .bash_profile

export ORACLE_SID=+ASM1

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/11.2.0/grid/product/db_1 export PATH=$PATH:$ORACLE_HOME/bin rac2

su - grid

vi .bash_profile

export ORACLE_SID=+ASM2

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/11.2.0/grid/product/db_1 export PATH=$PATH:$ORACLE_HOME/bin (9)执行命令(rac1、rac2) source .bash_profile

(10)修改oracle用户的环境变量 rac1

su - oracle

vi .bash_profile

export ORACLE_SID=PROD1

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export PATH=$PATH:$ORACLE_HOME/bin rac2

su - oracle

vi .bash_profile

export ORACLE_SID=PROD2

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export PATH=$PATH:$ORACLE_HOME/bin (11)执行命令(rac1、rac2) source .bash_profile

7.配置SSH互信

(1)使用oracle用户,在所有节点执行 su –oracle mkdir ~/.ssh cd .ssh

ssh-keygen -t rsa ssh-keygen -t dsa 在rac1上:

touch authorized_keys

ssh rac1 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys ssh rac2 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys ssh rac1 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys ssh rac2 cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys ssh rac1-priv cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys ssh rac2-priv cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys ssh rac1-priv cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys ssh rac2-priv cat /home/oracle/.ssh/id_dsa.pub >> authorized_keys scp authorized_keys rac2:/home/oracle/.ssh/ 分别在rac1,rac2测试ssh互信 rac1

ssh ssh rac1 date ssh rac2 date

ssh rac1-priv date ssh rac2-priv date rac2

ssh rac1 date ssh rac2 date

ssh rac1-priv date ssh rac2-priv date

(2)使用grid用户,在所有节点执行 su –grid mkdir ~/.ssh cd .ssh

ssh-keygen -t rsa ssh-keygen -t dsa 在rac1上:

touch authorized_keys

ssh rac1 cat /home/grid/.ssh/id_rsa.pub >> authorized_keys ssh rac2 cat /home/grid/.ssh/id_rsa.pub >> authorized_keys ssh rac1 cat /home/grid/.ssh/id_dsa.pub >> authorized_keys ssh rac2 cat /home/grid/.ssh/id_dsa.pub >> authorized_keys ssh rac1-priv cat /home/grid/.ssh/id_rsa.pub >> authorized_keys ssh rac2-priv cat /home/grid/.ssh/id_rsa.pub >> authorized_keys ssh rac1-priv cat /home/grid/.ssh/id_dsa.pub >> authorized_keys ssh rac2-priv cat /home/grid/.ssh/id_dsa.pub >> authorized_keys scp authorized_keys rac2:/home/grid/.ssh/ 分别在rac1,rac2测试ssh互信 rac1

ssh ssh rac1 date

ssh rac2 date

ssh rac1-priv date ssh rac2-priv date rac2

ssh rac1 date ssh rac2 date

ssh rac1-priv date ssh rac2-priv date

8.安装ASM

(1)检查系统及内核版本 uname -a

(2)下载与系统及内核版本对应的ASM,并安装 下载地址:

http://www.oracle.com/technetwork/server-storage/linux/downloads/index.html 例如:

rpm -ivh --nodeps oracleasmlib-2.0.4-1.el5.x86_64.rpm

rpm -ivh --nodeps oracleasm-support-2.1.8-1.el5.x86_64.rpm

rpm -ivh --nodeps oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm rpm -ivh --nodeps oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5.x86_64.rpm

rpm -ivh --nodeps oracleasm-2.6.18-164.el5debug-2.0.5-1.el5.x86_64.rpm rpm -ivh --nodeps oracleasm-2.6.18-164.el5xen-2.0.5-1.el5.x86_64.rpm 如果操作系统为oracle版本的linux,直接使用yum安装即可 yum install -y oracleasm*

(3)初始化asmlib,在所有节点执行 oracleasm configure -i

[root@rac01 ~]# oracleasm configure -i

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library driver. The following questions will determine whether the driver is loaded on boot and what permissions it will have. The current values will be shown in brackets ('[]'). Hitting without typing an answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: grid

Default group to own the driver interface []: asmadmin

Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: y

Writing Oracle ASM library driver configuration: done (4)ASMlib加载到内核,在所有节点执行