ORACLE存储结构文档格式.docx

上传人:b****3 文档编号:6304594 上传时间:2023-05-06 格式:DOCX 页数:16 大小:44.27KB
下载 相关 举报
ORACLE存储结构文档格式.docx_第1页
第1页 / 共16页
ORACLE存储结构文档格式.docx_第2页
第2页 / 共16页
ORACLE存储结构文档格式.docx_第3页
第3页 / 共16页
ORACLE存储结构文档格式.docx_第4页
第4页 / 共16页
ORACLE存储结构文档格式.docx_第5页
第5页 / 共16页
ORACLE存储结构文档格式.docx_第6页
第6页 / 共16页
ORACLE存储结构文档格式.docx_第7页
第7页 / 共16页
ORACLE存储结构文档格式.docx_第8页
第8页 / 共16页
ORACLE存储结构文档格式.docx_第9页
第9页 / 共16页
ORACLE存储结构文档格式.docx_第10页
第10页 / 共16页
ORACLE存储结构文档格式.docx_第11页
第11页 / 共16页
ORACLE存储结构文档格式.docx_第12页
第12页 / 共16页
ORACLE存储结构文档格式.docx_第13页
第13页 / 共16页
ORACLE存储结构文档格式.docx_第14页
第14页 / 共16页
ORACLE存储结构文档格式.docx_第15页
第15页 / 共16页
ORACLE存储结构文档格式.docx_第16页
第16页 / 共16页
亲,该文档总共16页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

ORACLE存储结构文档格式.docx

《ORACLE存储结构文档格式.docx》由会员分享,可在线阅读,更多相关《ORACLE存储结构文档格式.docx(16页珍藏版)》请在冰点文库上搜索。

ORACLE存储结构文档格式.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-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2