RHEL5 Oracle 11G R2 RAC 靜默安裝 (一) GI安裝前 準備

huyi_tony發表於2014-10-04
一,安裝前準備
1, 組和使用者建立 (每個節點)

點選(此處)摺疊或開啟

  1. [root@huy1 ~]# groupadd -g 200 oinstall
  2. [root@huy1 ~]# groupadd -g 201 dba
  3. [root@huy1 ~]# groupadd -g 202 oper
  4. [root@huy1 ~]# groupadd -g 204 asmoper
  5. [root@huy1 ~]# groupadd -g 205 asmdba
  6. [root@huy1 ~]# useradd -u 200 -g oinstall -G dba,asmdba,oper oracle
  7. [root@huy1 ~]# useradd -u 201 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
  8. [root@huy1 ~]# passwd grid
  9. [root@huy1 ~]# passwd oracle
2, 使用者目錄建立(每個節點)

點選(此處)摺疊或開啟

  1. [root@huy1 ~]# mkdir -p /u01/app/oraInventory
  2. [root@huy1 ~]# chown -R grid:oinstall /u01/app/oraInventory/
  3. [root@huy1 ~]# chmod -R 775 /u01/app/oraInventory/
  4. [root@huy1 ~]# mkdir -p /u01/11.2.0/grid
  5. [root@huy1 ~]# chown -R grid:oinstall /u01/11.2.0/grid/
  6. [root@huy1 ~]# chmod -R 775 /u01/11.2.0/grid/
  7. [root@huy1 ~]# mkdir -p /u01/app/oraInventory/
  8. [root@huy1 ~]# mkdir -p /u01/app/oracle
  9. [root@huy1 ~]# mkdir -p /u01/app/oracle/cfgtoollogs
  10. [root@huy1 ~]# mkdir -p /u01/app/oracle/product/11.2.0/db_1
  11. [root@huy1 ~]# chown -R oracle:oinstall /u01/app/oracle
  12. [root@huy1 ~]# chmod -R 775 /u01/app/oracle
3,網路配置 (每個節點)
/etc/hosts

點選(此處)摺疊或開啟

  1. 127.0.0.1 localhost.localdomain localhost
  2. 192.168.56.101 huy1
  3. 192.168.56.102 huy2
  4. 192.168.56.201 huy1-vip
  5. 192.168.56.202 huy2-vip
  6. 192.168.56.100 huy-scan
  7. 10.10.10.101 huy1-priv
  8. 10.10.10.102 huy2-priv
4, 核心引數配置  (每個節點)
vi /etc/sysctl.conf 

點選(此處)摺疊或開啟

  1. kernel.shmall = 268435456
  2. fs.aio-max-nr = 1048576
  3. fs.file-max = 6815744
  4. kernel.shmall = 2097152
  5. kernel.shmmax = 536870912
  6. kernel.shmmni = 4096
  7. kernel.sem = 250 32000 100 128
  8. net.ipv4.ip_local_port_range = 9000 65500
  9. net.core.rmem_default = 262144
  10. net.core.rmem_max = 4194304
  11. net.core.wmem_default = 262144
  12. net.core.wmem_max = 1048586
5, 使用者限制 (每個節點)
[root@huy1 ~]# vi /etc/security/limits.conf  (追加)

點選(此處)摺疊或開啟

  1. oracle soft nproc 2047
  2. oracle hard nproc 16384
  3. oracle soft nofile 1024
  4. oracle hard nofile 65536
  5. oracle soft stack 10240
  6. grid soft nproc 2047
  7. grid hard nproc 16384
  8. grid soft nofile 1024
  9. grid hard nofile 65536
  10. grid soft stack 10240
[root@huy1 ~]# vi /etc/pam.d/login  追加

點選(此處)摺疊或開啟

  1. session required /lib/security/pam_limits.so
vi /etc/profile 追加

  1. 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都設定為空

