Oracle Database 11g Release 2 RAC On Oracle Linux 5.docx
《Oracle Database 11g Release 2 RAC On Oracle Linux 5.docx》由会员分享,可在线阅读,更多相关《Oracle Database 11g Release 2 RAC On Oracle Linux 5.docx(45页珍藏版)》请在冰豆网上搜索。
![Oracle Database 11g Release 2 RAC On Oracle Linux 5.docx](https://file1.bdocx.com/fileroot1/2022-12/16/1dbc3403-4d39-42f3-89d1-be56df9a7053/1dbc3403-4d39-42f3-89d1-be56df9a70531.gif)
OracleDatabase11gRelease2RACOnOracleLinux5
OracleDatabase11gRelease2RACOnOracleLinux5.8UsingVirtualBox
ThisarticledescribestheinstallationofOracleDatabase11grelease2(11.264-bit)RAConOracleLinux(5.864-bit)usingVirtualBox(4.2.6)withnoadditionalshareddiskdevices.
Note.I'vepurposelyleftthisasan11.2.0.1installationasthisversionisdownloadablefrom OTN withouttheneedforaMyOracleSupport(MOS)CSI.Theprocessworksjustaswellfor11.2.0.3,whichyoucandownloadfromMOS.
∙Introduction
∙DownloadSoftware
∙VirtualBoxInstallation
∙VirtualMachineSetup
∙GuestOperatingSystemInstallation
∙OracleInstallationPrerequisites
oAutomaticSetup
oManualSetup
oAdditionalSetup
∙InstallGuestAdditions
∙CreateSharedDisks
∙ClonetheVirtualMachine
∙InstalltheGridInfrastructure
∙InstalltheDatabase
∙ChecktheStatusoftheRAC
Relatedarticles.
∙OracleDatabase11gRelease2(11.2.0.3.0)RACOnOracleLinux6.3UsingVirtualBox
∙OracleDatabase11gRelease2RACOnWindows2008UsingVirtualBox
Introduction
OneofthebiggestobstaclespreventingpeoplefromsettinguptestRACenvironmentsistherequirementforsharedstorage.Inaproductionenvironment,sharedstorageisoftenprovidedbyaSANorhigh-endNASdevice,butbothoftheseoptionsareveryexpensivewhenallyouwanttodoisgetsomeexperienceinstallingandusingRAC.AcheaperalternativeistouseaFireWirediskenclosuretoallowtwomachinestoaccessthesamedisk(s),butthatstillcostsmoneyandrequirestwoservers.Athirdoptionistousevirtualizationtofakethesharedstorage.
UsingVirtualBoxyoucanrunmultipleVirtualMachines(VMs)onasingleserver,allowingyoutorunbothRACnodesonasinglemachine.Inaddition,itallowsyoutosetupsharedvirtualdisks,overcomingtheobstacleofexpensivesharedstorage.
Beforeyoulaunchintothisinstallation,hereareafewthingstoconsider.
∙Thefinishedsystemincludesthehostoperatingsystem,twoguestoperatingsystems,twosetsofOracleGridInfrastructure(Clusterware+ASM)andtwoDatabaseinstancesallonasingleserver.Asyoucanimagine,thisrequiresasignificantamountofdiskspace,CPUandmemory.
∙Followingonfromthelastpoint,theVMswilleachneedatleast2GofRAM(3Gfor11.2.0.2onward),preferably4Gifyoudon'twanttheVMstoswaplikecrazy.Asyoucansee,11gR2RACrequiresmuchmorememorythan11gR1RAC.Don'tassumeyouwillbeabletorunthisonasmallPCorlaptop.Youwon't.
∙ThisprocedureprovidesabarebonesinstallationtogettheRACworking.ThereisnoredundancyintheGridInfrastructureinstallationortheASMinstallation.Toaddthis,simplycreatedoubletheamountofshareddisksandselectthe"Normal"redundancyoptionwhenitisoffered.Ofcourse,thiswilltakemorediskspace.
∙Duringthevirtualdiskcreation,Ialwayschoosenottopreallocatethediskspace.Thismakesvirtualdiskaccessslowerduringtheinstallation,butsavesonwasteddiskspace.Theshareddisksmusthavetheirspacepreallocated.
∙Thisisnot,andshouldnotbeconsidered,aproduction-readysystem.It'ssimplytoallowyoutogetusedtoinstallingandusingRAC.
∙TheSingleClientAccessName(SCAN)shouldreallybedefinedintheDNSorGNSandround-robinbetweenoneof3addresses,whichareonthesamesubnetasthepublicandvirtualIPs.InthisarticleI'vedefineditasasingleIPaddressinthe"/etc/hosts"file,whichiswrongandwillcausetheclusterverificationtofail,butitallowsmetocompletetheinstallwithoutthepresenceofaDNS.Thisapproachwillnotworkifyouareusing11.2.0.2onwardandyoumustusetheDNS.
∙Thevirtualmachinescanbelimitedto2Gigofswap,whichcausesaprerequisitecheckfailure,butdoesn'tpreventtheinstallationworking.Ifyouwanttoavoidthis,define3+Gigofswap.
∙Thisarticleusesthe64-bitversionsofOracleLinuxandOracle11gRelease2.
DownloadSoftware
Downloadthefollowingsoftware.
∙OracleLinux5.8
∙VirtualBox
∙Oracle11gRelease2(11.2)Software(64bit)
VirtualBoxInstallation
First,installtheVirtualBoxsoftware.OnRHELanditsclonesyoudothiswiththefollowingtypeofcommandastherootuser.
#rpm-UvhVirtualBox-4.2-4.2.6_82870_fedora17-1.x86_64.rpm
Oncecomplete,VirtualBoxisstartedfromthe"Applications>SystemTools>OracleVMVirtualBox"menuoption.
VirtualMachineSetup
NowwemustdefinethetwovirtualRACnodes.WecansavetimebydefiningoneVM,thencloningitwhenitisinstalled.
StartVirtualBoxandclickthe"New"buttononthetoolbar.Enterthename"ol5-112-rac1",OS"Linux"andVersion"Oracle(64bit)",thenclickthe"Next"button.
Enter"4096"asthebasememorysize,thenclickthe"Next"button.
Acceptthedefaultoptiontocreateanewvirtualharddiskbyclickingthe"Create"button.
Accceptthedefaultharddrivefiletypebyclickingthe"Next"button.
Accceptthe"Dynamicallyallocated"optionbyclickingthe"Next"button.
Acceptthedefaultlocationandsetthesizeto"30G",thenclickthe"Create"button.Ifyoucanspreadthevirtualdisksontodifferentphysicaldisks,thatwillimproveperformance.
The"ol5-112-rac1"VMwillappearonthelefthandpane.Scrolldownthe"Details"tabontherightandclickonthe"Network"link.
Makesure"Adapter1"isenabled,setto"BridgedAdapter",thenclickonthe"Adapter2"tab.
Makesure"Adapter2"isenabled,setto"BridgedAdapter"or"InternalNetwork",thenclickonthe"System"section.
Move"HardDisk"tothetopofthebootorderanduncheckthe"Floppy"option,thenclickthe"OK"button.
Thevirtualmachineisnowconfiguredsowecanstarttheguestoperatingsysteminstallation.
GuestOperatingSystemInstallation
WiththenewVMhighlighted,clickthe"Start"buttononthetoolbar.Onthe"Selectstart-updisk"screen,choosetherelevantOracleLinuxISOimageandclickthe"Start"button.
TheresultingconsolewindowwillcontaintheOracleLinuxbootscreen.
ContinuethroughtheOracleLinux5installationasyouwouldforabasicserver.Ageneralpictorialguidetotheinstallationcanbefound here.Morespecifically,itshouldbeaserverinstallationwithaminimumof4G+swap,firewalldisabled,SELinuxsettopermissiveandthefollowingpackagegroupsinstalled:
∙DesktopEnvironments>GNOMEDesktopEnvironment
∙Applications>Editors
∙Applications>GraphicalInternet
∙Development>DevelopmentLibraries
∙Development>DevelopmentTools
∙Servers>ServerConfigurationTools
∙BaseSystem>AdministrationTools
∙BaseSystem>Base
∙BaseSystem>SystemTools
∙BaseSystem>XWindowSystem
Tobeconsistentwiththerestofthearticle,thefollowinginformationshouldbesetduringtheinstallation:
∙hostname:
ol5-112-rac1.localdomain
∙IPAddresseth0:
192.168.0.101(publicaddress)
∙DefaultGatewayeth0:
192.168.0.1(publicaddress)
∙IPAddresseth1:
192.168.1.101(privateaddress)
∙DefaultGatewayeth1:
none
YouarefreetochangetheIPaddressestosuityournetwork,butremembertostayconsistentwiththoseadjustmentsthroughouttherestofthearticle.
OracleInstallationPrerequisites
PerformeithertheAutomaticSetuportheManualSetuptocompletethebasicprerequisites.TheAdditionalSetupisrequiredforallinstallations.
AutomaticSetup
Ifyouplantousethe"oracle-validated"packagetoperformallyourprerequisitesetup,followtheinstructionsat http:
//public- tosetuptheyumrepositoryforOL,thenperformthefollowingcommand.
#yuminstalloracle-validated
Allnecessaryprerequisiteswillbeperformedautomatically.
Itisprobablyworthdoingafullupdateaswell,butthisisnotstrictlyspeakingnecessary.
#yumupdate
ManualSetup
Ifyouhavenotusedthe"oracle-validated"packagetoperformallprerequisites,youwillneedtomanuallyperformthefollowingsetuptasks.
InadditiontothebasicOSinstallation,thefollowingpackagesmustbeinstalledwhilstloggedinastherootuser.Thisincludesthe64-bitand32-bitversionsofsomepackages.
#FromOracleLinux5DVD
cd/media/cdrom/Server
rpm-Uvhbinutils-2.*
rpm-Uvhcompat-libstdc++-33*
rpm-Uvhelfutils-libelf-0.*
rpm-Uvhelfutils-libelf-devel-*
rpm-Uvhgcc-4.*
rpm-Uvhgcc-c++-4.*
rpm-Uvhglibc-2.*
rpm-Uvhglibc-common-2.*
rpm-Uvhglibc-devel-2.*
rpm-Uvhglibc-headers-2.*
rpm-Uvhksh-2*
rpm-Uvhlibaio-0.*
rpm-Uvhlibaio-devel-0.*
rpm-Uvhlibgcc-4.*
rpm-Uvhlibstdc++-4.*
rpm-Uvhlibstdc++-devel-4.*
rpm-Uvhmake-3.*
rpm-Uvhsysstat-7.*
rpm-UvhunixODBC-2.*
rpm-UvhunixODBC-devel-2.*
cd/
eject
Addoramendthefollowinglinestothe"/etc/sysctl.conf"file.
fs.aio-max-nr=1048576
fs.file-max=6815744
kernel.shmall=2097152
kernel.shmmax=1054504960
kernel.shmmni=4096
#semaphores:
semmsl,semmns,semopm,semmni
kernel.sem=25032000100128
net.ipv4.ip_local_port_range=900065500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
Runthefollowingcommandtochangethecurrentkernelparameters.
/sbin/sysctl-p
Addthefollowinglinestothe"/etc/security/limits.conf"file.
oraclesoftnproc2047
oraclehardnproc16384
oraclesoftnofile1024
oraclehardnofile65536
Addthefollowinglinestothe"/etc/pam.d/login"file,ifitdoesnotalreadyexist.
sessionrequiredpam_limits.so
Createthenewgroupsandusers.
groupadd-g1000oinstall
groupadd-g1200dba
useradd-u1100-goinstall-Gdbaoracle
passwdoracle
CreatethedirectoriesinwhichtheOraclesoftwarewillbeinstalled.
mkdir-p/u01/app/11.2.0/grid
mkdir-p/u01/app/oracle/product/11.2.0/db_1
chown