#!/bin/sh -x # @(#) agentoppsett:oracletjeneste version1.0 /etc/VRTSvcs/oracle_setup # # # # # # SRV="abc" Maskin1="vxcluster1" Maskin2="vxcluster2" DG="oraDG" Device="hme0" cluster_IP="10.102.65.156" OracleSID="NDB" cluster_NM="255.255.248.0" #make mount-points: #mkdir -p /progs/$SRV /data/$SRV #Oppretter tjenesten/ha-gruppa haconf -makerw hagrp -add $SRV hagrp -modify $SRV SystemList $Maskin1 1 $Maskin2 2 hagrp -autoenable $SRV -sys $Maskin1 #Lager ressurser: # Nettverk: ressurstypene NIC og IP ###Singel-Interface: ###hares -add ${SRV}_NIC NIC $SRV ###hares -modify ${SRV}_NIC Enabled 1 ###hares -modify ${SRV}_NIC Device $Device ### ###Singel-Interface: ###hares -add ${SRV}_IP IP $SRV ###hares -modify ${SRV}_IP Enabled 1 ###hares -modify ${SRV}_IP Device $Device ###hares -modify ${SRV}_IP Address $cluster_IP ###hares -modify ${SRV}_IP NetMask $cluster_NM ###hares -modify ${SRV}_IP IfconfigTwice 1 #--------------------------------------------------------- hares -add ${SRV}IPMultiNIC IPMultiNIC $SRV hares -modify ${SRV}IPMultiNIC Address $cluster_IP hares -modify ${SRV}IPMultiNIC NetMask $cluster_NM hares -modify ${SRV}IPMultiNIC IfconfigTwice 1 hares -modify ${SRV}IPMultiNIC MultiNICResName ${SRV}MultiNICA hares -modify ${SRV}IPMultiNIC Enabled 1 #--------------------------------------------------------- hares -add ${SRV}MultiNICA MultiNICA ${SRV} hares -local ${SRV}MultiNICA Device hares -modify ${SRV}MultiNICA NetMask $cluster_NM hares -modify ${SRV}MultiNICA ArpDelay 5 hares -modify ${SRV}MultiNICA IfconfigTwice 1 hares -modify ${SRV}MultiNICA Device hme0 10.102.65.151 qfe3 10.102.65.151 -sys vxcluster1 hares -modify ${SRV}MultiNICA Device hme0 10.102.65.152 qfe3 10.102.65.152 -sys vxcluster2 hares -modify ${SRV}MultiNICA Enabled 1 #--------------------------------------------------------- #Importerer Diskgruppe: (og starter ALLE volumes) hares -add ${SRV}_DG DiskGroup $SRV hares -modify ${SRV}_DG Enabled 1 hares -modify ${SRV}_DG DiskGroup $DG hares -modify ${SRV}_DG StartVolumes 1 #Monteringer: #Volumer som skal monteres: # progs_${SRV}: monteres paa /progs/${SRV} # data_${SRV} : monteres paa /data/${SRV} # ${SRV}_data001 : monteres paa /data/${SRV}/oracle/data001 # ${SRV}_data002 : monteres paa /data/${SRV}/oracle/data002 # ${SRV}_data003 : monteres paa /data/${SRV}/oracle/data003 # ${SRV}_index001 : monteres paa /data/${SRV}/oracle/index001 # ${SRV}_index002 : monteres paa /data/${SRV}/oracle/index002 # ${SRV}_index003 : monteres paa /data/${SRV}/oracle/index003 # ${SRV}_log001 : monteres paa /data/${SRV}/oracle/log001 # ${SRV}_log002 : monteres paa /data/${SRV}/oracle/log002 # ${SRV}_log003 : monteres paa /data/${SRV}/oracle/log003 # her: prog01 monteres paa /prog # d001 monteres paa /d0 # d101 monteres paa /d1 # d201 monteres paa /d2 # # call function: mount_resource mountpoint BlockDev fstyp # mount_resource () { MountPoint=$1 BlockDev=$2 FStyp=$3 Name=${SRV}_${BlockDev}_MOUNT hares -add $Name Mount ${SRV} hares -modify $Name Enabled 1 hares -modify $Name MountPoint $MountPoint hares -modify $Name BlockDevice /dev/vx/dsk/$DG/$BlockDev hares -modify $Name FSType $FStyp } # #mount_resource /progs/${SRV} progs_${SRV} vxfs #mount_resource /data/${SRV} data_${SRV} vxfs # #mount_resource /data/${SRV}/oracle/data001 data001 vxfs #mount_resource /data/${SRV}/oracle/data002 data002 vxfs #mount_resource /data/${SRV}/oracle/data003 data003 vxfs # #mount_resource /data/${SRV}/oracle/index001 index001 vxfs #mount_resource /data/${SRV}/oracle/index002 index002 vxfs #mount_resource /data/${SRV}/oracle/index003 index003 vxfs # #mount_resource /data/${SRV}/oracle/log001 log001 vxfs #mount_resource /data/${SRV}/oracle/log002 log002 vxfs #mount_resource /data/${SRV}/oracle/log003 log003 vxfs # mount_resource /prog prog01 vxfs mount_resource /d0 d001 vxfs mount_resource /d1 d101 vxfs mount_resource /d2 d201 vxfs #ORACLE: hares -add ${SRV}_Oracle Oracle ${SRV} hares -modify ${SRV}_Oracle Enabled 1 hares -modify ${SRV}_Oracle Sid $OracleSID hares -modify ${SRV}_Oracle Owner oracle hares -modify ${SRV}_Oracle Home /prog/${SRV}/oracle/product/7.3.4 hares -modify ${SRV}_Oracle \ Pfile /prog/${SRV}/oracle/product/7.3.4/dbs/initNDB.ora #Listener: (SQLnet) hares -add ${SRV}_Sqlnet Sqlnet ${SRV} hares -modify ${SRV}_Sqlnet Enabled 1 hares -modify ${SRV}_Sqlnet Owner oracle hares -modify ${SRV}_Sqlnet Home /prog/${SRV}/oracle/product/7.3.4 hares -modify ${SRV}_Sqlnet \ TnsAdmin /prog/${SRV}/oracle/product/7.3.4/network/admin hares -modify ${SRV}_Sqlnet Listener LISTENER #Links, avhengigheter #IP er avhengig av NIC: ##single# : hares -link ${SRV}_IP ${SRV}_NIC hares -link ${SRV}IPMultiNIC ${SRV}MultiNICA #Oracle er avhengig av IP (som er avhengig av NIC) ## single# : hares -link ${SRV}_Oracle ${SRV}_IP hares -link ${SRV}_Oracle ${SRV}IPMultiNIC #Listener (SQLnet) er avhengig av Oracle hares -link ${SRV}_Sqlnet ${SRV}_Oracle #Begge overliggende filsystemer er avhengig av Diskgruppa: #hares -link ${SRV}_progs_${SRV}_MOUNT ${SRV}_DG #hares -link ${SRV}_data_${SRV}_MOUNT ${SRV}_DG # Oracle er avhengig av progs-omraadet: #hares -link ${SRV}_Oracle ${SRV}_progs_${SRV}_MOUNT link_it () { #Oracle er avhengig av alle underliggende filsys (data/index/log) hares -link ${SRV}_Oracle ${SRV}_${1}_MOUNT # #Alle underliggende er avhengig av data_MOUNT: hares -link ${SRV}_${1}_MOUNT ${SRV}_data_${SRV}_MOUNT } #link_it data001 #link_it data002 #link_it data003 #link_it index001 #link_it index002 #link_it index003 #link_it log001 #link_it log002 #link_it log003 #sdata: hares -link ${SRV}_prog01_MOUNT ${SRV}_DG hares -link ${SRV}_d001_MOUNT ${SRV}_DG hares -link ${SRV}_d101_MOUNT ${SRV}_DG hares -link ${SRV}_d201_MOUNT ${SRV}_DG hares -link ${SRV}_Oracle ${SRV}_prog01_MOUNT hares -link ${SRV}_Oracle ${SRV}_d001_MOUNT hares -link ${SRV}_Oracle ${SRV}_d101_MOUNT hares -link ${SRV}_Oracle ${SRV}_d201_MOUNT #Make config readOnly again... haconf -dump -makero