1:配置DNS服务器解析和主机host文件 [root@rhel6 ~]# tail /var/named/named.yang.com node1 IN A 192.168.1.51 node1-priv IN A 192.168.122.51 node1-vip IN A 192.168.1.151 node2 IN A 192.168.1.52 node2-priv IN A 192.168.122.52 node2-vip IN A 192.168.1.152 rac-scan IN A 192.168.1.50 [root@rhel6 ~]# service named restart 停止 named:.[确定] 启动 named:[确定] 2:配置rac节点的host文件,两个节点的内容保持一致 [root@node1 ~]# cat /etc/hosts 127.0.0.1 localhost.localdomain localhost 192.168.1.51 node1.yang.com node1 192.168.1.151 node1-vip.yang.com node1-vip 192.168.122.51 node1-priv.yang.com node1-priv 192.168.1.52 node2.yang.com node2 192.168.1.152 node2-vip.yang.com node2-vip 192.168.122.52 node2-priv.yang.com node1-priv 192.168.1.50 rac-scan.yang.com rac-scan 3:安装相关的rpm包,调整内核参数,两个节点执行相同的操作 [root@node1 ~]# yum -y install sysstat numactl-devel libaio-devel [root@node1 ~]# yum -y install compat-* [root@node1 ~]# grep 'limits.so' /etc/pam.d/login session required pam_limits.so [root@node2 ~]# tail /etc/security/limits.conf oracle hard nproc 204800 oracle soft nofile 204800 oracle hard nofile 204800 oracle soft stack 204800 grid soft nproc 204800 grid hard nproc 204800 grid soft nofile 204800 grid hard nofile 204800 grid soft stack 204800 [root@node1 ~]# tail -11 /etc/sysctl.conf fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 1029347328 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 [root@node1 ~]# sysctl -p 4:校对系统时间,两个节点执行相同的操作 [root@node1 ~]# head -2 /etc/sysconfig/ntpd # Drop root to id 'ntp:ntp' by default. OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid" [root@node1 ~]# /usr/sbin/ntpdate -u 192.168.1.100 22 Jan 13:45:28 ntpdate[3377]: step time server 192.168.1.100 offset -37.183698 sec [root@node1 ~]# echo '01 */01 * * * /usr/sbin/ntpdate -u 192.168.1.100' > /var/spool/cron/root [root@node1 ~]# service ntpd start [root@node1 ~]# chkconfig ntpd on 5:创建相关用户,设置环境变量,两个节点执行相同的操作(节点2需要相应的修改ORACLE_SID) [root@node1 ~]# groupadd oinstall [root@node1 ~]# groupadd asmadmin [root@node1 ~]# groupadd asmdba [root@node1 ~]# groupadd asmoper [root@node1 ~]# groupadd dba [root@node1 ~]# groupadd oper [root@node1 ~]# useradd -g oinstall -G asmadmin,asmdba,asmoper grid [root@node1 ~]# echo 'oracle' |passwd --stdin grid Changing password for user grid. passwd: all authentication tokens updated successfully. [root@node1 ~]# useradd -g oinstall -G dba,oper,asmdba oracle [root@node1 ~]# echo 'oracle' |passwd --stdin oracle Changing password for user oracle. passwd: all authentication tokens updated successfully. [root@node1 ~]# cat /home/grid/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs export ORACLE_SID=+ASM1 export ORACLE_UNQNAME=node1 export ORACLE_HOSTNAME=node1.yang.com export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/11.2.0/grid export ORACLE_TERM=xterm export NLS_DATE_FORMAT="YYYY-MM-DD-HH24:MI:SS" export TNS_ADMIN=$ORACLE_HOME/network/admin export ORA_NLS11=$ORACLE_HOME/nls/data export PATH=$HOME/bin:$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib export CLASSPATH=$ORACLE_HOME/JRE export TEMP=/tmp export TMPDIR=/tmp umask 022 [root@node1 ~]# cat /home/oracle/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs export ORACLE_SID=node1 export ORACLE_UNQNAME=node1 export ORACLE_HOSTNAME=node1.yang.com export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db1 export ORACLE_TERM=xterm export NLS_DATE_FORMAT="YYYY-MM-DD-HH24:MI:SS" export TNS_ADMIN=$ORACLE_HOME/network/admin export ORA_NLS11=$ORACLE_HOME/nls/data export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib export CLASSPATH=$ORACLE_HOME/JRE export TEMP=/tmp export TMPDIR=/tmp umask 022 6:安装asm包,两个节点执行相同的操作,创建asm磁盘组 [root@node1 ~]# cat url.txt http://oss.oracle.com/projects/oracleasm-support/dist/files/RPMS/rhel5/amd64/2.1.7/oracleasm-support-2.1.7-1.el5.x86_64.rpm http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.4-1.el5.x86_64.rpm http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel5/amd64/2.0.5/2.6.18-164.el5/oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel5/amd64/2.0.5/2.6.18-164.el5/oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5.x86_64.rpm http://oss.oracle.com/projects/oracleasm/dist/files/RPMS/rhel5/amd64/2.0.5/2.6.18-164.el5/oracleasm-2.6.18-164.el5debug-2.0.5-1.el5.x86_64.rpm [root@node1 ~]# wget -i url.txt [root@node1 ~]# rpm -ivh oracleasm* warning: oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:oracleasm-support ########################################### [ 20%] 2:oracleasm-2.6.18-164.el########################################### [ 40%] 3:oracleasm-2.6.18-164.el########################################### [ 60%] 4:oracleasm-2.6.18-164.el########################################### [ 80%] 5:oracleasmlib ########################################### [100%] [root@node1 ~]# /usr/sbin/oracleasm configure ORACLEASM_ENABLED=false ORACLEASM_UID= ORACLEASM_GID= ORACLEASM_SCANBOOT=true ORACLEASM_SCANORDER="" ORACLEASM_SCANEXCLUDE="" [root@node1 ~]# /usr/sbin/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 <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 [root@node1 ~]# mkdir -p /u01/app/grid [root@node1 ~]# mkdir -p /u01/app/11.2.0/grid [root@node1 ~]# chown -R grid.oinstall /u01 [root@node1 ~]# mkdir -p /u01/app/oracle [root@node1 ~]# chown -R oracle.oinstall /u01/app/oracle [root@node1 ~]# chmod -R 775 /u01/ [root@node1 ~]# fdisk -l /dev/sda Disk /dev/sda: 53.6 GB, 53687091200 bytes 64 heads, 32 sectors/track, 51200 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Device Boot Start End Blocks Id System /dev/sda1 1 51200 52428784 5 Extended /dev/sda5 1 1908 1953760 83 Linux /dev/sda6 1909 3816 1953776 83 Linux /dev/sda7 3817 5724 1953776 83 Linux /dev/sda8 5725 34335 29297648 83 Linux /dev/sda9 34336 51200 17269744 83 Linux [root@node1 ~]# oracleasm listdisks CRS1 CRS2 CRS3 DATA FRA [root@node2 ~]# oracleasm scandisks Reloading disk partitions: done Cleaning any stale ASM disks... Scanning system for ASM disks... Instantiating disk "CRS1" Instantiating disk "CRS2" Instantiating disk "CRS3" Instantiating disk "DATA" Instantiating disk "FRA" |