Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
262 views

Oracle Architecture

An Oracle database consists of two main components - the instance and the database. The instance contains memory structures and background processes, while the database refers to disk resources like datafiles, redo logs, and control files. The memory structures include the system global area (SGA) and program global area (PGA). The SGA contains areas like the buffer cache, shared pool, and redo log buffer. The database is divided into logical structures like tablespaces, segments, extents and blocks that map to physical disk structures.

Uploaded by

vamcareer
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
262 views

Oracle Architecture

An Oracle database consists of two main components - the instance and the database. The instance contains memory structures and background processes, while the database refers to disk resources like datafiles, redo logs, and control files. The memory structures include the system global area (SGA) and program global area (PGA). The SGA contains areas like the buffer cache, shared pool, and redo log buffer. The database is divided into logical structures like tablespaces, segments, extents and blocks that map to physical disk structures.

Uploaded by

vamcareer
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

AsanOracleDBA,youmustunderstandtheconceptsofOraclearchitectureclearly.Itisabasicstepor mainpointthatyouneedbeforeyougotomanageyourdatabase.Bythisarticle,Iwilltrytosharemy knowledgeaboutit.Hopeitcanbeusefulforyou.

WhatisAnOracleDatabase?

Basically,therearetwomaincomponentsofOracledatabaseinstanceanddatabaseitself.Aninstance consistsofsomememorystructuresandthebackgroundprocesses,whereasadatabasereferstothedisk resources.Figure1willshowyoutherelationship.

Figure1.TwomaincomponentsofOracledatabase

Instance

Aswecoverabove,thememorystructuresandbackgroundprocessescontituteaninstance.Thememory structureitselfconsistsofSystemGlobalArea(SGA),ProgramGlobalArea(PGA),andanoptionalarea SoftwareAreaCode.Intheotherhand,themandatorybackgroundprocessesareDatabaseWriter (DBWn),LogWriter(LGWR),Checkpoint(CKPT),SystemMonitor(SMON),andProcessMonitor(PMON). AndanotheroptionalbackgroundprocessesareArchiver(ARCn),Recoverer(RECO),etc.Figure2will illustratetherelationshipforthosecomponentsonaninstance.

Figure2.Theinstancecomponents

SystemGlobalArea
SGAistheprimarymemorystructures.WhenOracleDBAstalkaboutmemory,theyusuallymeanthe SGA.ThisareaisbrokenintoafewofpartmemoryBufferCache,SharedPool,RedoLogBuffer,Large Pool,andJavaPool. BufferCache Buffercacheisusedtostoresthecopiesofdatablockthatretrievedfromdatafiles.Thatis,whenuser retrievesdatafromdatabase,thedatawillbestoredinbuffercache.Itssizecanbemanipulatedvia DB_CACHE_SIZEparameterininit.orainitializationparameterfile. SharedPool SharedpoolisbrokenintotwosmallpartmemoriesLibraryCacheandDictionaryCache.Thelibrary cacheisusedtostoresinformationaboutthecommonlyusedSQLandPL/SQLstatementsandis managedbyaLeastRecentlyUsed(LRU)algorithm.Itisalsoenablesthesharingthosestatemensamong users.Intheotherhand,dictionarycacheisusedtostoresinformationaboutobjectdefinitionsinthe database,suchascolumns,tables,indexes,users,privileges,etc. ThesharedpoolsizecanbesetviaSHARED_POOL_SIZEparameterininit.orainitializationparameterfile. RedoLogBuffer EachDMLstatement(insert,update,anddelete)executedbyuserswillgeneratestheredoentry.Whatis aredoentry?Itisaninformationaboutalldatachangesmadebyusers.Thatredoentryisstoredinredo logbufferbeforeitiswrittenintotheredologfiles.Tomanipulatethesizeofredologbuffer,youcanuse theLOG_BUFFERparameterininit.orainitializationparameterfile. LargePool LargepoolisanoptionalareaofmemoryintheSGA.Itisusedtorelievestheburdenplaceontheshared pool.ItisalsousedforI/Oprocesses.ThelargepoolsizecanbesetbyLARGE_POOL_SIZEparameterin init.orainitializationparameterfile. JavaPool

