whitek 发表于 2018-9-22 08:14:58

部署Oracle 11.2.0.3 RAC (一)

  1:配置DNS服务器解析和主机host文件
  # 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
  # service named restart
  停止 named:.[确定]
  启动 named:[确定]
  2:配置rac节点的host文件,两个节点的内容保持一致
  # 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.comnode1-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.comnode1-priv
  192.168.1.50            rac-scan.yang.com    rac-scan
  3:安装相关的rpm包,调整内核参数,两个节点执行相同的操作
  # yum -y install sysstat numactl-devel libaio-devel
  # yum -y install compat-*
  # grep 'limits.so' /etc/pam.d/login
  session    required   pam_limits.so
  # tail/etc/security/limits.conf
  oracle            hard    nproc   204800
  oracle            soft    nofile204800
  oracle            hard    nofile204800
  oracle            soft    stack   204800
  grid                soft    nproc   204800
  grid                hard    nproc   204800
  grid                soft    nofile204800
  grid                hard    nofile204800
  grid                soft    stack   204800
  # 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
  # sysctl -p
  4:校对系统时间,两个节点执行相同的操作
  # head -2 /etc/sysconfig/ntpd

  # Drop root to>  OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
  # /usr/sbin/ntpdate -u 192.168.1.100
  22 Jan 13:45:28 ntpdate: step time server 192.168.1.100 offset -37.183698 sec
  # echo '01 */01 *** /usr/sbin/ntpdate -u 192.168.1.100' > /var/spool/cron/root
  # service ntpd start
  # chkconfig ntpd on
  5:创建相关用户,设置环境变量,两个节点执行相同的操作(节点2需要相应的修改ORACLE_SID)
  # groupadd oinstall
  # groupadd asmadmin
  # groupadd asmdba
  # groupadd asmoper
  # groupadd dba
  # groupadd oper
  # useradd -g oinstall -G asmadmin,asmdba,asmoper grid
  # echo 'oracle' |passwd --stdin grid
  Changing password for user grid.
  passwd: all authentication tokens updated successfully.
  # useradd -g oinstall -G dba,oper,asmdba oracle
  # echo 'oracle' |passwd --stdin oracle
  Changing password for user oracle.
  passwd: all authentication tokens updated successfully.
  # 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>  export TEMP=/tmp
  export TMPDIR=/tmp
  umask 022
  # 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>  export TEMP=/tmp
  export TMPDIR=/tmp
  umask 022
  6:安装asm包,两个节点执行相同的操作,创建asm磁盘组
  # 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
  # wget -i url.txt
  # rpm -ivh oracleasm*

  warning: oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key>  Preparing...                ###########################################
  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         ###########################################
  # /usr/sbin/oracleasm configure
  ORACLEASM_ENABLED=false
  ORACLEASM_UID=
  ORACLEASM_GID=
  ORACLEASM_SCANBOOT=true
  ORACLEASM_SCANORDER=""
  ORACLEASM_SCANEXCLUDE=""
  # /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 ('[]').Hittingwithout 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) : y
  Scan for Oracle ASM disks on boot (y/n) : y
  Writing Oracle ASM library driver configuration: done
  # mkdir -p /u01/app/grid
  # mkdir -p /u01/app/11.2.0/grid
  # chown -R grid.oinstall /u01
  # mkdir -p /u01/app/oracle
  # chown -R oracle.oinstall /u01/app/oracle
  # chmod -R 775 /u01/
  # 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>  /dev/sda1               1       51200    52428784    5Extended
  /dev/sda5               1      1908   1953760   83Linux
  /dev/sda6            1909      3816   1953776   83Linux
  /dev/sda7            3817      5724   1953776   83Linux
  /dev/sda8            5725       34335    29297648   83Linux
  /dev/sda9         34336       51200    17269744   83Linux
  # oracleasm listdisks
  CRS1
  CRS2
  CRS3
  DATA
  FRA
  # 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"

页: [1]
查看完整版本: 部署Oracle 11.2.0.3 RAC (一)