ORACLE存储结构Word文件下载.docx

上传人:b****3 文档编号:17783044 上传时间:2022-12-10 格式:DOCX 页数:12 大小:44.34KB
下载 相关 举报
ORACLE存储结构Word文件下载.docx_第1页
第1页 / 共12页
ORACLE存储结构Word文件下载.docx_第2页
第2页 / 共12页
ORACLE存储结构Word文件下载.docx_第3页
第3页 / 共12页
ORACLE存储结构Word文件下载.docx_第4页
第4页 / 共12页
ORACLE存储结构Word文件下载.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

ORACLE存储结构Word文件下载.docx

《ORACLE存储结构Word文件下载.docx》由会员分享,可在线阅读,更多相关《ORACLE存储结构Word文件下载.docx(12页珍藏版)》请在冰豆网上搜索。

ORACLE存储结构Word文件下载.docx

IntroductiontoOracleMemoryStructures

Oracleusesmemorytostoreinformationsuchasthefollowing:

∙Programcodebeingexecuted

∙Informationaboutaconnectedsession,evenifitisnotcurrentlyactive

∙Informationneededduringprogramexecution(forexample,thecurrentstateofaqueryfromwhichrowsarebeingfetched)

∙InformationthatissharedandcommunicatedamongOracleprocesses(forexample,lockinginformation)

∙Cacheddatathatisalsopermanentlystoredonperipheralmemory(forexample,datablocksandredologentries)

ThebasicmemorystructuresassociatedwithOracleinclude:

∙SoftwareCodeAreas

∙SystemGlobalArea(SGA):

oThedatabasebuffercache

oTheredologbuffer

oThesharedpool

∙ProgramGlobalAreas(PGA):

oThestackareas

oThedataareas

SystemGlobalArea(SGA)

Asystemglobalarea(SGA)isagroupofsharedmemorystructuresthatcontaindataandcontrolinformationforoneOracledatabaseinstance.Ifmultipleusersareconcurrentlyconnectedtothesameinstance,thenthedataintheinstance'

sSGAissharedamongtheusers.Consequently,theSGAissometimesreferredtoasthesharedglobalarea.

AnSGAandOracleprocessesconstituteanOracleinstance.OracleautomaticallyallocatesmemoryforanSGAwhenyoustartaninstanceandtheoperatingsystemreclaimsthememorywhenyoushutdowntheinstance.EachinstancehasitsownSGA.

TheSGAisread-write;

allusersconnectedtoamultiple-processdatabaseinstancemayreadinformationcontainedwithintheinstance'

sSGA,andseveralprocesseswritetotheSGAduringexecutionofOracle.

TheSGAcontainsthefollowingdatastructures:

∙Thedatabasebuffercache

∙Theredologbuffer

∙Thesharedpool

∙Thelargepool(optional)

∙Thedatadictionarycache

∙Othermiscellaneousinformation

PartoftheSGAcontainsgeneralinformationaboutthestateofthedatabaseandtheinstance,whichthebackgroundprocessesneedtoaccess;

thisiscalledthefixedSGA.Nouserdataisstoredhere.TheSGAalsoincludesinformationcommunicatedbetweenprocesses,suchaslockinginformation.

Ifthesystemusesmulti-threadedserverarchitecture,thentherequestandresponsequeuesandsomecontentsoftheprogramglobalareas,areintheSGA.

TheDatabaseBufferCache

ThedatabasebuffercacheistheportionoftheSGAthatholdscopiesofdatablocksreadfromdatafiles.Alluserprocessesconcurrentlyconnectedtotheinstanceshareaccesstothedatabasebuffercache.

ThedatabasebuffercacheandthesharedSQLcachearelogicallysegmentedintomultiplesets.Thisorganizationintomultiplesetsreducescontentiononmultiprocessorsystems.

OrganizationoftheDatabaseBufferCache

Thebuffersinthecacheareorganizedintwolists:

thewritelistandtheleastrecentlyused(LRU)list.Thewritelistholdsdirtybuffers,whichcontaindatathathasbeenmodifiedbuthasnotyetbeenwrittentodisk.Theleastrecentlyused(LRU)listholdsfreebuffers,pinnedbuffers,anddirtybuffersthathavenotyetbeenmovedtothewritelist.Freebuffersdonotcontainanyusefuldataandareavailableforuse.Pinnedbuffersarecurrentlybeingaccessed.

WhenanOracleprocessaccessesabuffer,theprocessmovesthebuffertothemostrecentlyused(MRU)endoftheLRUlist.AsmorebuffersarecontinuallymovedtotheMRUendoftheLRUlist,dirtybuffersagetowardstheLRUendoftheLRUlist.

ThefirsttimeanOracleuserprocessrequiresaparticularpieceofdata,itsearchesforthedatainthedatabasebuffercache.Iftheprocessfindsthedataalreadyinthecache(acachehit),itcanreadthedatadirectlyfrommemory.Iftheprocesscannotfindthedatainthecache(acachemiss),itmustcopythedatablockfromadatafileondiskintoabufferinthecachebeforeaccessingthedata.Accessingdatathroughacachehitisfasterthandataaccessthroughacachemiss.

Beforereadingadatablockintothecache,theprocessmustfirstfindafreebuffer.TheprocesssearchestheLRUlist,startingattheleastrecentlyusedendofthelist.Theprocesssearcheseitheruntilitfindsafreebufferoruntilithassearchedthethresholdlimitofbuffers.

IftheuserprocessfindsadirtybufferasitsearchestheLRUlist,itmovesthatbuffertothewritelistandcontinuestosearch.Whentheprocessfindsafreebuffer,itreadsthedatablockfromdiskintothebufferandmovesthebuffertotheMRUendoftheLRUlist.

