chapter 6 system architecture

Upload: mhussain

Post on 03-Jun-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Chapter 6 System Architecture

    1/7

    6 System ArchitectureIn the following sections we discuss the main components of the Oracle DBMS (Version7!"architecture (Section 6#" and the logical and physical data$ase structures (Sections 6%and6&" 'e furthermore setch how S)* statements are processed (Section 6+" and howdata$ase

    o$,ects are created (Section 6-"6# Storage Management and .rocesses/he Oracle DBMS ser0er is $ased on a so1called Multi1Ser0er Architecture /he ser0er isresponsi$le for processing all data$ase acti0ities such as the e2ecution of S)*statements3 userand resource management3 and storage management Although there is only one copyof theprogram code for the DBMS ser0er3 to each user connected to the ser0er logically aseparateser0er is assigned /he following figure illustrates the architecture of the Oracle DBMSconsisting of storage structures3 processes3 and files

    Server-Process

    Server-

    Process

    Server-

    Process

    PGA PGA PGA

    Shared Pool

    Dictionary Cache

    Library Cache

    System Global Area (SGA)Server-

    Buffer

    Archive

    Log

    Buffer

    LG! A!C" P#$% S#$%

    Bac&ground Processes

    DB!

    PGA

    'ser 'ser 'ser * 'ser n

    Process

    Database

    Datafiles !edo-Log +iles Control +iles Archive- and Bac&u, +iles

    !edo-Log-

    Buffer

    4igure +5 Oracle System Architecture-ach time a data$ase is started on the ser0er (instance startup"3 a portion of thecomputer8smain memory is allocated3 the so1called System 9lo$al Area (S9A" /he S9A consists oftheshared pool3 the data$ase $uffer3 and the redo1log $uffer 4urthermore3 se0eral$acgroundprocesses are started /he com$ination of S9A and processes is called data$aseinstance /hememory and processes associated with an instance are responsi$le for efficientlymanaging thedata stored in the data$ase3 and to allow users accessing the data$ase concurrently/heOracle ser0er can manage multiple instances3 typically each instance is associated withaparticular application domain

  • 8/12/2019 Chapter 6 System Architecture

    2/7

    /he S9A ser0es as that part of the memory where all data$ase operations occur Ifse0eralusers connect to an instance at the same time3 they all share the S9A /he informationstoredin the S9A can $e su$di0ided into the following three cachesData$ase Buffer /he data$ase $uffer is a cache in the S9A used to hold the data $locsthatare read from data files Blocs can contain ta$le data3 inde2 data etc Data $locs are

    modified in the data$ase $uffer Oracle manages the space a0aila$le in the data$ase$uffer $y using a least recently used (*:;" algorithm 'hen free space is needed in the$uffer3 the least recently used $locs will $e written out to the data files /he siote that all S)* statements re=uire accessing the data dictionary /hus eepingrele0antportions of the dictionary in the cache may increase the performance /he li$rary cachecontains information a$out the most recently issued S)* commands such as the parsetree and =uery e2ecution plan If the same S)* statement is issued se0eral times3 itneednot $e parsed again and all information a$out e2ecuting the statement can $e retrie0edfrom the li$rary cache4urther storage structures in the computer8s main memory are the log1archi0e $uffer(optional"and the .rogram 9lo$al Area (.9A" /he log1archi0e $uffer is used to temporarily cacheredologentries that are to $e archi0ed in special files /he .9A is the area in the memory that isused $y a single Oracle user process It contains the user8s conte2t area (cursors30aria$les

    etc"3 as well as process information /he memory in the .9A is not shara$le4or each data$ase instance3 there is a set of processes /hese processes maintain andenforce therelationships $etween the data$ase8s physical structures and memory structures /henum$er-?of processes 0aries depending on the instance configuration One can distinguish$etween userprocesses and Oracle processes Oracle processes are typically $acground processesthatperform I@O operations at data$ase run1time

  • 8/12/2019 Chapter 6 System Architecture

    3/7

    DB': /his process is responsi$le for managing the contents of the data$ase $uffer andthedictionary cache 4or this3 DB': writes modified data $locs to the data files /heprocess only writes $locs to the files if more $locs are going to $e read into the $ufferthan free $locs e2ist*9': /his process manages writing the contents of the redo1log1$uffer to the redo1logfilesSMO> 'hen a data$ase instance is started3 the system monitor process performs

    instancereco0ery as needed (eg3 after a system crash" It cleans up the data$ase from a$ortedtransactions and o$,ects in0ol0ed In particular3 this process is responsi$le forcoalescingcontiguous free e2tents to larger e2tents (space defragmentation3 see Section 6%".MO> /he process monitor process cleans up $ehind failed user processes and it alsocleansup the resources used $y these processes *ie SMO>3 .MO> waes up periodically tochec whether it is neededA: (optional" /he *9': $acground process writes to the redo1log files in a cyclicfashion Once the last redo1log file is filled3 *9': o0erwrites the contents of the firstredo1log file It is possi$le to run a data$ase instance in the archi0e1log mode In thiscasethe A: process copies redo1log entries to archi0e files $efore the entries areo0erwritten$y *9': /hus it is possi$le to restore the contents of the data$ase to any time afterthe archi0e1log mode was started;S: /he tas of this process is to communicate with other processes started $yapplicationprograms such as S)*C.lus /he ;S: process then is responsi$le for sendingrespecti0eoperations and re=uests to the S9A or .9A /his includes3 for e2ample3 reading data$locs

    6% *ogical Data$ase Structures4or the architecture of an Oracle data$ase we distinguish $etween logical and physicaldata$ase structures that mae up a data$ase *ogical structures descri$e logical areasof storage(name spaces" where o$,ects such as ta$les can $e stored .hysical structures3 incontrast3are determined $y the operating system files that constitute the data$ase/he logical data$ase structures include5Data$ase A data$ase consists of one or more storage di0isions3 so1called ta$lespaces

    /a$lespaces A ta$lespace is a logical di0ision of a data$ase All data$ase o$,ects arelogicallystored in ta$lespaces ach data$ase has at least one ta$lespace3 the SS/Mta$lespace3that contains the data dictionary Other ta$lespaces can $e created and used fordifferentapplications or tass6ESegments If a data$ase o$,ect (eg3 a ta$le or a cluster" is created3 automatically aportion

  • 8/12/2019 Chapter 6 System Architecture

    4/7

    of the ta$lespace is allocated /his portion is called a segment 4or each ta$le thereis a ta$le segment 4or inde2es so1called inde2 segments are allocated /he segmentassociated with a data$ase o$,ect $elongs to e2actly one ta$lespace2tent An e2tent is the smallest logical storage unit that can $e allocated for a data$aseo$,ect3 and it consists a contiguous se=uence of data $locsF If the si

  • 8/12/2019 Chapter 6 System Architecture

    5/7

    As mentioned in Section 6#3 aside from datafiles three further types of files areassociated witha data$ase instance5:edo1*og 4iles ach data$ase instance maintains a set of redo1log files /hese files areusedto record logs of all transactions /he logs are used to reco0er the data$ase8stransactionsin their proper order in the e0ent of a data$ase crash (the reco0ering operations are

    calledroll forward" 'hen a transaction is e2ecuted3 modifications are entered in the redo1log$uffer3 while the $locs affected $y the transactions are not immediately written $ac todis3 thus allowing optimi

  • 8/12/2019 Chapter 6 System Architecture

    6/7

    using data from the dictionary cache3 a =uery e2ecution plan is generated $y the =ueryoptimi

  • 8/12/2019 Chapter 6 System Architecture

    7/7

    a$o0e3 the initial e2tent has a si