Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3388057
  • 博文数量: 631
  • 博客积分: 10716
  • 博客等级: 上将
  • 技术积分: 8397
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-01 22:35
文章分类

全部博文(631)

文章存档

2020年(2)

2019年(22)

2018年(4)

2017年(37)

2016年(22)

2015年(1)

2013年(12)

2012年(20)

2011年(19)

2010年(20)

2009年(282)

2008年(190)

分类: Oracle

2009-02-05 19:48:19

 

1.1网络分配:
主机名 公网(public) 专网(private) 虚拟网(vip) Rac1 IP IP IP Rac2 IP IP IP
1.2 硬件资源
Cpu :Intel(R) Xeon(TM) MP CPU 3.16GHz*2 内存:1G 硬盘: 20G 共享磁盘:6G
1.3 操作系统安装
1.3.1 操作系统版本:Red Hat Enterprise Linux AS release 4 (Nahant Update 4) 1.3.2 系统分区 分区信息 分区类型 分区大小 /boot ext3 100M / ext3 10240M Swap swap 2048 /oracle ext3 10240M /opt ext3 5120M /tmp ext3 1024M 1.3.3 系统语言 简体中文,ENGLISH(USA) 1.3.4 安装模式 完全安装
Oracle11g RAC for Linux 实施手册
2
二 数据安装资源
2.1 数据库安装包
2.1.1 ORACLE 11G软件包: 下载地址: Oracle Database 11g Release 1 (11.1.0.6.0) for Linux x86 Oracle Database 11g Release 1 Client (11.1.0.6.0) for Linux x86 Oracle Database 11g Examples (formerly Companion) Oracle Clusterware Release 1 (11.1.0.6.0) for Linux x86 Oracle Database Gateways 11g Release 1 (11.1.0.6.0) for Linux x86 2.1.2 ORACLE 11G-ASMlib工具包:
下载地址:
oracleasm-2.6.9-42.ELsmp-2.0.3-1.i686.rpm
oracleasm-support-2.0.3-1.i386.rpm
oracleasmlib-2.0.2-1.i386.rpm 2.1.3 系统补丁的下载 下载地址:
compat-libcwait-2.1-1.i386.rpm
compat-oracle-rhel4-1.0-5.i386.rpm
三 系统安装配置
3.1 系统参数配置
3.1.1 关闭没必要的服务 chkconfig --level 35 autofs off chkconfig --level 35 acpid off chkconfig –level 35 sendmail off chkconfig –level 35 cups-config-daemon off chkconfig –level 35 cpus off chkconfig –level 35 xfs off chkconfig –level 35 lm_sensors off
Oracle11g RAC for Linux 实施手册
3
chkconfig –level gpm off chkconfig –level openibd off chkconfig –level iiim off chkconfig –level pcmcia off chkconfig –level cpuspeed off chkconfig –level nfslock off chkconfig –level ip6tables off chkconfig –level rpcidmapd off chkconfig –level apmd off chkconfig –level sendmail off chkconfig –level arptables_jf off chkconifg –level microcode_ctl off chkconfig –level rpcgssd off
3.1.2设置主机表 vi /etc/hosts 127.0.0.1 localhost.localdomain localhost IP rac1 IP racp1 IP racv1 IP rac2 IP racp2 IP racv2 3.1.3 修改内核参数 vi /etc/sysctl.conf kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.shmall = 2097152 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 4194304 net.core.wmem_max = 4194304 kernel.panic = 60
3.1.4设置oracle登录使用资源数 vi /etc/security/limits.conf oracle soft nofile 65536 oracle hard nofile 65536
Oracle11g RAC for Linux 实施手册
4
oracle soft nproc 16384 oracle hard nproc 16384 vi /etc/pam.d/login –末行加入以下 session required pam_limits.so multiple open
3.1.5建立hangcheck模块加载 检测是否安装了hangcheck模块 [root@rac1]# find /lib/modules -name "hangcheck-timer.ko" /lib/modules/2.6.9-42.ELsmp/kernel/drivers/char/hangcheck-timer.ko 设置模块为自动加载 su – echo "options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180" >> /etc/modprobe.conf 或者 echo " /sbin/modprobe hangcheck-timer hangcheck_tick=30 hangcheck_margin=180" >> /etc/rc.local 检测模块是否运行 su - modprobe hangcheck-timer grep Hangcheck /var/log/messages | tail -2 3.1.6 禁用selinux getsebool getsebool: SELinux is disabled vi /etc/selinux/config SELINUX=disabled 3.1.7 添加oracle用户和用户组 mkdir –p /oracle/oracle groupadd –g 502 dba groupadd –g 501 oinstall useradd –g 501 –G 502 –d /oracle/oracle oracle passwd oracle chown -R oracle.oinstall /oracle/oracle 3.1.8 修改主机名 vi /etc/sysconfig/network HOSTNAME=rac1 # hostname rac1
Oracle11g RAC for Linux 实施手册
5
Rac 2 上同样执行
3.2 设置oracle用户
vi .bash_profile umask 022 export ORACLE_BASE=/oracle/oracle export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs export ORACLE_PATH=$ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/admin #export ORACLE_SID=rac2 export ORACLE_SID=rac1 export NLS_LANG=AMERICAN_AMERICA.zhs16gbk export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS" export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORA_CRS_HOME/bin export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export ORA_NLS10=$ORACLE_HOME/nls/data export LD_LIBRARY_PATH=$ORACLE_HOME/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export LD_ASSUME_KERNEL=2.4.19 # for RHEL AS 4 export CLASSPATH=$ORACLE_HOME/JRE export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export THREADS_FLAG=native export TEMP=/tmp
Oracle11g RAC for Linux 实施手册
6
export TMPDIR=/tmp if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
3.3 配置ASM服务
3.3.1安装asm包 rpm -Uvh oracleasm-2.6.9-42.ELsmp-2.0.3-1.i686.rpm oracleasmlib-2.0.2-1.i386.rpm oracleasm-support-2.0.3-1.i386.rpm 安装asm包一定要和系统的内核相对应
3.3.2 配置asm服务
cd /etc/init.d/ [root@localhost 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 without typing an answer will keep that current value. Ctrl-C will abort. Default user to own the driver interface []: oracle Default group to own the driver interface []: dba Start Oracle ASM library driver on boot (y/n) [n]: y Fix permissions of Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: [ OK ] Creating /dev/oracleasm mount point: [ OK ] Loading module "oracleasm": [ OK ] Mounting ASMlib driver filesystem: [ OK ] Scanning system for ASM disks: [ OK ]
Oracle11g RAC for Linux 实施手册
7
3.4 建立ssh等效性(在oracle用户操作)
3.4.1 建立相关目录生成密钥和公钥 su - oracle mkdir -p ~/.ssh chmod 755 ~/.ssh [oracle@rac1 ~]$ /usr/bin/ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/oracle/oracle//.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /oracle/oracle//.ssh/id_rsa. Your public key has been saved in /oracle/oracle//.ssh/id_rsa.pub. The key fingerprint is: 16:2b:45:27:24:ee:97:46:5e:72:43:f1:9f:df:4b:dd [oracle@rac1 ~]$ /usr/bin/ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/oracle/oracle//.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /oracle/oracle//.ssh/id_dsa. Your public key has been saved in /oracle/oracle//.ssh/id_dsa.pub. The key fingerprint is: 0a:d5:e7:6a:a1:11:de:e4:72:74:fc:5f:b2:63:5b:6b 同等在RAC2上建立公钥和私钥 3.4.2 建立等效密钥 在第一个主机上,以 oracle 用户身份登录 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys cp ~/.ssh/authorized_keys ~/.ssh/rac1.authorized_keys 第二台主机上,以oracle用户登录 cat ~/.ssh/id_ >> ~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys cp ~/.ssh/authorized_keys ~/.ssh/rac2.authorized_keys 相互交换公钥
scp ~/.ssh/rac1.authorized_keys :
scp ~/.ssh/rac2.authorized_keys :
Oracle11g RAC for Linux 实施手册
8
RAC2 上执行: cat rac1.authorized_keys >> ~/.ssh/authorized_keys RAC1上执行: cat rac2.authorized_keys >> ~/.ssh/authorized_keys 建立等效性(每台机器都执行) ssh rac1 ssh rac2 ssh racp1 ssh racp2 exec /usr/bin/ssh-agent $SHELL /usr/bin/ssh-add
四 配置共享磁盘
4.1 建立ISCSI的共享磁盘
4.1.1 编译iscsi-target的源包 mkdir –p /usr/src/iscsi-target wget rpmbuild --rebuild iscsitarget-0.4.12-6.src.rpm rpm -Uvh iscsitarget-kernel-smp-0.4.12-6_2.6.9_42.EL.i386.rpm iscsitarget-0.4.12-6.i386.rpm 4.1.2 建立分区 fdisk /dev/sda 生成:/dev/sda8 fdisk /dev/sdb 生成:/dev/sdb1 4.1.3 配置共享盘 ISCSI服务端配置: vi /etc/ietd.conf 注释掉所有的其他 Target iqn.2000-12.com.digicola:storage.lun1 IncomingUser gfs secretsecret OutgoingUser Lun 0 Path=/dev/sdb1,Type=fileio Alias iDISK0 #MaxConnections 6 Target iqn.2000-12.com.digicola:storage.lun2
Oracle11g RAC for Linux 实施手册
9
IncomingUser gfs secretsecret OutgoingUser Lun 0 Path=/dev/sda8,Type=fileio Alias iDISK1 #MaxConnections 6 启动服务:service iscsi-target restart 加入开机启动:chkconfig –level 2345 iscsi-target on Iscsi客户端配置: vi /etc/iscsi.conf DiscoveryAddress=192.168.1.156 OutgoingUserName=gfs OutgoingPassword=secretsecret LoginTimeout=15 DiscoveryAddress=192.168.1.15 启动服务:service iscis restart 加入开机启动:chkconfig –level 2345 iscsi on 检查:iscsi共享磁盘: [root@rac1 ~]# iscsi-ls ******************************************************************************* SFNet iSCSI Driver Version ...4:0.1.11-3(02-May-2006) ******************************************************************************* TARGET NAME : iqn.2000-12.com.digicola:storage.lun2 TARGET ALIAS : HOST ID : 1 BUS ID : 0 TARGET ID : 0 TARGET ADDRESS : 192.168.1.156:3260,1 SESSION STATUS : ESTABLISHED AT Thu Oct 25 23:14:52 CST 2007 SESSION ID : ISID 00023d000001 TSIH 400 注:在从启系统时要注意iscsi-target服务和iscsi服务的启动顺序。先启动iscsi-target 在启动iscsi ,在/etc/rc3.d 下修改S后的数值,值约小启动级别越高
4.2 建立共享分区列表(一个节点操作即可)
分区信息 大小 /dev/sdc1 200M /dev/sdc2 200M /dev/sdc3 200M /dev/sdc5 200M /dev/sdc6 200M /dev/sdc7 12000M
Oracle11g RAC for Linux 实施手册
10
/dev/sdd1 2000M /dev/sdd2 1000M /dev/sdd3 1000M /dev/sdd5 2600M
4.3 建立raw设备
vi /etc/sysconfig/rawdevices /dev/raw/raw1 /dev/sdc1 /dev/raw/raw2 /dev/sdc2 /dev/raw/raw3 /dev/sdc3 /dev/raw/raw4 /dev/sdc5 /dev/raw/raw5 /dev/sdc6 启动服务:sevice rawdevices restart 开机启动:chkconfig –level 2345 rawdevices on
4.4 开机授权
vi /etc/rc.local chown –R oracle.oinstall /dev/raw/raw* chmod +755 /dev/raw/raw*
4.5建立asm磁盘卷组
4.5.1 建立asm卷组(单机执行) service oracleasm createdisk FLASH /dev/sdd1 service oracleasm createdisk ARCH1 /dev/sdd2 service oracleasm createdisk ARCH2 /dev/sdd3 service oracleasm createdisk DATA /dev/sdd5 4.5.2 扫描asm卷组 service oracleasm scandisks 4.5.3 显示asm卷组 service oracleasm listdisks
Oracle11g RAC for Linux 实施手册

阅读(5007) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~