一,安装前准备
1, 组和用户创建 (每个节点)
点击(此处)折叠或打开
[root@huy1 ~]# groupadd -g 200 oinstall
[root@huy1 ~]# groupadd -g 201 dba
[root@huy1 ~]# groupadd -g 202 oper
[root@huy1 ~]# groupadd -g 204 asmoper
[root@huy1 ~]# groupadd -g 205 asmdba
[root@huy1 ~]# useradd -u 200 -g oinstall -G dba,asmdba,oper oracle
[root@huy1 ~]# useradd -u 201 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid [root@huy1 ~]# passwd grid [root@huy1 ~]# passwd oracle
2, 用户目录创建(每个节点)
点击(此处)折叠或打开
[root@huy1 ~]# mkdir -p /u01/app/oraInventory
[root@huy1 ~]# chown -R grid:oinstall /u01/app/oraInventory/
[root@huy1 ~]# chmod -R 775 /u01/app/oraInventory/
[root@huy1 ~]# mkdir -p /u01/11.2.0/grid
[root@huy1 ~]# chown -R grid:oinstall /u01/11.2.0/grid/
[root@huy1 ~]# chmod -R 775 /u01/11.2.0/grid/
[root@huy1 ~]# mkdir -p /u01/app/oraInventory/
[root@huy1 ~]# mkdir -p /u01/app/oracle
[root@huy1 ~]# mkdir -p /u01/app/oracle/cfgtoollogs
[root@huy1 ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
[root@huy1 ~]# chown -R oracle:oinstall /u01/app/oracle
[root@huy1 ~]# chmod -R 775 /u01/app/oracle 3,网络配置 (每个节点)
/etc/hosts
点击(此处)折叠或打开
127.0.0.1 localhost.localdomain localhost
192.168.56.101 huy1
192.168.56.102 huy2
192.168.56.201 huy1-vip
192.168.56.202 huy2-vip
192.168.56.100 huy-scan
10.10.10.101 huy1-priv
10.10.10.102 huy2-priv 4, 内核参数配置(每个节点)
vi /etc/sysctl.conf
点击(此处)折叠或打开
kernel.shmall = 268435456
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 5, 用户限制 (每个节点)
[root@huy1 ~]# vi /etc/security/limits.conf (追加)
点击(此处)折叠或打开
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240 [root@huy1 ~]# vi /etc/pam.d/login 追加
点击(此处)折叠或打开
session required /lib/security/pam_limits.so vi/etc/profile 追加
if [ $USER = "oracle" ]||[ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
6, 关闭 NTP 各个节点
[root@huy1 ~]# chkconfig ntpd off
7, grid用户 SSH 相互信任 在节点一操作,passphrase都设置为空
点击(此处)折叠或打开
[grid@huy1 ~]$ ssh-keygen -t dsa
[grid@huy1 ~]$ ssh-keygen -t rsa
[grid@huy1 ~]$ ssh huy2 ssh-keygen -t dsa
[grid@huy1 ~]$ ssh huy2 ssh-keygen -t rsa
[grid@huy1 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys
[grid@huy1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
[grid@huy1 ~]$ ssh huy2 cat .ssh/id_dsa.pub >> .ssh/authorized_keys grid@huy2's password: [grid@huy1 ~]$ ssh huy2 cat .ssh/id_rsa.pub >> .ssh/authorized_keys grid@huy2's password: [grid@huy1 ~]$ scp .ssh/authorized_keys huy2:~/.ssh/ grid@huy2's password:
测试 (两边节点)
点击(此处)折叠或打开
[grid@huy1 ~]$ ssh huy1 date
[grid@huy1 ~]$ ssh huy2 date
[grid@huy1 ~]$ ssh huy1-priv date
[grid@huy1 ~]$ ssh huy2-priv date
7, grid用户 SSH 相互信任 在节点一操作,passphrase都设置为空
点击(此处)折叠或打开
[oracle@huy1 ~]$ ssh-keygen -t dsa
[oracle@huy1 ~]$ ssh-keygen -t rsa
[oracle@huy1 ~]$ ssh huy2 ssh-keygen -t dsa
[oracle@huy1 ~]$ ssh huy2 ssh-keygen -t rsa
[oracle@huy1 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys
[oracle@huy1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
[oracle@huy1 ~]$ ssh huy2 cat .ssh/id_dsa.pub >> .ssh/authorized_keys
oracle@huy2\'s password:
[oracle@huy1 ~]$ ssh huy2 cat .ssh/id_rsa.pub >> .ssh/authorized_keys
oracle@huy2\'s password:
[oracle@huy1 ~]$ scp .ssh/authorized_keys huy2:~/.ssh/
oracle@huy2's password: 测试 (两边节点)
点击(此处)折叠或打开
[oracle@huy1 ~]$ ssh huy1 date
[oracle@huy1 ~]$ ssh huy2 date
[oracle@huy1 ~]$ ssh huy1-priv date
[oracle@huy1 ~]$ ssh huy2-priv date 8,安装asmlib (两边节点)
点击(此处)折叠或打开
[root@huy1 asm]# ls
oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm oracleasmlib-2.0.4-1.el5.i386.rpm oracleasm-support-2.1.3-1.el5.i386.rpm
[root@huy1 asm]# rpm -ivh *.rpm
9, 配置asm磁盘 (节点一上)
点击(此处)折叠或打开
[root@huy1 soft]# service oracleasm configure
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 <ENTER> 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
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@huy1 soft]# service oracleasm createdisk OCR_VOTE1 /dev/sdb1
Marking disk \"OCR_VOTE1\" as an ASM disk: [ OK ]
[root@huy1 soft]# service oracleasm createdisk OCR_VOTE2 /dev/sdb2
Marking disk \"OCR_VOTE2\" as an ASM disk: [ OK ]
[root@huy1 soft]# service oracleasm createdisk OCR_VOTE3 /dev/sdb3
Marking disk \"OCR_VOTE3\" as an ASM disk: [ OK ]
[root@huy1 soft]# service oracleasm createdisk DATA1 /dev/sdb5
Marking disk \"DATA1\" as an ASM disk: [ OK ]
[root@huy1 soft]# service oracleasm createdisk DATA2 /dev/sdb6
Marking disk \"DATA2\" as an ASM disk: [ OK ]
[root@huy1 soft]# service oracleasm createdisk RCY1 /dev/sdb7
Marking disk \"RCY1\" as an ASM disk: [ OK ]
[root@huy1 soft]# service oracleasm createdisk RCY2 /dev/sdb8
Marking disk \"RCY2\" as an ASM disk: [ OK ]
[root@huy1 soft]# service oracleasm listdisks
DATA1
DATA2
OCR_VOTE1
OCR_VOTE2
OCR_VOTE3
RCY1
RCY2
[root@huy1 soft]# ll /dev/oracleasm/disks
total 0
brw-rw---- 1 grid asmadmin 8, 21 Sep 9 18:01 DATA1
brw-rw---- 1 grid asmadmin 8, 22 Sep 9 18:01 DATA2
brw-rw---- 1 grid asmadmin 8, 17 Sep 9 18:00 OCR_VOTE1
brw-rw---- 1 grid asmadmin 8, 18 Sep 9 18:00 OCR_VOTE2
brw-rw---- 1 grid asmadmin 8, 19 Sep 9 18:00 OCR_VOTE3
brw-rw---- 1 grid asmadmin 8, 23 Sep 9 18:01 RCY1
brw-rw---- 1 grid asmadmin 8, 24 Sep 9 18:01 RCY2
另一个节点
点击(此处)折叠或打开
[root@node2 asm]# service oracleasm configure
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 <ENTER> 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
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@node2 asm]# service oracleasm listdisks
DATA1
DATA2
OCR_VOTE1
OCR_VOTE2
OCR_VOTE3
RCY1
RCY2
[root@node2 asm]# ll /dev/oracleasm/disks
total 0
brw-rw---- 1 grid asmadmin 8, 21 Sep 9 18:01 DATA1
brw-rw---- 1 grid asmadmin 8, 22 Sep 9 18:01 DATA2
brw-rw---- 1 grid asmadmin 8, 17 Sep 9 18:01 OCR_VOTE1
brw-rw---- 1 grid asmadmin 8, 18 Sep 9 18:01 OCR_VOTE2
brw-rw---- 1 grid asmadmin 8, 19 Sep 9 18:01 OCR_VOTE3
brw-rw---- 1 grid asmadmin 8, 23 Sep 9 18:01 RCY1
brw-rw---- 1 grid asmadmin 8, 24 Sep 9 18:01 RCY2 10, 用 yum 安装 各个节点
[root@huy1 yum.repos.d]# yum install -y sysstat*
[root@huy1 yum.repos.d]# yum install -y libaio*
[root@huy1 yum.repos.d]# yum install -y unixODBC*
准备工作完成
来自 “ ITPUB博客 ” ,链接:/12238525/viewspace-1288988/,如需转载,请注明出处,否则将追究法律责任。