IfanOracleuserprocesssearchesthethresholdlimitofbufferswithoutfindingafreebuffer,theprocessstopssearchingtheLRUlistandsignalstheDBW0backgroundprocesstowritesomeofthedirtybufferstodisk.

TheLRUAlgorithmandFullTableScans

Whentheuserprocessisperformingafulltablescan,itreadstheblocksofthetableintobuffersandputsthemontheLRUend(insteadoftheMRUend)oftheLRUlist.Thisisbecauseafullyscannedtableusuallyisneededonlybriefly,sotheblocksshouldbemovedoutquicklytoleavemorefrequentlyusedblocksinthecache.

Youcancontrolthisdefaultbehaviorofblocksinvolvedintablescansonatable-by-tablebasis.TospecifythatblocksofthetablearetobeplacedattheMRUendofthelistduringafulltablescan,usetheCACHEclausewhencreatingoralteringatableorcluster.YoumaywanttospecifythisbehaviorforsmalllookuptablesorlargestatichistoricaltablestoavoidI/Oonsubsequentaccessesofthetable.

SizeoftheDatabaseBufferCache

TheinitializationparameterDB_BLOCK_BUFFERSspecifiesthenumberof 

buffersinthedatabasebuffercache.EachbufferinthecacheisthesizeofoneOracledatablock(whichisspecifiedbytheinitializationparameterDB_BLOCK_SIZE);

therefore,eachdatabasebufferinthecachecanholdasingledatablockreadfromadatafile.

Thecachehasalimitedsize,sonotallthedataondiskcanfitinthecache.Whenthecacheisfull,subsequentcachemissescauseOracletowritedirtydataalreadyinthecachetodisktomakeroomforthenewdata.(Ifabufferisnotdirty,itdoesnotneedtobewrittentodiskbeforeanewblockcanbereadintothebuffer.)Subsequentaccesstoanydatathatwaswrittentodiskresultsinadditionalcachemisses.

Thesizeofthecacheaffectsthelikelihoodthatarequestfordatawillresultinacachehit.Ifthecacheislarge,itismorelikelytocontainthedatathatisrequested.Increasingthesizeofacacheincreasesthepercentageofdatarequeststhatresultincachehits.

MultipleBufferPools

Youcanconfigurethedatabasebuffercachewithseparatebufferpoolsthateitherkeepdatainthebuffercacheormakethebuffersavailablefornewdataimmediatelyafterusingthedatablocks.Particularschemaobjects(tables,clusters,indexes,andpartitions)canthenbeassignedtotheappropriatebufferpooltocontrolthewaytheirdatablocksageoutofthecache.

∙TheKEEPbufferpoolretainstheschemaobject'

sdatablocksinmemory.

∙TheRECYCLEbufferpooleliminatesdatablocksfrommemoryassoonastheyarenolongerneeded.

∙TheDEFAULTbufferpoolcontainsdatablocksfromschemaobjectsthatarenotassignedtoanybufferpool,aswellasschemaobjectsthatareexplicitlyassignedtotheDEFAULTpool.

TheinitializationparametersthatconfiguretheKEEPandRECYCLEbufferpoolsareBUFFER_POOL_KEEPandBUFFER_POOL_RECYCLE.

TheRedoLogBuffer

TheredologbufferisacircularbufferintheSGAthatholdsinformationaboutchangesmadetothedatabase.Thisinformationisstoredinredoentries.Redoentriescontaintheinformationnecessarytoreconstruct,orredo,changesmadetothedatabasebyINSERT,UPDATE,DELETE,CREATE,ALTER,orDROPoperations.Redoentriesareusedfordatabaserecovery,ifnecessary.

RedoentriesarecopiedbyOracleserverprocessesfromtheuser'

smemoryspacetotheredologbufferintheSGA.Theredoentriestakeupcontinuous,sequentialspaceinthebuffer.ThebackgroundprocessLGWRwritestheredologbuffertotheactiveonlineredologfile(orgroupoffiles)ondisk.

TheinitializationparameterLOG_BUFFERdeterminesthesize(inbytes)oftheredologbuffer.Ingeneral,largervaluesreducelogfileI/O,particularlyiftransactionsarelongornumerous.Thedefaultsettingisfourtimesthemaximumdatablocksizeforthehostoperatingsystem.

TheSharedPool

ThesharedpoolportionoftheSGAcontainsthreemajorareas:

librarycache,dictionary 

cache,andcontrolstructures.Figure 

7-1showsthecontentsofthesharedpool.

ThetotalsizeofthesharedpoolisdeterminedbytheinitializationparameterSHARED_POOL_SIZE.Thedefaultvalueofthisparameteris3,500,000bytes.Increasingthevalueofthisparameterincreasestheamountofmemoryreservedforthesharedpool,andthereforeincreasesthespacereservedforsharedSQLareas.

Figure7-1ContentsoftheSharedPool

LibraryCache

ThelibrarycacheincludesthesharedSQLareas,privateSQLareas,PL/SQLproceduresandpackages,andcontrolstructuressuchaslocksandlibrarycachehandles.

SharedSQLareasmustbeavailabletomultipleusers,sothelibrarycacheiscontainedinthesharedpoolwithintheSGA.Thesizeofthelibrarycache(alongwiththesizeofthedatadictionarycache)islimitedbythesizeofthesharedpool.

SharedSQLAreasandPrivateSQLAreas

OraclerepresentseachSQLstatementitexecuteswithasharedSQLareaandaprivateSQLarea.OraclerecognizeswhentwousersareexecutingthesameSQLstatementandreusesthesharedSQLareaforthoseusers.However,eachusermus

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 成人教育 > 自考

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1