Chinaunix首页 | 论坛 | 博客
  • 博客访问: 54482
  • 博文数量: 10
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 197
  • 用 户 组: 普通用户
  • 注册时间: 2013-03-05 13:38
个人简介

事在人为

文章分类

全部博文(10)

文章存档

2014年(2)

2013年(8)

我的朋友

分类: Oracle

2013-03-05 13:48:40





RAC规划


系统:linux5.4

Oracle10.2.0.1

VM装2个网卡

 

/etc/hosts        
192.168.245.139  rac1
        
192.168.245.140  rac2
        
10.0.0.1   rac1-priv
        
10.0.0.2   rac2-priv
 
192.168.245.111  rac1-vip

192.168.245.113 rac2-vip

Rac2的虚拟机可以用rac1的复制文件

Vm创建虚拟存储:









ocr:100M

vot:100M

ASM盘:20G*2

VM安装目录下运行



vmware-vdiskmanager.exe -c -s 120MB -a
lsilogic -t 2 "D:\Virtual Machines\sharedisks"\ocr.vmdk

vmware-vdiskmanager.exe -c -s 120MB -a
lsilogic -t 2 "D:\Virtual Machines\sharedisks"\vot.vmdk

vmware-vdiskmanager.exe -c -s 10G -a
lsilogic -t 2 "D:\Virtual Machines\rac\sharedisks"\asm1.vmdk

vmware-vdiskmanager.exe -c -s 10G -a
lsilogic -t 2 "D:\Virtual Machines\rac\sharedisks"\asm2.vmdk

把一下文件放入虚拟机文件的参数内(*.VMX文件)



disk.locking = "false"

diskLib.dataCacheMaxSize = "0"

scsi1.present = "TRUE"

scsi1.virtualDev = "lsilogic"

scsi1:5.present = "TRUE"

scsi1:5.fileName = "D:\Virtual
Machines\rac\sharedisks\ocr.vmdk"
scsi1:6.present = "TRUE"

scsi1:6.fileName = "D:\VirtualMachines\rac\sharedisks\asm1.vmdk"

scsi1:4.present = "TRUE"

scsi1:4.fileName = "D:\VirtualMachines\rac\sharedisks\asm2.vmdk"

scsi1:9.present = "TRUE"
scsi1:9.fileName = "D:\Virtual Machines\rac\sharedisks\vot.vmdk"





安装linux





配置YUM

安装响应的包:

compat-db*

gcc-*glib*

lib*

pdksh*

 创建用户组:

groupadd –g 700 dba

useradd –u 500 –g dba oracle

配置环境变量:

oracle用户下.bash_profile

export ORACLE_BASE=/oracle

export ORACLE_HOME=/oracle/product/10.2.0/db_1

export CRS_HOME=/oracle/product/10.2.0/crs

export ORACLE_SID=ractest

export PATH=$CRS_HOME/bin:$ORACLE_HOME/bin:$PATH



在不同节点上ORACLE_SID不同







设置用户资源限制:



/etc/security/limits.conf





oracle soft memlock 5242880



oracle hard memlock 5242880



oracle soft nofile 65536



oracle hard nofile 65536



oracle soft nproc 2047



oracle hard nproc 16384



ulimit 
-a



设置内核参数:



/etc/sysctl.conf



kernel.shmmax=2147483648



kernel.sem = 250 32000 100 128



fs.file-max=65536



net.ipv4.ip_local_port_range = 1024 65000



net.core.rmem_default = 262144



net.core.rmem_max = 262144



net.core.wmem_default = 262144



net.core.wmem_max = 262144



sysctl –p



配置SSH用户等价:



Oracle用户下:



Rac1+rac2运行如下:



mkdir .ssh



chmod 700 .ssh



cd .ssh



ssh-keygen –t rsa



ssh-keygen –t dsa





cat *.pub >
authorized_keys









rac1:scp
authorized_keys rac2:/home/oracle/.ssh/rac1_keys





rac2:cat 
rac1_keys >> authorized_keys





rac2:cat  authorized_keys  rac1:/home/oracle/.ssh





在每个节点运行ssh



Ssh rac1 date



Ssh rac2 date



Ssh rac1-priv  date ……





节点自己也要SSH一下自己











配置时间同步



rac1ntp服务器



rac1Vi /etc/ntp.conf



server 127.127.1.0 (注意不是127.0.0.1



fudge 127.127.1.0 stratum 11



driftfile /var/lib/ntp/drift



broadcastdelay 0.008



编辑RAC2 /etc/ntp.conf



Server 192.168.245.140 prefer



Driftfile / /var/lib/ntp/drift



broadcastdelay 0.008



启动服务:



/etc/init.d/ntpd start







配置HANGCHECK-TIMER模块





vi /etc/modprobe.conf



options
hangcheck-timer hangcheck_tick=30 hangcheck_margin=180



设置hangcheck内核模块开机加载



vi /etc/rc.d/rc.local



/sbin/modprobe
hangcheck-timer



要立即加载模块,执行:



modprobe -v
hangcheck-timer







配置裸设备



划分共享磁盘空间



Fdisk /dev/sdb(略)



方法一:vi  /etc/sysconfig rawdevices



         
添加:/dev/raw/raw1 dev/sdb1



                /dev/raw/raw2dev/sdc2



               ……………………………………..



启动:service rawdevices restart



Cd /dev/raw



权限必须ORACLE:DBA



Chown oracle:dba /raw*



启动自动赋权限



VI /etc/rc.local



chown oracle:dba /dev/raw/raw1



chown oracle:dba /dev/raw/raw2



chown oracle:dba /dev/raw/raw3



chown oracle:dba /dev/raw/raw4



方法2



Vi /etc/udev/rules.d/60-60-raw.rules



ACTION=="add",
KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"



ACTION=="add",
KERNEL=="sdc2", RUN+="/bin/raw /dev/raw/raw2 %N"



ACTION=="add", KERNEL=="sdd3",
RUN+="/bin/raw /dev/raw/raw3%N"



ACTION=="add", KERNEL=="sde4",
RUN+="/bin/raw /dev/raw/raw4%N"



KERNEL=="raw[1-4]*",OWNER="oracle",GROUP="dba",MODE="640





Start_udev启动服务





创建ASM



需安装oracleasmlib



Asm配置



/etc/init.d/oracleasm configure



输入用户和组



创建ASM设备:



/etc/init.d/oracleasm createdisk
ocr/dev/sdb1



/etc/init.d/oracleasm createdisk
vot/dev/sdc2



/etc/init.d/oracleasm createdisk
asm1/dev/sdd3



/etc/init.d/oracleasm createdisk
asm2/dev/sde4



rac2上运行:



/etc/init.d/oracleasm scandisk



查看2个节点上/dev/raw下裸设备是否都有





安装ORACLE CLUSTERVARE



最后步会报错说VIP不对,在另外个节点上修改$CRS_HOME/bin/vipca



注释掉LINUX下有关的内容



ROOT用户运行VIPCA



完成vipca配置。



crsctl check crs查看CRS存活情况





crs_stat –t –v  查看CRS各服务应用的情况。







安装oracle



配置监听:



创建ASM实例



Mount ASM



创建ORACLE实例





安装完成。



阅读(1264) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:oracle tablespace常用sql

给主人留下些什么吧!~~