Memory Configuration and Use.docx
- 文档编号:4736432
- 上传时间:2023-05-07
- 格式:DOCX
- 页数:79
- 大小:65.63KB
Memory Configuration and Use.docx
《Memory Configuration and Use.docx》由会员分享,可在线阅读,更多相关《Memory Configuration and Use.docx(79页珍藏版)》请在冰点文库上搜索。
MemoryConfigurationandUse
MemoryConfigurationandUse
ThischapterexplainshowtoallocatememorytoOraclememorycaches,andhowtousethosecaches.PropersizingandeffectiveuseoftheOraclememorycachesgreatlyimprovesdatabaseperformance.
OraclerecommendsautomaticmemoryconfigurationforyoursystemusingtheSGA_TARGETandPGA_AGGREGATE_TARGETinitializationparameters.However,youcanmanuallyadjustthememorypoolsonyoursystemandthatprocessisprovidedinthischapter.
Thischaptercontainsthefollowingsections:
∙UnderstandingMemoryAllocationIssues
∙ConfiguringandUsingtheBufferCache
∙ConfiguringandUsingtheSharedPoolandLargePool
∙ConfiguringandUsingtheRedoLogBuffer
∙PGAMemoryManagement
SeeAlso:
OracleDatabaseConceptsforinformationonthememoryarchitectureofanOracledatabase
UnderstandingMemoryAllocationIssues
Oraclestoresinformationinmemorycachesandondisk.Memoryaccessismuchfasterthandiskaccess.Diskaccess(physicalI/O)takeasignificantamountoftime,comparedwithmemoryaccess,typicallyintheorderof10milliseconds.PhysicalI/OalsoincreasestheCPUresourcesrequired,becauseofthepathlengthindevicedriversandoperatingsystemeventschedulers.Forthisreason,itismoreefficientfordatarequestsforfrequentlyaccessedobjectstobesatisfiedsolelybymemory,ratherthanalsorequiringdiskaccess.
AperformancegoalistoreducethephysicalI/Ooverheadasmuchaspossible,eitherbymakingitmorelikelythattherequireddataisinmemoryorbymakingtheprocessofretrievingtherequireddatamoreefficient.
Oraclestronglyrecommendstheuseofautomaticmemorymanagement.Beforesettinganymemorypoolsizes,reviewthefollowing:
∙"AutomaticSharedMemoryManagement"
∙"PGAMemoryManagement"
Ifyouneedtoconfigurememoryallocations,OracleEnterpriseManagerprovidestheMemoryAdvisorforupdates.ToaccesstheMemoryAdvisorthroughOracleEnterpriseManagerDatabaseControl:
∙ClicktheAdvisorCentrallinkunderRelatedLinksatthebottomoftheDatabasepages.
∙OntheAdvisorCentralpage,youcanclicktheMemoryAdvisorlinktoaccesstheMemoryParametersSGAandPGApages.
OracleMemoryCaches
ThemainOraclememorycachesthataffectperformanceare:
∙Sharedpool
∙Largepool
∙Javapool
∙Buffercache
∙Streamspoolsize
∙Logbuffer
∙Process-privatememory,suchasmemoryusedforsortingandhashjoins
AutomaticSharedMemoryManagement
AutomaticSharedMemoryManagementsimplifiestheconfigurationoftheSGAandistherecommendedmemoryconfiguration.TouseAutomaticSharedMemoryManagement,settheSGA_TARGETinitializationparametertoanonzerovalueandsettheSTATISTICS_LEVELinitializationparametertoTYPICALorALL.ThevalueoftheSGA_TARGETparametershouldbesettotheamountofmemorythatyouwanttodedicatefortheSGA.Inresponsetotheworkloadonthesystem,theautomaticSGAmanagementdistributesthememoryappropriatelyforthefollowingmemorypools:
∙Databasebuffercache(defaultpool)
∙Sharedpool
∙Largepool
∙Javapool
Iftheseautomaticallytunedmemorypoolshadbeensettononzerovalues,thosevaluesareusedasaminimumlevelsbyAutomaticSharedMemoryManagement.Youwouldsetminimumvaluesifanapplicationcomponentsneedsaminimumamountofmemorytofunctionproperly.
SGA_TARGETisadynamicparameterandcanbechangedthroughOracleEnterpriseManagerorwiththeALTERSYSTEMcommand.SGA_TARGETcanbesetlessthanorequaltothevalueofSGA_MAX_SIZEinitializationparameter.ChangesinthevalueofSGA_TARGETautomaticallyresizetheautomaticallytunedmemorypools.
SeeAlso:
∙OracleDatabaseConceptsforinformationautomaticSGAmanagement
∙OracleDatabaseAdministrator'sGuideforinformationonmanagingtheSystemGlobalArea(SGA)
IfyousetSGA_TARGETto0,AutomaticSharedMemoryManagementisdisabledandyoucanmanuallysizethememorypoolswiththeDB_CACHE_SIZE,SHARED_POOL_SIZE,LARGE_POOL_SIZE,andJAVA_POOL_SIZEinitializationparameters.See"DynamicallyChangingCacheSizes".
ThefollowingpoolsaremanuallysizedcomponentsandarenotaffectedbyAutomaticSharedMemoryManagement:
∙Logbuffer
∙Otherbuffercaches,suchasKEEP,RECYCLE,andotherblocksizes
∙Streamspool
∙FixedSGAandotherinternalallocations
Tomanuallysizethesememorypools,youneedtosettheDB_KEEP_CACHE_SIZE,DB_RECYCLE_CACHE_SIZE,DB_nK_CACHE_SIZE,STREAMS_POOL_SIZE,andLOG_BUFFERinitializationparameters.ThememoryallocatedtothesepoolsisdeductedfromthetotalavailableforSGA_TARGETwhenAutomaticSharedMemoryManagementcomputesthevaluesoftheautomaticallytunedmemorypools.
SeeAlso:
∙OracleDatabaseAdministrator'sGuideforinformationonmanaginginitializationparameters
∙OracleStreamsConceptsandAdministrationforinformationaboutconfiguringtheSTREAMS_POOL_SIZEinitializationparameter
∙OracleDatabaseJavaDeveloper'sGuideforinformationonJavamemoryusage
DynamicallyChangingCacheSizes
IfthesystemisnotusingAutomaticSharedMemoryManagement,youcanchoosetodynamicallyreconfigurethesizesofthesharedpool,thelargepool,thebuffercache,andtheprocess-privatememory.Thefollowingsectionscontaindetailsonsizingofcaches:
∙ConfiguringandUsingtheBufferCache
∙ConfiguringandUsingtheSharedPoolandLargePool
∙ConfiguringandUsingtheRedoLogBuffer
Thesizeofthesememorycachesisconfigurableusinginitializationconfigurationparameters,suchasDB_CACHE_ADVICE,JAVA_POOL_SIZE,LARGE_POOL_SIZE,LOG_BUFFER,andSHARED_POOL_SIZE.ThevaluesfortheseparametersarealsodynamicallyconfigurableusingtheALTERSYSTEMstatementexceptforthelogbufferpoolandprocess-privatememory,whicharestaticafterstartup.
Memoryforthesharedpool,largepool,javapool,andbuffercacheisallocatedinunitsofgranules.Thegranulesizeis4MBiftheSGAsizeislessthan1GB.IftheSGAsizeisgreaterthan1GB,thegranulesizechangesto16MB.Thegranulesizeiscalculatedandfixedwhentheinstancestartsup.Thesizedoesnotchangeduringthelifetimeoftheinstance.
ThegranulesizethatiscurrentlybeingusedforSGAcanbeviewedintheviewV$SGA_DYNAMIC_COMPONENTS.ThesamegranulesizeisusedforalldynamiccomponentsintheSGA.
YoucanexpandthetotalSGAsizetoavalueequaltotheSGA_MAX_SIZEparameter.IftheSGA_MAX_SIZEisnotset,youcandecreasethesizeofonecacheandreallocatethatmemorytoanothercacheifnecessary.SGA_MAX_SIZEdefaultstotheaggregatesettingofallthecomponents.
Note:
SGA_MAX_SIZEcannotbedynamicallyresized.
ThemaximumamountofmemoryusablebytheinstanceisdeterminedatinstancestartupbytheinitializationparameterSGA_MAX_SIZE.YoucanspecifySGA_MAX_SIZEtobelargerthanthesumofallofthememorycomponents,suchasbuffercacheandsharedpool.Otherwise,SGA_MAX_SIZEdefaultstotheactualsizeusedbythosecomponents.SettingSGA_MAX_SIZElargerthanthesumofmemoryusedbyallofthecomponentsletsyoudynamicallyincreaseacachesizewithoutneedingtodecreasethesizeofanothercache.
SeeAlso:
Youroperatingsystem'sdocumentationforinformationonmanagingdynamicSGA.
ViewingInformationAboutDynamicResizeOperations
ThefollowingviewsprovideinformationaboutdynamicSGAresizeoperations:
∙V$SGA_CURRENT_RESIZE_OPS:
InformationaboutSGAresizeoperationsthatarecurrentlyinprogress.AnoperationcanbeagroworashrinkofadynamicSGAcomponent.
∙V$SGA_RESIZE_OPS:
Informationaboutthelast400completedSGAresizeoperations.Thisdoesnotincludeanyoperationscurrentlyinprogress.
∙V$SGA_DYNAMIC_COMPONENTS:
InformationaboutthedynamiccomponentsinSGA.ThisviewsummarizesinformationbasedonallcompletedSGAresizeoperationssincestartup.
∙V$SGA_DYNAMIC_FREE_MEMORY:
InformationabouttheamountofSGAmemoryavailableforfuturedynamicSGAresizeoperations.
SeeAlso:
∙OracleDatabaseConceptsformoreinformationaboutdynamicSGA
∙OracleDatabaseReferencefordetailedcolumninformationfortheseviews
ApplicationConsiderations
Withmemoryconfiguration,itisimportanttosizethecacheappropriatelyfortheapplication'sneeds.Conversely,tuningtheapplication'suseofthecachescangreatlyreduceresourcerequirements.EfficientuseoftheOraclememorycachesalsoreducestheloadonrelatedresources,suchasthelatchesthatprotectthecaches,theCPU,andtheI/Osystem.
Forbestperformance,youshouldconsiderthefollowing:
∙Thecacheshouldbeoptimallydesignedtousetheoperatingsystemanddatabaseresourcesmostefficiently.
∙MemoryallocationstoOraclememorystructuresshouldbestreflecttheneedsoftheapplication.
MakingchangesoradditionstoanexistingapplicationmightrequireresizingOraclememorystructurestomeettheneedsofyourmodifiedapplication.
IfyourapplicationusesJava,youshouldinvestigatewhetheryouneedtomodifythedefaultconfigurationfortheJavapool.SeetheOracleDatabaseJavaDeveloper'sGuideforinformationonJavamemoryusage.
OperatingSystemMemoryUse
Formostoperatingsystems,itisimportanttoconsiderthefollowing:
Reducepaging
Pagingoccurswhenanoperatingsystemtransfersmemory-residentpagestodisksolelytoallownewpagestobeloadedintomemory.Manyoperatingsystemspagetoaccommodatelargeamountsofinformationthatdonotfitintorealmemory.Onmostoperatingsystems,pagingreducesperformance.
Usetheoperatingsystemutilitiestoexaminetheoperatingsystem,toidentifywhetherthereisalotofpagingonyoursystem.Ifthereis,thenthetotalmemoryonthesystemmightnotbelargeen
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Memory Configuration and Use