Asitsname,JavapoolisusedtoservicesparsingoftheJavacommands.Itssizecanbesetby JAVA_POOL_SIZEparameterininit.orainitializationparameterfile.

ProgramGlobalArea
AlthoughtheresultofSQLstatemenparsingisstoredinlibrarycache,butthevalueofbindingvariable willbestoredinPGA.Why?Becauseitmustbeprivateornotbesharedamongusers.ThePGAisalso usedforsortarea.

SoftwareAreaCode
SoftwareareacodeisalocationinmemorywheretheOracleapplicationsoftwareresides.

OracleBackgroundProcesses
Oraclebackgroundprocessesistheprocessesbehindthescenethatworktogetherwiththememories. DBWn Databasewriter(DBWn)processisusedtowritedatafrombuffercacheintothedatafiles.Historically,the databasewriterisnamedDBWR.ButsincesomeofOracleversionallowsustohavemorethanone databasewriter,thenameischangedtoDBWn,wherenvalueisanumber0to9. LGWR Logwriter(LGWR)processissimilartoDBWn.Itwritestheredoentriesfromredologbufferintotheredo logfiles. CKPT Checkpoint(CKPT)isaprocesstogiveasignaltoDBWntowritesdatainthebuffercacheintodatafiles.It willalsoupdatesdatafilesandcontrolfilesheaderwhenlogfileswitchoccurs. SMON SystemMonitor(SMON)processisusedtorecoverthesystemcrachorinstancefailurebyapplyingthe entriesintheredologfilestothedatafiles. PMON ProcessMonitor(PMON)processisusedtocleanupworkafterfailedprocessesbyrollingbackthe transactionsandreleasingotherresources.

Database

Thedatabasereferstodiskresources,andisbrokenintotwomainstructuresLogicalstructuresand Physicalstructures.

LogicalStructures
Oracledatabaseisdividedintosmallerlogicalunitstomanage,store,andretrievedataeffeciently.The logicalunitsaretablespace,segment,extent,anddatablock.Figure3willillustratetherelationships betweenthoseunits.

Figure3.TherelationshipsbetweentheOraclelogicalstructures Tablespace ATablespaceisagroupinglogicaldatabaseobjects.Adatabasemusthaveoneormoretablespaces.In theFigure3,wehavethreetablespacesSYSTEMtablespace,Tablespace1,andTablespace2. Tablespaceiscomposedbyoneormoredatafiles. Segment ATablespaceisfurtherbrokenintosegments.Asegmentisusedtostoressametypeofobjects.Thatis, everytableinthedatabasewillstoreintoaspecificsegment(namedDataSegment)andeveryindexin thedatabasewillalsostoreinitsownsegment(namedIndexSegment).Theothersegmenttypesare TemporarySegmentandRollbackSegment. Extent Asegmentisfurtherbrokenintoextents.Anextentconsistsofoneormoredatablock.Whenthe databaseobjectisenlarged,anextentwillbeallocated.Unlikeatablespaceorasegment,anextent cannotbenamed. DataBlock AdatablockisthesmallestunitofstorageintheOracledatabase.Thedatablocksizeisaspecificnumber ofbyteswithintablespaceandithasthesamenumberofbytes.

PhysicalStructures

ThephysicalstructuresarestructuresofanOracledatabase(inthiscasethediskfiles)thatarenot directlymanipulatedbyusers.Thephysicalstructureconsistsofdatafiles,redologfiles,andcontrolfiles. Datafiles Adatafileisafilethatcorrespondenswithatablespace.Onedatafilecanbeusedbyonetablespace,but onetablespacecanhasmorethanonedatafiles. RedoLogFiles RedologfilesarethefilesthatstoretheredoentriesgeneratedbyDMLstatements.Itcanbeusedfor recoveryprocesses. ControlFiles Controlfilesareusedtostoreinformationaboutphysicalstructureofdatabase,suchasdatafilessizeand location,redologfileslocation,etc.

You might also like