這次安裝RAC真是坎坷略多啊。。。。。
安裝一個RAC,前提工作
添加網卡:串連方式host-only
配置ip:
node1
eth0:192.168.0.2
eth1:192.168.1.3
vip:192.168.0.10
node2
eth0:192.168.0.3
eth1:192.168.1.4
vip:192.168.0.20
配置/etc/hosts
127.0.0.1localhost
192.168.0.2rac1rac1-public
192.168.1.3rac1-priv
192.168.0.10rac1-vip
192.168.0.3rac2rac2-public
192.168.1.3rac2-priv
192.168.0.20rac2-vip
192.168.0.254rac-scan
加使用者組:
groupadd-g1000oinstall
groupadd-g1200asmadmin
groupadd-g1201asmdba
groupadd-g1202asmoper
groupadd-g1300dba
groupadd-g1301oper
useradd-m-u1100-goinstall-Gasmadmin,asmdba,asmoper,dba-d/home/gridgrid
useradd-m-u1101-goinstall-Gdba,oper,asmdba-d/home/oracleoracle
gpasswd-agriddba
gpasswd-agriddba
idoracle
idgrid
passwdoracle
passwdgrid
mkdir-p/u01/app/grid/11.2.0
mkdir-p/u01/grid
chown-Rgrid:oinstall/u01
mkdir-R/u01/app/oracle/11.2.0/db_1
mkdir-p/u01/app/oracle/11.2.0/db_1
chown-Roracle:oinstall/u01
chmod-R775/u01/
--兩個節點要一樣
配ssh互信
切換到oracle使用者
/usr/bin/ssh-keygen-trsa
/usr/bin/ssh-keygen-tdsa
注意:在兩個節點都要執行
執行完就在/home/oracle/.ssh/下面有兩個檔案
id_dsa.pubid_rsa.pub
兩個節點上都有
然後把一個節點上的這兩個檔案發到另外一個節點上
scpid_dsa.pubrac2:/home/oracle/.ssh/id_dsa.pub2
scpid_rsa.pubrac2:/home/oracle/.ssh/id_rsa.pub2
這時在節點2上有四個檔案
catid_rsa.pubid_rsa.pub2id_dsa.pubid_dsa.pub2>authorized_keys
產生authorized_keys檔案
然後把這個檔案傳到另外節點上
scpauthorized_keysrac1:/home/oracle/.ssh/
開始測試:
sshrac1privdate
sshrac1date
sshrac2privdate
sshrac2date
配環境變數:
node2_grid:
#exportORACLE_SID=+ASM1
exportORACLE_SID=+ASM2
exportORACLE_BASE=/u01/grid
exportORACLE_HOME=/u01/app/grid/11.2.0
exportPATH=$ORACLE_HOME/bin:$PATH:.
exportTEMP=/tmp
exportTMP=/tmp
exportTMPDIR=/tmp
umask022
oracle:
#exportORACLE_SID=rac1
exportORACLE_SID=rac2
exportORACLE_UNQNAME=rac
exportORACLE_BASE=/u01/app/oracle
exportORACLE_HOME=/u01/app/oracle/11.2.0/db_1
exportORACLE_TERM=xterm
exportNLS_DATE_FORMAT="YYYY-MM-DDHH24:MI:SS"
exportPATH=${PATH}:$ORACLE_HOME/bin:.
exportTEMP=/tmp
exportTMP=/tmp
umask022
node1_grid:
exportORACLE_SID=+ASM1
#exportORACLE_SID=+ASM2
exportORACLE_BASE=/u01/grid
exportORACLE_HOME=/u01/app/grid/11.2.0
exportPATH=$ORACLE_HOME/bin:$PATH:.
exportTEMP=/tmp
exportTMP=/tmp
exportTMPDIR=/tmp
umask022
oracle:
exportORACLE_SID=rac1
#exportORACLE_SID=rac2
exportORACLE_UNQNAME=rac
exportORACLE_BASE=/u01/app/oracle
exportORACLE_HOME=/u01/app/oracle/11.2.0/db_1
exportORACLE_TERM=xterm
exportNLS_DATE_FORMAT="YYYY-MM-DDHH24:MI:SS"
exportPATH=${PATH}:$ORACLE_HOME/bin:.
exportTEMP=/tmp
exportTMP=/tmp
umask022
配共用磁碟:
先建立共用磁碟:
vmware-vdiskmanager.exe-c-s5120MB-alsilogic-t2“d:\sharedisk\sharedisk01.vmdk”
vmware-vdiskmanager.exe-c-s5120MB-alsilogic-t2“d:\sharedisk\sharedisk02.vmdk”
vmware-vdiskmanager.exe-c-s5120MB-alsilogic-t2“d:\sharedisk\sharedisk03.vmdk”
vmware-vdiskmanager.exe-c-s5120MB-alsilogic-t2“d:\sharedisk\sharedisk04.vmdk”
vmware-vdiskmanager.exe-c-s5120MB-alsilogic-t2“d:\sharedisk\sharedisk05.vmdk”
然後再把磁碟一個一個添加到兩個節點上
添加之後
開啟.vmx
添加:
disk.EnableUUID="TRUE"
diskLib.dataCacheMaxSize="0"
diskLib.dataCacheMaxReadAheadSize="0"
diskLib.dataCacheMinReadAheadSize="0"
diskLib.dataCachePageSize="4096"
diskLib.maxUnsyncedWrites="0"
disk.locking="FALSE"
scsi1:0.SharedBus="Virtual"
scsi1:1.SharedBus="Virtual"
scsi1:2.SharedBus="Virtual"
scsi1:3.SharedBus="Virtual"
scsi1:4.SharedBus="Virtual"
開啟虛擬機器
配置UDEV
我的是oraclelinux5.8
/sbin/scsi_id-g-u-s/block/sdb
/sbin/scsi_id-g-u-s/block/sdc
/sbin/scsi_id-g-u-s/block/sdd
/sbin/scsi_id-g-u-s/block/sde
/sbin/scsi_id-g-u-s/block/sdf
然後添加99-oracle-asmdevices.rules
/etc/udev/rules.d/99-oracle-asmdevices.rules
內容:
KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="36000c29732fadfd3ff9fa212d1de2e2e",NAME="asm-diskb",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="36000c29e184787560400153bb251c16f",NAME="asm-diskc",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="36000c29a1a5b2e2a3962ab90b3aa25ee",NAME="asm-diskd",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="36000c295d404bac8bb9c00f8f7d60a32",NAME="asm-diske",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="sd*",BUS=="scsi",PROGRAM=="/sbin/scsi_id-g-u-s%p",RESULT=="36000c2961f7aca1c95c4224f761666e7",NAME="asm-diskf",OWNER="grid",GROUP="asmadmin",MODE="0660"
在一個節點上配置好之後傳遞到另一個節點
scp99-oracle-asmdevices.rulesrac2:/etc/udev/rules.d/
重啟udev
/sbin/start_udev
然後執行
ll/dev/asm*
就可以看到了。。。。。
這個弄了兩天,,,,
如果系統是oraclelinux5版本的,99-oracle-asmdevices.rules這個檔案裡面的內容一定要和上面的一樣。。。。。。否則找不到asm磁碟
接著安裝grid
本文出自 “千色” 部落格,謝絕轉載!