點選(此處)摺疊或開啟

  1. [grid@huy1 ~]$ ssh-keygen -t dsa
  2. [grid@huy1 ~]$ ssh-keygen -t rsa
  3. [grid@huy1 ~]$ ssh huy2 ssh-keygen -t dsa
  4. [grid@huy1 ~]$ ssh huy2 ssh-keygen -t rsa
  5. [grid@huy1 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys
  6. [grid@huy1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
  7. [grid@huy1 ~]$ ssh huy2 cat .ssh/id_dsa.pub >> .ssh/authorized_keys
  8. grid@huy2's password: 
  9. [grid@huy1 ~]$ ssh huy2 cat .ssh/id_rsa.pub >> .ssh/authorized_keys
  10. grid@huy2's password: 
  11. [grid@huy1 ~]$ scp .ssh/authorized_keys huy2:~/.ssh/
  12. grid@huy2's password: 
測試 (兩邊節點)


點選(此處)摺疊或開啟

  1. [grid@huy1 ~]$ ssh huy1 date
  2. [grid@huy1 ~]$ ssh huy2 date
  3. [grid@huy1 ~]$ ssh huy1-priv date
  4. [grid@huy1 ~]$ ssh huy2-priv date


7, grid使用者 SSH 相互信任 在節點一操作, 
passphrase都設定為空

點選(此處)摺疊或開啟

  1. [oracle@huy1 ~]$ ssh-keygen -t dsa
  2. [oracle@huy1 ~]$ ssh-keygen -t rsa
  3. [oracle@huy1 ~]$ ssh huy2 ssh-keygen -t dsa
  4. [oracle@huy1 ~]$ ssh huy2 ssh-keygen -t rsa
  5. [oracle@huy1 ~]$ cat .ssh/id_dsa.pub >> .ssh/authorized_keys
  6. [oracle@huy1 ~]$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
  7. [oracle@huy1 ~]$ ssh huy2 cat .ssh/id_dsa.pub >> .ssh/authorized_keys
  8. oracle@huy2\'s password:
  9. [oracle@huy1 ~]$ ssh huy2 cat .ssh/id_rsa.pub >> .ssh/authorized_keys
  10. oracle@huy2\'s password:
  11. [oracle@huy1 ~]$ scp .ssh/authorized_keys huy2:~/.ssh/
  12. oracle@huy2's password: 
測試 (兩邊節點)

點選(此處)摺疊或開啟

  1. [oracle@huy1 ~]$ ssh huy1 date
  2. [oracle@huy1 ~]$ ssh huy2 date
  3. [oracle@huy1 ~]$ ssh huy1-priv date
  4. [oracle@huy1 ~]$ ssh huy2-priv date
8,安裝asmlib (兩邊節點)

點選(此處)摺疊或開啟

  1. [root@huy1 asm]# ls
  2. 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
  3. [root@huy1 asm]# rpm -ivh *.rpm

9, 配置asm磁碟 (節點一上)

點選(此處)摺疊或開啟

  1. [root@huy1 soft]# service oracleasm configure
  2. Configuring the Oracle ASM library driver.

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

  8. Default user to own the driver interface []: grid
  9. Default group to own the driver interface []: asmadmin
  10. Start Oracle ASM library driver on boot (y/n) [n]: y
  11. Scan for Oracle ASM disks on boot (y/n) [y]: y
  12. Writing Oracle ASM library driver configuration: done
  13. Initializing the Oracle ASMLib driver: [ OK ]
  14. Scanning the system for Oracle ASMLib disks: [ OK ]
  15. [root@huy1 soft]# service oracleasm createdisk OCR_VOTE1 /dev/sdb1
  16. Marking disk \"OCR_VOTE1\" as an ASM disk: [ OK ]
  17. [root@huy1 soft]# service oracleasm createdisk OCR_VOTE2 /dev/sdb2
  18. Marking disk \"OCR_VOTE2\" as an ASM disk: [ OK ]
  19. [root@huy1 soft]# service oracleasm createdisk OCR_VOTE3 /dev/sdb3
  20. Marking disk \"OCR_VOTE3\" as an ASM disk: [ OK ]
  21. [root@huy1 soft]# service oracleasm createdisk DATA1 /dev/sdb5
  22. Marking disk \"DATA1\" as an ASM disk: [ OK ]
  23. [root@huy1 soft]# service oracleasm createdisk DATA2 /dev/sdb6
  24. Marking disk \"DATA2\" as an ASM disk: [ OK ]
  25. [root@huy1 soft]# service oracleasm createdisk RCY1 /dev/sdb7
  26. Marking disk \"RCY1\" as an ASM disk: [ OK ]
  27. [root@huy1 soft]# service oracleasm createdisk RCY2 /dev/sdb8
  28. Marking disk \"RCY2\" as an ASM disk: [ OK ]
  29. [root@huy1 soft]# service oracleasm listdisks
  30. DATA1
  31. DATA2
  32. OCR_VOTE1
  33. OCR_VOTE2
  34. OCR_VOTE3
  35. RCY1
  36. RCY2
  37. [root@huy1 soft]# ll /dev/oracleasm/disks
  38. total 0
  39. brw-rw---- 1 grid asmadmin 8, 21 Sep 9 18:01 DATA1
  40. brw-rw---- 1 grid asmadmin 8, 22 Sep 9 18:01 DATA2
  41. brw-rw---- 1 grid asmadmin 8, 17 Sep 9 18:00 OCR_VOTE1
  42. brw-rw---- 1 grid asmadmin 8, 18 Sep 9 18:00 OCR_VOTE2
  43. brw-rw---- 1 grid asmadmin 8, 19 Sep 9 18:00 OCR_VOTE3
  44. brw-rw---- 1 grid asmadmin 8, 23 Sep 9 18:01 RCY1
  45. brw-rw---- 1 grid asmadmin 8, 24 Sep 9 18:01 RCY2

另一個節點

點選(此處)摺疊或開啟

  1. [root@node2 asm]# service oracleasm configure
  2. Configuring the Oracle ASM library driver.

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

  8. Default user to own the driver interface []: grid
  9. Default group to own the driver interface []: asmadmin
  10. Start Oracle ASM library driver on boot (y/n) [n]: y
  11. Scan for Oracle ASM disks on boot (y/n) [y]: y
  12. Writing Oracle ASM library driver configuration: done
  13. Initializing the Oracle ASMLib driver: [ OK ]
  14. Scanning the system for Oracle ASMLib disks: [ OK ]
  15. [root@node2 asm]# service oracleasm listdisks
  16. DATA1
  17. DATA2
  18. OCR_VOTE1
  19. OCR_VOTE2
  20. OCR_VOTE3
  21. RCY1
  22. RCY2
  23. [root@node2 asm]# ll /dev/oracleasm/disks
  24. total 0
  25. brw-rw---- 1 grid asmadmin 8, 21 Sep 9 18:01 DATA1
  26. brw-rw---- 1 grid asmadmin 8, 22 Sep 9 18:01 DATA2
  27. brw-rw---- 1 grid asmadmin 8, 17 Sep 9 18:01 OCR_VOTE1
  28. brw-rw---- 1 grid asmadmin 8, 18 Sep 9 18:01 OCR_VOTE2
  29. brw-rw---- 1 grid asmadmin 8, 19 Sep 9 18:01 OCR_VOTE3
  30. brw-rw---- 1 grid asmadmin 8, 23 Sep 9 18:01 RCY1
  31. 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部落格 ” ,連結:http://blog.itpub.net/12238525/viewspace-1288988/,如需轉載,請註明出處,否則將追究法律責任。

相關文章