Oracle 11gR2 2node RAC on VMWare Workstation 8Part 8.docx
《Oracle 11gR2 2node RAC on VMWare Workstation 8Part 8.docx》由会员分享,可在线阅读,更多相关《Oracle 11gR2 2node RAC on VMWare Workstation 8Part 8.docx(10页珍藏版)》请在冰豆网上搜索。
Oracle11gR22nodeRAConVMWareWorkstation8Part8
Oracle11gR22-nodeRAConVMWareWorkstation8–Part VIII
PostedonOctober27,2012byoraclejedi•PostedinHacking,Linux,RAC,VMware•Taggedlinux,oracle,rac,redhat,shareddisk,vmware,workstation•8Comments
TimeRequired:
60minutes
ClassMaterials:
∙5GBofdiskspace
∙anASCIItexteditor
NextwearegoingtoaddsomeshareddisktoournewfreshlymintedVMs
VMWareWorkstationmakestheallocationofshareddisktoVMsverysimple.ShareddiskhasbeenthebiggestobstacletocreateOracleRACclustersathome,butnowVMWaregivesusareliableandportablesolutionthatdoesnotrequirefire-wirehacks,yourownNFSserveroraSCSIdiskarray.
Bestofallthiswholesolutioncanexistonasinglelaptop,soyoucantakeyourRAContheroad.
MakesurebothVMsareshutdown.Ifyouwanttomakeacloneofyourprogressthennowisyourlastchancetodosowithoutthecomplicationofsharedexternaldisk.
WewilladdanewdisktoOrpheusfirst,andthenaddthesamediskintoEurydice.
UsingtheVMWareWorkstationmenu,rightclickonOrpheusandselectSettings.
ThiswillbringuptheVirtualMachineSettingsmenu.ClickontheAddbutton.
AttheAddHardwareWizardmenu,selectHardDiskandclickNext.
SelectCreateanewvirtualdiskandclickNext.
WhentheSelectaDiskTypemenuappears,selectSCSI(Recommended)andformodecheckIndepenentandtheradiobuttonPersistent.
WhentheSpecifyDiskCapacitymenuappear,setthenewdisksizeat5GB.ThisshouldbejustenoughtosupportourdemoRACdatabase.Ifyouhaveanabundanceofdiskspacethenbyallmeanssetthedisksizemuchlarger.
ChecktheAllalldiskspacenow.buttonandStorevirtualdiskasasinglefile
NOTE:
TheselasttwooptionsareveryimportantforourRAC.TryingtocreateashareddiskwithVMWareWorkstationusingthin-provisioningwillresultindiskcorruption.
NextVMWareWorkstationwillaskwhereyouwanttostoreyournewdiskandwhatyouwanttocallit.BydefaultitwillwanttoplacethevirtualdiskinthesamedirectoryastherestoftheOrpheusVM.Howeverthisnewdiskistobeshared,soIprefertoplaceitinaseparatedirectory.
VMWareWorkstationstoresitsVMsbydefaultintheuser’sDocumentsdirectoryunderasub-directorycalledVirtualMachines.Inthisdirectoryyouwillfindsub-directoriesforbothourVMsOrpheusandEurydice.Isuggestcreatinganewsub-directoryherecalledSharedDiskandstoringournewvirtualdiskintheSharedDiskdirectorywiththenameasmdisk1.vmdk.
VMWarewillaskyouconfirmyourselection.PressFinishtoconfirm.
NowweneedtomoveournewdisktoadifferentvirtualSCSIdevicewithintheVM.Inordertoavoidallmannerofclusterdiskissues,weneedtoplacetheshareddisksonadifferentSCSIcontrollertothelocaldisks.
HighlighttheOrpheusVMintheVMWareWorkstationmenuandselectSettings.WhentheVirtualMachineSettingsmenuappears,highlightHardDisk2andselecttheAdvancedbuttonontherighthandside.
TheHardDiskAdvancedSettingsmenuallowstomodifytheVirtualdevicenode.BydefaultthiswillbesettoSCSI0:
1,butweneedtochangethistoSCSI1:
0.ThiswillmoveournewdisktoSCSIcontroller1,device0.
Nextwewillhavetoresorttoalittlehackingtomakeourshareddiskreallysharable.WearenowleveragingVMfunctionalitythatisnotreallysupportedinVMWareWorkstation8,butdoesappeartowork,atleastfordemopurposes.
NavigatetothedirectorywheretheOrpheusVMfilesarestored,inmostcasesthiswillbeDocuments/VirtualMachines/Orpheus.InthereyouwillfindafilecalledOrpehus.vmx
TheVMXfilecontainsthehardwareprofileoftheVMswehavecreated.Beforewedoanythingelse,makeacopyofitsowehavesomethingtogobacktoifwemakeamess.
OpentheVMXfilewithanASCIIeditor.MakesureyouhaveaneditorabletoopenandsaveinASCIIformat.WordProcessorsareapoorchoicehereastheyaremorelikelytoaddsymbolsthatwillcorruptthefile.
TheVMXfileisaunsortedmess.WhyVMWaredoesn’tperformasimplesortonthefilebeforesavingittodiskisamystery.Stillatleastitisn’tsomegiganticXMLmonstrosity.Irecommendthatifyoureditorallowsit,youperformasortontheentirefileandsaveitbacktodiskbeforemakinganychanges.
Thisiswherethemagichappens,andIhavetoacknowledgeitwasDanNorriswhofiguredthisout,notme.Inordertomakeournewdiskfullyclusterable,wearegoingtoaddthefollowingdirectivestotheVMXfile:
disk.locking="FALSE"
diskLib.dataCacheMaxSize="0"
diskLib.dataCacheMaxReadAheadSize="0"
diskLib.dataCacheMinReadAheadSize="0"
diskLib.dataCachePageSize="4096"
diskLib.maxUnsyncedWrites="0"
scsi1.sharedBus="virtual"
ThesechangesforcetheVMstonottrytobufferreadsandwritestothedisk,whichwouldresultinblockcorruptiontotheshareddatabase.ThenewdirectivescanbeaddedanywhereintheVMXfile,althoughItendtoaddthemimmediatelyabovetheSCSIsettings.
Thefollowingisasub-sectiontakenfromtheVMXfileofmyOrpheusVM.Ihavenotdumpedtheentirefileforthesakeofclarity.
replay.supported="FALSE"
disk.locking="FALSE"
diskLib.dataCacheMaxSize="0"
diskLib.dataCacheMaxReadAheadSize="0"
diskLib.dataCacheMinReadAheadSize="0"
diskLib.dataCachePageSize="4096"
diskLib.maxUnsyncedWrites="0"
scsi1.sharedBus="virtual"
scsi0.pciSlotNumber="16"
scsi0.present="TRUE"
scsi0.virtualDev="lsilogic"
scsi0:
0.fileName="localdisk1-cl2.vmdk"
scsi0:
0.present="TRUE"
scsi0:
0.redo=""
scsi0:
1.present="FALSE"
scsi1.present="TRUE"
scsi1.virtualDev="lsilogic"
scsi1:
0.fileName="C:
\Users\thorng1.CORP\Documents\VirtualMachines\SharedDisk\asmdisk1.vmdk"
scsi1:
0.mode="independent-persistent"
scsi1:
0.present="TRUE"
serial0.fileType="thinprint"
serial0.present="TRUE"
sound.autodetect="TRUE"
NownavigatetotheVMXfileforEurydiceandaddthesamedirectivesfordiskLibandscsi1.YoudoNOTneedtousetheVMWareinterfacetomakethesechanges.EditingtheVMXfiledirectlyisthebetteroption.
ThefollowingistakenfromtheVMXfileofmyEurydiceVM.AgainIhavenotdumpedtheentirefileforthesakeofclarity.AsyoucanseeitshouldmatchOrpheusexactly.
replay.supported="FALSE"
disk.locking="FALSE"
diskLib.dataCacheMaxSize="0"
diskLib.dataCacheMaxReadAheadSize="0"
diskLib.dataCacheMinReadAheadSize="0"
diskLib.dataCachePageSize="4096"
diskLib.maxUnsyncedWrites="0"
scsi1.sharedBus="virtual"
scsi0.pciSlotNumber="16"
scsi0.present="TRUE"
scsi0.virtualDev="lsilogic"
scsi0:
0.fileName="localdisk1-cl2.vmdk"
scsi0:
0.present="TRUE"
scsi0:
0.redo=""
scsi1.present="TRUE"
scsi1.virtualDev="lsilogic"
scsi1:
0.fileName="C:
\Users\thorng1.CORP\Documents\VirtualMachines\SharedDisk\asmdisk1.vmdk"
scsi1:
0.mode="independent-persistent"
scsi1:
0.present="TRUE"
serial0.fileType="thinprint"
serial0.present="TRUE"
sound.autodetect="TRUE"
NowyoucanstartupbothOrpheusandEurydice.Asyoudoso,youmightnoticeasmallwarninginthebottomrighthandcorneroftheVMWarewindowthatstates:
ClusteringisnotsupportedforWMwareWorkstation–thissettingwillbeignored
Don’tworryaboutthis.Thisisexpectedbehavior.
WhenOrpheusisfullbootedup,weshouldbeabletocreateapartitiontableonthenewshareddisk,whichwillbepresentedtoLinuxas/dev/sdb.
Inthefollowingexamplewecreateapartitionatthe1MBoffset.
[root@orpheus~]#fdisk/dev/sdb
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwon'tberecoverable.
Warning:
invalidflag0x0000ofpartitiontable4willbecorrectedbyw(rite)
Command(mforhelp):
u
Changingdisplay/entryunitstosectors
Command(mforhelp):
n
Commandaction
eextended
pprimarypartition(1-4)
p
Partitionnumber(1-4):
1
Firstsector(63-10485759,default63):
2048
Lastsectoror+sizeor+sizeMor+sizeK(2048-10485759,default10485759):
Usingdefaultvalue10485759
Command(mforhelp):
w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
Okaycool.Wehavecreatedapartitiononthenewshareddisk.NowwecanstampitforusebyASMbyusingtheASMLibweinstalledbackinPartV.
[root@orpheus~]#oracleasmcreatediskDATA/dev/sdb1
Writingdiskheader:
done
Instantiatingdisk:
done
Toverifytheoperationworkedasexpected,wecanlisttheASMdisksasfollows:
[root@orpheus~]#oracleasmlistdisks
DATA
NowweneedtoseeifthechangeswejustdidarevisibletoEurydice.LogintoEurydiceasrootandstartthefdiskcommand.Nowifwelistthepartitiontableweshouldseethatonealreadyexists,aswejustcreateditonOrpheus.
[root@eurydice~]#fdisk/dev/sdb
Thenumberofcylindersforthisdiskissetto1448.
Thereisnothingwrongwiththat,butthisislargerthan1024,
andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)
2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
Command(mforhelp):
p
Disk/dev/sdb:
5368MB,5368709120bytes
181heads,40sectors/track,1448cylinders
Units=cylindersof7240*512=3706880bytes
DeviceBootStartEndBlocksIdSystem
/dev/sdb111449524185683Linux
Command(mforhelp):
w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
Note:
Itisimportanttore-writethepartitionhead