2014-07-08 Created By BaoXinjian
一、摘要
[root@localhost ~]# fdisk -l Disk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 38 305203+ 83 Linux /dev/sda2 39 1177 9149017+ 83 Linux /dev/sda3 1178 1305 1028160 82 Linux swap / Solaris Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table Disk /dev/sdc: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdc doesn't contain a valid partition table Disk /dev/sdd: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdd doesn't contain a valid partition table Disk /dev/sde: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sde doesn't contain a valid partition table
二、安装前配置
1. 配置网路
[root@localhost ~]# hostname rac1.gavin.com [root@localhost ~]# vi /etc/sysconfig/network [root@localhost ~]# service network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: Determining IP information for eth0... done. [ OK ] [root@localhost ~]# vi /etc/hosts #Public Host Names 192.168.37.145 rac1.gavin.com rac1 192.168.37.144 rac2.gavin.com rac2 #Private Host Names 192.168.1.145 rac1-priv.gavin.com rac1-priv 192.168.1.144 rac2-priv.gavin.com rac2-priv #Virtual Host Names 192.168.1.45 rac1-vip.gavin.com rac1-vip 192.168.1.44 rac2-vip.gavin.com rac2-vip
[root@rac1 ~]# ping rac1.gavin.com [root@rac1 ~]# ping rac2.gavin.com
[root@rac1 ~]# vi /etc/sysconfig/ntpd OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
2. 设置组和用户
[root@rac1 ~]# /usr/sbin/groupadd -g 501 oinstall [root@rac1 ~]# /usr/sbin/groupadd -g 502 dba [root@rac1 ~]# /usr/sbin/groupadd -g 504 asmadmin [root@rac1 ~]# /usr/sbin/groupadd -g 506 asmdba [root@rac1 ~]# /usr/sbin/groupadd -g 507 asmoper [root@rac1 ~]# /usr/sbin/useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper grid [root@rac1 ~]# /usr/sbin/useradd -u 502 -g oinstall -G dba,asmdba oracle [root@rac1 ~]# id oracle uid=502(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),506(asmdba) context=root:system_r:unconfined_t:SystemLow-SystemHigh [root@rac1 ~]# id grid uid=501(grid) gid=501(oinstall) groups=501(oinstall),504(asmadmin),506(asmdba),507(asmoper) context=root:system_r:unconfined_t:SystemLow-SystemHigh
3. 配置共享存储
安装ASMLib库
[root@rac1 ~]# uname -a Linux rac1.gavin.com 2.6.18-53.el5 #1 SMP Mon Nov 12 02:14:55 EST 2007 x86_64 x86_64 x86_64 GNU/Linux
http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html
[root@rac1 oracleasm]# ls -ltr total 260 -rw-r--r-- 1 root root 131720 Jan 23 22:47 oracleasm-2.6.18-53.el5-2.0.4-1.el5.x86_64.rpm -rw-r--r-- 1 root root 14176 Jan 23 22:52 oracleasmlib-2.0.4-1.el5.x86_64.rpm -rw-r--r-- 1 root root 90225 Jan 23 22:52 oracleasm-support-2.1.8-1.el5.x86_64.rpm [root@rac1 oracleasm]# rpm -ivh oracleasm-support-2.1.8-1.el5.x86_64.rpm \ > oracleasmlib-2.0.4-1.el5.x86_64.rpm \ > oracleasm-2.6.18-53.el5-2.0.4-1.el5.x86_64.rpm warning: oracleasm-support-2.1.8-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:oracleasm-support ########################################### [ 33%] 2:oracleasm-2.6.18-53.el5########################################### [ 67%] 3:oracleasmlib ########################################### [100%]
[root@rac1 oracleasm]# /etc/init.d/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 [asmdba]: Start Oracle ASM library driver on boot (y/n) [y]: Scan for Oracle ASM disks on boot (y/n) [y]: Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver: [ OK ] Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac1 oracleasm]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content wont be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): p Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-652, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-652, default 652): Using default value 652 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.
[root@rac1 oracleasm]# fdisk -l Disk /dev/sda: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 38 305203+ 83 Linux /dev/sda2 39 1177 9149017+ 83 Linux /dev/sda3 1178 1305 1028160 82 Linux swap / Solaris Disk /dev/sdb: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 652 5237158+ 83 Linux Disk /dev/sdc: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 652 5237158+ 83 Linux Disk /dev/sdd: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdd1 1 652 5237158+ 83 Linux Disk /dev/sde: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sde1 1 652 5237158+ 83 Linux
[root@rac1 oracleasm]# dd if=/dev/zero of=/dev/sdb1 bs=1M count=10 10+0 records in 10+0 records out 10485760 bytes (10 MB) copied, 0.129025 seconds, 81.3 MB/s [root@rac1 oracleasm]# dd if=/dev/zero of=/dev/sdc1 bs=1M count=10 10+0 records in 10+0 records out 10485760 bytes (10 MB) copied, 0.164202 seconds, 63.9 MB/s [root@rac1 oracleasm]# dd if=/dev/zero of=/dev/sdd1 bs=1M count=10 10+0 records in 10+0 records out 10485760 bytes (10 MB) copied, 0.09297 seconds, 113 MB/s [root@rac1 oracleasm]# dd if=/dev/zero of=/dev/sde1 bs=1M count=10 10+0 records in 10+0 records out 10485760 bytes (10 MB) copied, 0.068404 seconds, 153 MB/s
[root@rac1 oracleasm]# /usr/sbin/oracleasm init [root@rac1 oracleasm]# /usr/sbin/oracleasm createdisk DISK1 /dev/sdb1 Writing disk header: done Instantiating disk: done[root@rac1 oracleasm]# /usr/sbin/oracleasm createdisk DISK2 /dev/sdc1 Writing disk header: done Instantiating disk: done [root@rac1 oracleasm]# /usr/sbin/oracleasm createdisk DISK3 /dev/sdd1 Writing disk header: done Instantiating disk: done [root@rac1 oracleasm]# /usr/sbin/oracleasm createdisk DISK4 /dev/sde1 Writing disk header: done Instantiating disk: done
[root@rac1 oracleasm]# /usr/sbin/oracleasm scandisks Reloading disk partitions: done Cleaning any stale ASM disks... Scanning system for ASM disks... [root@rac1 oracleasm]# /usr/sbin/oracleasm listdisks DISK1 DISK2 DISK3 DISK4
4. 保护外壳和用户限制配置
[root@rac1 oracleasm]# 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
[root@rac1 oracleasm]# vi /etc/pam.d/login session required pam_limit.s
5. 配置内核参数
[root@rac1 oracleasm]# vi /etc/sysctl.conf kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 512 x processes net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmen_default = 262144 net.core.wmen_max = 1048576
三、安装Oracle Grid Infrastructure
异常处理
[root@rac1 oracleasm]# /etc/init.d/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 [asmdba]: Start Oracle ASM library driver on boot (y/n) [y]: Scan for Oracle ASM disks on boot (y/n) [y]: Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver: [FAILED]
[root@rac1 oracleasm]# vi /etc/sysconfig/selinux # 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@rac1 oracleasm]# setenforce 0
Thanks and Regards