linux_ora10g_rac_listener.ora+tnsnames.ora

wangzhensheng發表於2010-12-18

windows + VMWARE +oracle 10G rac +asm
1.安裝vmware:
建立共享磁碟:scsi1:1
rac.vmx中增加
disk.locking="FALSE"
scsi1:sharedBus="VIRTUAL"

設定/etc/udev/rules.d/60-raw.rules
增加
ACTION=="add",KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add",KERNEL=="sdc2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add",KERNEL=="raw[1-2]", OWNER="oracle", GROUP="dba", MODE="660"

/etc/sysconfig/rawdevices 增加
/dev/raw/raw1 /dev/sdc1
/dev/raw/raw2 /dev/sdc2

.安裝clusterware
安裝libXp-*.rpm
vi /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.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144

========================================================
初始化orc,votedisk
cd $CRS_HOME/install/
./rootdelete.sh
./rootdeinstall.sh

dd if=/dev/zero of=/dev/raw/raw1 bs=1M count=101
dd if=/dev/zero of=/dev/raw/raw2 bs=1M count=101

cd $CRS_HOME/
./root.sh
其他節點也需要執行
cd $CRS_HOME/
./root.sh

新增介面配置:一個節點上配置
oifcfg getif
oifcfg setif -global eth0/10.142.132.0:public
oifcfg setif -global eth1/10.10.10.0:cluster_interconnect

========================
crs_profile -create lisenter1 -t application -a /export/home/oracle/products/10.2/crs_1/bin/racgwrap -h rac1 -p restricted -r ora.rac1.vip -o ci=600,ra=6,ft=0,fi=0,as=1,st=600,ra=6
echo "register:rac1"
crs_register ora.rac1.vip
crs_register ora.rac1.gsd
crs_register ora.rac1.ons
crs_register ora.rac1.LISTENER_RAC1.lsnr
echo ""
echo "register:rac2"
crs_register ora.rac2.vip
crs_register ora.rac2.gsd
crs_register ora.rac2.ons
crs_register ora.rac2.LISTENER_RAC2.lsnr
echo ""
echo "unregister:rac1"
crs_unregister ora.rac1.gsd
crs_unregister ora.rac1.LISTENER_RAC1.lsnr
crs_unregister ora.rac1.ons
crs_unregister ora.rac1.vip
echo ""
echo "unregister:rac2"
crs_unregister ora.rac2.gsd
crs_unregister ora.rac2.LISTENER_RAC2.lsnr
crs_unregister ora.rac2.ons
crs_unregister ora.rac2.vip
==============================
修改/tmp/.oracle,/var/tmp/.oracle目錄許可權成777,oracle.dba
chown -R oracle.dba /tmp/.oracle
chmod -R 777 /tmp/.oracle

chown -R oracle.dba /var/tmp/.oracle
chmod -R 777 /var/tmp/.oracle

crs_stat -ls

crs_setperm ora.rac1.ons -g dba
crs_setperm ora.rac1.ons -o oracle
crs_setperm ora.rac1.gsd -g dba
crs_setperm ora.rac1.gsd -o oracle
crs_setperm ora.rac1.LISTENER_RAC1.lsnr -g dba
crs_setperm ora.rac1.LISTENER_RAC1.lsnr -o oracle
--------------------------
crs_setperm ora.rac2.ons -g dba
crs_setperm ora.rac2.ons -o oracle
crs_setperm ora.rac2.gsd -g dba
crs_setperm ora.rac2.gsd -o oracle
crs_setperm ora.rac2.LISTENER_RAC2.lsnr -g dba
crs_setperm ora.rac2.LISTENER_RAC2.lsnr -o oracle

================================
echo "============================"
echo ""
echo "start:rac1"
crs_start -f ora.rac1.vip
crs_start -f ora.rac1.gsd
crs_start -f ora.rac1.ons
crs_start -f ora.rac1.LISTENER_RAC1.lsnr
crs_start -f ora.rac1.ASM1.asm
crs_start -f ora.ECOM.ECOM1.inst

echo ""
echo "start:rac2"
crs_start -f ora.rac2.vip
crs_start -f ora.rac2.gsd
crs_start -f ora.rac2.ons
crs_start -f ora.rac2.LISTENER_RAC2.lsnr
crs_start -f ora.rac2.ASM2.asm
crs_start -f ora.ECOM.ECOM2.inst

echo ""
echo "stop:rac1"
crs_stop -f ora.rac1.gsd
crs_stop -f ora.rac1.LISTENER_RAC1.lsnr
crs_stop -f ora.rac1.ons
crs_stop -f ora.rac1.vip
echo ""
echo "stop:rac2"
crs_stop -f ora.rac2.gsd
crs_stop -f ora.rac2.LISTENER_RAC2.lsnr
crs_stop -f ora.rac2.ons
crs_stop -f ora.rac2.vip

==========================
echo "define SRVM_TRACE env"
export SRVM_TRACE=TRUE

echo "undefine SRVM_TRACE env"
export SRVM_TRACE=

# add nodeapps rac1
srvctl stop nodeapps -n rac1
srvctl remove nodeapps -n rac1 -f
# 需要清理/export/home/oracle/products/10.2/crs_1/crs/profile下的*.cap檔案
srvctl add nodeapps -n rac1 -o $ORACLE_HOME -A 10.142.132.210/255.255.255.0/eth0
srvctl start nodeapps -n rac1

srvctl stop nodeapps -n rac2
srvctl remove nodeapps -n rac2 -f
# 需要清理/export/home/oracle/products/10.2/crs_1/crs/profile下的*.cap檔案
srvctl add nodeapps -n rac2 -o $ORACLE_HOME -A 10.142.132.211/255.255.255.0/eth0
srvctl start nodeapps -n rac2

# add asm
su - oracle
srvctl add asm -n rac1 -i ASM1 -o $ORACLE_HOME
crs_start ora.rac1.ASM1.asm

srvctl add asm -n rac2 -i ASM2 -o $ORACLE_HOME
crs_start ora.rac2.ASM2.asm

# add database
srvctl add database -d ECOM -o $ORACLE_HOME
srvctl remove database -d ECOM

# add instance
srvctl add instance -d ECOM -i ECOM2 -n rac2
crs_start ora.ECOM.ECOM2.inst
srvctl remove instance -d ECOM -i ECOM2

srvctl add instance -d ECOM -i ECOM1 -n rac1
crs_start ora.ECOM.ECOM1.inst
srvctl remove instance -d ECOM -i ECOM1

#檢查
srvctl config database -d ECOM

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8806316/viewspace-1043245/,如需轉載,請註明出處,否則將追究法律責任。