You are on page 1of 17

MCA Semester 4 MC0077 Advanced Database Systems

Assignment Set 2 Roll No.



1

MAY 2011
Master of Computer AppIication (MCA) - Semester 4
MC0077 - Advanced Database Systems- 4 Credits
(Book ID: B0882)
Assignment Set - 2 (60 Marks)
1 now costs are computed for execut|on of a query? D|scuss the method of Measur|ng Index
Se|ect|v|ty?
Ans 1
neur|st|cs of uery Cpt|m|zat|ons
qu|va|ence of xpress|ons
1he flrsL sLep ln selecLlng a queryprocesslng sLraLegy ls Lo flnd a relaLlonal algebra expresslon LhaL ls
equlvalenL Lo Lhe glven query and ls efflclenL Lo execuLe
Well use Lhe followlng relaLlons as examples
costometscbeme (coome stteet cclty)
ueposltscbeme (boome occooot# oome bolooce)
8toocbscbeme (boome ossets bclty)

Se|ect|on Cperat|on
1 Conslder Lhe query Lo flnd Lhe asseLs and branchnames of all banks who have deposlLors llvlng ln
orL ChesLer ln relaLlonal algebra Lhls ls
U bname assets(o cc|ty"ort Chester"
(cusLomer deposlL branch))
o 1hls expresslon consLrucLs a huge relaLlon
cusLomer deposlL branch of whlch we are only lnLeresLed ln a few Luples
o We also are only lnLeresLed ln Lwo aLLrlbuLes of Lhls relaLlon
o We can see LhaL we only wanL Luples for whlch cclLy orL ChesLer
o 1hus we can rewrlLe our query as

U bname assets(occ|ty"ort Chester"(cusLomer))
cusLomer deposlL branch)
o 1hls should conslderably reduce Lhe slze of Lhe lnLermedlaLe relaLlon

2 Suggested ku|e for Cpt|m|zat|on
o erform selecL operaLlons as early as posslble
o lf our orlglnal query was resLrlcLed furLher Lo cusLomers wlLh a balance over $1000 Lhe selecLlon
cannoL be done dlrecLly Lo Lhe cusLomer relaLlon above
o 1he new relaLlonal algebra query ls
bname asseLs(
occlLy orLChesLer" balance 1000
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

2

(costomet Jeposlt btoocb))
o 1he selecLlon cannoL be applled Lo costomet as bolooce ls an aLLrlbuLe of Jeposlt
We can sLlll rewrlLe as
bname asseLs
((occlLy orLChesLer" balance 1000
(costomet Jeposlt)) btoocb)
o lf we look furLher aL Lhe subquery (mlddle Lwo llnes above) we can spllL Lhe selecLlon predlcaLe ln
Lwo
occlLy orLChesLer"( obalance 1000
(costomet Jeposlt))
o 1hls rewrlLlng glves us a chance Lo use our perform selecLlons early rule agaln
o We can now rewrlLe our subquery as
occlLy orLChesLer"(cusLomer)
obalance 1000 (Jeposlt)
3 Second 1ransformat|ona| ku|e
o 8eplace expresslons of Lhe form o 12(C) by o 1(o 2( C)) where 1 and 2 predlcaLes and e ls a
relaLlonal algebra expresslon
o Cenerally
o 1(o 2( C)) o 2(o 1( C)) o 12(C)

ro[ect|on Cperat|on
1 Llke selecLlon pro[ecLlon reduces Lhe slze of relaLlons
lL ls advanLageous Lo app|y pro[ect|ons ear|y Conslder Lhls form of our example query
bname asseLs
(((occlLy orLChesLer" (costomet))
Jeposlt) btoocb)
2 When we compuLe Lhe subexpresslon
(((occlLy orLChesLer" (costomet)) Jeposlt)
we obLaln a relaLlon whose scheme ls (coome cclty boome occooot# bolooce)
3 We can ellmlnaLe several aLLrlbuLes from Lhls scheme 1he only ones we need Lo reLaln are Lhose
LhaL
o appear ln Lhe resulL of Lhe query or
o are needed Lo process subsequenL operaLlons
4 8y ellmlnaLlng unneeded aLLrlbuLes we reduce Lhe number of columns of Lhe lnLermedlaLe resulL
and Lhus lLs slze
3 ln our example Lhe only aLLrlbuLe we need ls boome (Lo [oln wlLh btoocb) So we can rewrlLe our
expresslon as
bname asseLs
(((occlLy orLChesLer" (costomet))
Jeposlt)) btoocb)
6 noLe LhaL Lhere ls no advanLage ln dolng an early pro[ecL on a relaLlon before lL ls needed for
some oLher operaLlon
o We would access every block for Lhe relaLlon Lo remove aLLrlbuLes
o 1hen we access every block of Lhe reducedslze relaLlon when lL ls acLually needed
o We do more work ln LoLal raLher Lhan less!

Natura| Io|n Cperat|on
AnoLher way Lo reduce Lhe slze of Lemporary resulLs ls Lo choose an opLlmal orderlng of Lhe [oln
operaLlons
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

3

naLural [oln ls assoclaLlve
(r1 r2) r3 r1 (r2 r3)
AlLhough Lhese expresslons are equlvalenL Lhe cosLs of compuLlng Lhem may dlffer
Look agaln aL our expresslon
bname asseLs
((occlLy orLChesLer" (costomet))
Jeposlt btoocb)
we see LhaL we can compuLe Jeposlt btoocb flrsL and Lhen [oln wlLh Lhe flrsL parL
Powever Jeposlt btoocb ls llkely Lo be a large relaLlon as lL conLalns one Luple for every accounL
1he oLher parL ls probably a small relaLlon (comparaLlvely)
(occlLy orLChesLer" (costomet)
So lf we compuLe flrsL we geL a reasonably small relaLlon
(occlLy orLChesLer" (costomet) Jeposlt
lL has one Luple for each accounL held by a resldenL of orL ChesLer
1hls Lemporary relaLlon ls much smaller Lhan Jeposlt btoocb
naLural [oln ls commuLaLlve
r1 r2 r2 r1
1hus we could rewrlLe our relaLlonal algebra expresslon as
bname asseLs
(((occlLy orLChesLer" (costomet))
Jeposlt)) btoocb)
8uL Lhere are no common aLLrlbuLes beLween costomet and btoocb so Lhls ls a Cartes|an product
LoLs of Luples!
lf a user enLered Lhls expresslon we would wanL Lo use Lhe assoclaLlvlLy and commuLaLlvlLy of
naLural [oln Lo Lransform Lhls lnLo Lhe more efflclenL expresslon we have derlved earller ([oln wlLh
Jeposlt flrsL Lhen wlLh btoocb)


2 Descr|be the fo||ow|ng w|th respect to SL3 D8 spec|f|cat|on
A) Comp|ex Structures C) ke|at|onsh|ps
8) n|erarch|ca| Structures D) Large Cb[ects LC8s ) Storage of LC8s

Ans 2
(A) Comp|ex structures
1 cteote tow type AJJtess_t deflnes Lhe address sLrucLure LhaL ls used ln llne 8
2 5tteet# 5tteet are regular SCL2 speclflcaLlons for aLomlc aLLrlbuLes
3 lostcoJe ooJ Ceoloc are boLh deflned as havlng user deflned daLa Lypes code and olnL
respecLlvely lcoJe ls Lyplcally locally deflned as a llsL or Lable of valld posLal codes perhaps wlLh Lhe
posL offlce name
4 cteote fooctloo Aqe_f deflnes a funcLlon for calculaLlon of an age as a declmal value glven a sLarL
daLe as Lhe lnpuL argumenL and uslng a slmple algorlLhm based on Lhe currenL daLe 1hls funcLlon ls
used as Lhe daLa Lype ln llne 9 and wlll be acLlvaLed each Llme Lhe letsoooqe aLLrlbuLe ls reLrleved
1he funcLlon can also be used as a condlLlon clause ln a SLLLC1 sLaLemenL
3 cteote toble L8SCn lnlLlaLes speclflcaLlon of Lhe lmplemenLaLlon sLrucLure for Lhe erson enLlLy
Lype
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

4

6 J ls deflned as Lhe prlmary key 1he oot ooll phrase only conLrols LhaL some noL null value ls
glven 1he ptlmoty key phrase lndlcaLes LhaL Lhe u8M ls Lo guaranLy LhaL Lhe seL of values for J are
unlque
7 Nome has a daLaLype ersname deflned as a 8ow Lype slmllar Lo Lhe one deflned ln llnes 13
8lttbuote ls a daLe LhaL can be used as Lhe argumenL for Lhe funcLlon Age_f deflned ln llne 4
8 AJJtess ls deflned uslng Lhe row Lype Address_L deflned ln llnes 13 llctote ls deflned as a 8LC8
or 8lnary Large Cb[ecL noLe LhaL Lhere are no funcLlons for conLenL search manlpulaLlon or
presenLaLlon whlch supporL 8LC8 daLa Lypes 1hese musL be deflned elLher by Lhe user as user
deflned funcLlons uuls or by Lhe C8u8MS vendor ln a supplemenLary subsysLem ln Lhls case we
need funcLlons for lmoqe processlng
9 Aqe ls deflned as a funcLlon whlch wlll be acLlvaLed each Llme Lhe aLLrlbuLe ls reLrleved 1hls cosLs
processlng Llme (Lhough Lhls algorlLhm ls very slmple) buL glves a correcL value each Llme Lhe
aLLrlbuLe ls used

(8) n|erarch|ca| Structures
cteote toble 51uuN1 lnlLlaLes speclflcaLlon of Lhe lmplemenLaLlon of a subclass enLlLy Lype
2 ClA level are Lhe aLLrlbuLes for Lhe subclass here wlLh slmple SCL2 daLa Lypes
J ooJet lk5ON speclfles Lhe Lable as a subclass of Lhe Lable L8SCn 1he u8M Lhus knows LhaL
when Lhe S1uuLn1 Lable ls requesLed all aLLrlbuLes and funcLlons ln L8SCn are also relevanL An
C8u8MS wlll sLore and use Lhe prlmary key of L8SCn as Lhe key for S1uuLn1 and execuLe a jolo
opetotloo Lo reLrleve Lhe full seL of aLLrlbuLes
4 cteote toble cOuk5 speclfles a new Lable speclflcaLlon as done for sLaLemenLs ln llnes 3 and 10
above
3 J Nome ooJ level are sLandard aLomlc aLLrlbuLe Lypes wlLh SCL2 daLa Lypes J ls deflned as
requlrlng a unlque non null value as speclfled for L8SCn ln llne 6 above
6 noLe LhaL aLLrlbuLes musL have unlque names wlLhln Lhelr Lables buL Lhe name may be reused
wlLh dlfferenL daLa domalns ln dlfferenL Lables 8oLh ld and name are such aLLrlbuLenames
appearlng ln boLh L8SCn and CCu8SL as ls Level used ln S1uuLn1 and CCu8SL
7 cootseuesctlptloo ls deflned as a characLer large ob[ecL CLC8 A CLC8 daLa Lype has Lhe same
deflned characLersLrlng funcLlons as char varchar and long char and can be compared Lo Lhese
uset_lJ ls deflned as ucode whlch ls Lhe name of a user deflned daLa Lype presumably a llsL of
accepLable user codes 1he u8 lmplemenLer musL deflne boLh Lhe daLa Lype and Lhe approprlaLe
funcLlons for processlng Lhls Lype
8 uset_J ls also speclfled as a fotelqo key whlch llnks Lhe Course records Lo Lhelr user record
modeled as a coteqoty sub enLlLy Lype Lhrough Lhe prlmary key ln Lhe user Lable

(C) ke|at|onsh|ps
1he relaLlonshlp 1okeo8y ls deflned ln llgure b 1hls deflnlLlon needs only SCL2 speclflcaLlons
noLe LhaL
r Sld Cld and 1erm form Lhe prlmary key k Slnce Lhe key ls composlLe a separaLe rlmary key
clause ls requlred (As compared wlLh Lhe slngle aLLrlbuLe k speclflcaLlons for L8SCnld and
CCu8SLld)
r 1he 2 forelgn key aLLrlbuLes ln Lhe k musL be deflned separaLely
r 1aken8y8eporL ls a forelgn key Lo a reporL enLlLyLype formlng a Lernary relaLlonshlp as modeled
ln llgure a 1he Cn uLLL1L Lrlgger ls acLlvaLed lf Lhe 8eporL relaLlon ls deleLed and assures LhaL Lhe
lk llnk has a valld value ln Lhls case null
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

3


(D) Large C8[ects LC8s
1he SSM synLax lncludes daLa Lypes for poLenLlally very long medla Lypes such as LexL lmage audlo
and vldeo as shown ln llgure 68 lf Lhls model ls Lo be reallzed ln a slngle daLabase Lhe uMS wlll
have Lo have Lhe capablllLy Lo manage sLore search reLrleve and manlpulaLe dlfferenL medla
Lypes Cb[ecLrelaLlonal dbms vendors clalm Lo be able Lo do Lhls
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

6


I|gure Med|a ob[ects as attr|butes
SCL3 provldes supporL for sLorage of 8lnary Large C8[ecLs 8LC8s A 8LC8 ls slmply a very long blL
sLrlng llmlLed ln many sysLems Loday Lo 2 or 4C8 Several C8ubms vendors dlfferenLlaLe 8LC8s lnLo
daLaLypes LhaL glve more lnformaLlon abouL Lhe formaL of Lhe conLenL and provlde baslc/prlmlLlve
manlpulaLlon funcLlons for Lhese large ob[ecL LC8 Lypes lor example l8Ms u82 has 3 LC8 Lypes
r 8LC8 for long blL sLrlngs
r CLC8 for long characLer sLrlngs and
r u8CLC8 for doublebyLe characLer sLrlngs
Cracle daLa Lypes for large ob[ecLs are 8LC8 CLC8 nCLC8 (flxedwldLh mulLlbyLe CLC8) and 8llLL
(blnary flle sLored ouLslde Lhe u8) noLe LhaL Lhe 1sL 3 are equlvalenL Lo Lhe u82 LC8s whlle Lhe lasL
ls really noL a daLaLype buL raLher a llnk Lo an exLernally sLored medla ob[ecL
SCL3 has no funcLlons for processlng fex lndexlng Lhe conLenL of a 8LC8
and provldes only funcLlons Lo sLore and reLrleve lL glven an exLernal ldenLlfler lor example lf Lhe
8LC8 ls an lmage SCL3 does noL know how Lo dlsplay lL le lL has no funcLlons for lmage
presenLaLlon
u8MS vendors who provlde dlfferenLlaLed blob Lypes have also exLended Lhe baslc SCL sLrlng
comparlson operaLors so LhaL Lhey wlll funcLlon for LC8s or aL leasL CLC8s 1hese operaLors lnclude
Lhe paLLern maLch funcLlon LlkL whlch glves a Lrue/false response lf Lhe search sLrlng ls found/noL
found ln Lhe *LC8 aLLrlbuLe
Note LlkL ls a sLandard SCL predlcaLe LhaL slmply has been exLended Lo search very long daLa
domalns
Storage of LC8s
1here are 3 sLraLegles for sLorlng LC8s ln an oru8
1 Lmbedded ln a column of Lhe deflnlng relaLlon or
2 SLored ln a separaLe Lable wlLhln Lhe u8 llnked from Lhe *LC8 column of Lhe deflnlng relaLlon
3 SLored on an exLernal (local or geographlcally dlsLanL) medlum agaln llnked from Lhe *LC8
column of Lhe deflnlng relaLlon
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

7

mbeJJeJ stotoqe ln Lhe deflnlng relaLlon closely maps Lhe loglcal vlew of Lhe medla ob[ecL wlLh lLs
physlcal sLorage 1hls sLraLegy ls besL lf Lhe oLher aLLrlbuLes of Lhe Lable are prlmarlly sLrucLural
meLadaLa used Lo speclfy dlsplay characLerlsLlcs for example lengLh language formaL
1he problem wlLh embedded sLorage ls LhaL a uMS musL Lransfer aL leasL a whole Luple more
commonly a block of Luples from sLorage for processlng lf blobs are embedded ln Lhe Luples a
greaL deal of daLa musL be LransmlLLed even lf Lhe LC8 ob[ecLs are noL parL of Lhe query selecLlon
crlLerla or Lhe resulL lor example a query reLrlevlng Lhe name and address of persons llvlng ln
8ergen norway would also reLrleve large quanLlLles of lmage daLa lf Lhe daLa for Lhe ersonlcLure
aLLrlbuLe of llgure 8 were sLored as an embedded column ln Lhe erson Lable
5epotote toble sLorage glves lndlrecL access vla a llnk ln Lhe deflnlng relaLlon and delays reLrleval of
Lhe LC8 unLll lL ls Lo be parL of Lhe query resulL seL 1hough Lhls glves a LwosLep reLrleval for
example when requesLlng an lmage of !oan nordboLLen lL wlll reduce general or average Lransfer
Llme for Lhe query processlng sysLem
A drawback of Lhls sLorage sLraLegy ls a llkely fragmenLaLlon of Lhe u8 area as LC8s can be sLored
anywhere 1hls wlll decrease Lhe efflclency of any algorlLhm searchlng Lhe conLenL of a larger seL of
LC8s for example Lo flnd lmages LhaL are slmllar Lo or conLaln a glven lmage segmenL As usual Lhe
sLorage sLrucLure chosen for a u8 should be based on an analysls of anLlclpaLed user querles
xtetool stotoqe ls useful lf Lhe u8 daLa ls connecLed Lo esLabllshed medla daLabases elLher locally
on Cu uvu or on oLher compuLers ln a neLwork as wlll mosL llkely be Lhe case when sharlng
medla daLa sLored ln auLonomous appllcaLlons such as cooperaLlng museums llbrarles archlves or
governmenL agencles 1hls sLorage sLrucLure ellmlnaLes Lhe need for dupllcaLlon of large quanLlLles
of daLa LhaL are normally offered ln readonly mode 1he cosL ls ln access Llme whlch may currenLly
be nearly unnoLlceable A good mulLlmedla uMS should supporL each of Lhese sLorage sLraLegles



3 xp|a|n A) Data Warehouse Arch|tecture 8) Data Storage Methods
Ans 3
A Data Warehouse Arch|tecture
1he Lerm uaLa Warehouse ArchlLecLure ls prlmarlly used Loday Lo descrlbe Lhe overall sLrucLure of a
8uslness lnLelllgence sysLem CLher hlsLorlcal Lerms lnclude ueclslon SupporL SysLems (uSS)
ManagemenL lnformaLlon SysLems (MlS) and oLhers

1he uaLa Warehouse ArchlLecLure descrlbes Lhe overall sysLem from varlous perspecLlves such as
daLa process and lnfrasLrucLure needed Lo communlcaLe Lhe sLrucLure funcLlon and
lnLerrelaLlonshlps of each componenL 1he lnfrasLrucLure or Lechnology perspecLlve deLalls Lhe
varlous hardware and sofLware producLs used Lo lmplemenL Lhe dlsLlncL componenLs of Lhe overall
sysLem 1he daLa perspecLlve Lyplcally dlagrams Lhe source and LargeL daLa sLrucLures and ald Lhe
user ln undersLandlng whaL daLa asseLs are avallable and how Lhey are relaLed

1he process perspecLlve ls prlmarlly concerned wlLh communlcaLlng Lhe process and flow of daLa
from Lhe orlglnaLlng source sysLem Lhrough Lhe process of loadlng Lhe daLa warehouse and ofLen
Lhe process LhaL cllenL producLs use Lo access and exLracL daLa from Lhe warehouse



MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

8

8 Data Storage Methods
ln CL1 Cnllne 1ransacLlon rocesslng SysLems relaLlonal daLabase deslgn use Lhe dlsclpllne of daLa
modellng and generally follow Lhe Codd rules of daLa normallzaLlon ln order Lo ensure absoluLe daLa
lnLegrlLy Less complex lnformaLlon ls broken down lnLo lLs mosL slmple sLrucLures (a Lable)
where all of Lhe lndlvldual aLomlc level elemenLs relaLe Lo each oLher and saLlsfy Lhe normallzaLlon
rules Codd deflnes 3 lncreaslng sLrlngenL rules of normallzaLlon and Lyplcally CL1 sysLems achleve
a 3rd level normallzaLlon lully normallzed CL1 daLabase deslgns ofLen resulL ln havlng lnformaLlon
from a buslness LransacLlon sLored ln dozens Lo hundreds of Lables

8elaLlonal daLabase managers are efflclenL aL managlng Lhe relaLlonshlps beLween Lables and resulL
ln very fasL lnserL/updaLe performance because only a llLLle blL of daLa ls affecLed ln each relaLlonal
LransacLlon

CL1 daLabases are efflclenL because Lhey are Lyplcally only deallng wlLh Lhe lnformaLlon around a
slngle LransacLlon ln reporLlng and analysls Lhousands Lo bllllons of LransacLlons may need Lo be
reassembled lmposlng a huge workload on Lhe relaLlonal daLabase Clven enough Llme Lhe sofLware
can usually reLurn Lhe requesLed resulLs buL because of Lhe negaLlve performance lmpacL on Lhe
machlne and all of lLs hosLed appllcaLlons daLa warehouslng professlonals recommend LhaL
reporLlng daLabases be physlcally separaLed from Lhe CL1 daLabase

ueslgnlng Lhe daLa warehouse daLa ArchlLecLure synergy ls Lhe realm of uaLa Warehouse ArchlLecLs
1he goal of a daLa warehouse ls Lo brlng daLa LogeLher from a varleLy of exlsLlng daLabases Lo
supporL managemenL and reporLlng needs 1he generally accepLed prlnclple ls LhaL daLa should be
sLored aL lLs mosL elemenLal level because Lhls provldes for Lhe mosL useful and flexlble basls for use
ln reporLlng and lnformaLlon analysls Powever because of dlfferenL focus on speclflc requlremenLs
Lhere can be alLernaLlve meLhods for deslgn and lmplemenLlng daLa warehouses 1here are Lwo
leadlng approaches Lo organlzlng Lhe daLa ln a daLa warehouse

ln Lhe dlmenslonal approach LransacLlon daLa ls parLlLloned lnLo elLher a measured facLs whlch
are generally numerlc daLa LhaL capLures speclflc values or dlmenslons whlch conLaln Lhe reference
lnformaLlon LhaL glves each LransacLlon lLs conLexL As an example a sales LransacLlon would be
broken up lnLo facLs such as Lhe number of producLs ordered and Lhe prlce pald and dlmenslons
such as daLe cusLomer producL geographlcal locaLlon and salesperson

1he maln advanLages of a dlmenslonal approach are LhaL Lhe daLa warehouse ls easy for buslness
sLaff wlLh llmlLed lnformaLlon Lechnology experlence Lo undersLand and use Also because Lhe daLa
ls pre[olned lnLo Lhe dlmenslonal form Lhe daLa warehouse Lends Lo operaLe very qulckly 1he maln
dlsadvanLage of Lhe dlmenslonal approach ls LhaL lL ls qulLe dlfflculL Lo add or change laLer lf Lhe
company changes Lhe way ln whlch lL does buslness

1he maln advanLage of Lhls approach ls LhaL lL ls qulLe sLralghLforward Lo add new lnformaLlon lnLo
Lhe daLabase Lhe prlmary dlsadvanLage of Lhls approach ls LhaL because of Lhe number of Lables
lnvolved lL can be raLher slow Lo produce lnformaLlon and reporLs

Sub[ecL areas are [usL a meLhod of organlzlng lnformaLlon and can be deflned along any llnes 1he
LradlLlonal approach has sub[ecLs deflned as Lhe sub[ecLs or nouns wlLhln a problem space lor
example ln a flnanclal servlces buslness you mlghL have cusLomers producLs and conLracLs An
alLernaLlve approach ls Lo organlze around Lhe buslness LransacLlons such as cusLomer enrollmenL
sales and Lrades

MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

9

D|scuss how the process of retr|ev|ng a 1ext Data d|ffers from the process of retr|eva| of an
Image?
1ext ketr|eva| Us|ng SL3]1extketr|eva|
SCL3 supporLs sLorage of mulLlmedla daLa such as LexL documenLs ln an ordaLabase uslng Lhe
blob/clob daLa Lypes Powever Lhe sLandard SCL3 speclflcaLlon does noL lnclude supporL for such
medla conLenL processlng funcLlons as lndexlng or searchlng uslng elemenLs of Lhe medla conLenL
lor example SCL3s supporL for a query Lo reLrleve documenLs abouL fomoos Notweqloo ottlsts
ls llmlLed Lo uslng a serlal search of all documenLs uslng Lhe paLLern maLch operaLor LlkL Cuerles
uslng Lhls operaLor are llkely Lo mlss Lhe Web slLes dedlcaLed Lo Lhe composer
Seekers of lnformaLlon from LexLbased documenLs commonly use free text queries le querles
LhaL conslsL of a seL of selecLlon Lerms as lllusLraLed above uependlng on Lhe underlylng query
processlng sysLem Lhe lnpuL can vary from a slngle search Lerm Lo a longer documenL 1hls ls a
normal lnpuL formaL for ofotmotloo tettlevol k sysLems such as Lhe web search englnes buL noL
for sysLems based on SCL do noL have a speclflc
1herefore mosL of Lhe larger ordbms vendors (l8M Cracle lngres osLgress eLc) have used
SCL3s uu1/uul supporL Lo exLend Lhelr ordbms wlLh subsysLems for Lhe managemenL of medla
daLa 1he approach used has been Lo addon own or purchased speclallzed medla managemenL
sysLems Lo Lhe baslc ordbms
8aslcally Lhe new Lo SCL3 funcLlonallLy lncludes
r exi kouties for Lhe varlous Lypes of medla daLa as dlscussed ln CP6 for example uslng
o ConLenL Lerms for LexL daLa and
o Color shape and LexLure feaLures for lmage daLa

r 5e/ectio Operotors for Lhe SCL3 WPL8L clause for speclflcaLlon of selecLlon crlLerla for medla
reLrleval
r 1ext Processi 5ub5ystems for slmllarlLy evaluaLlon and resulL ranklng

unforLunaLely Lhe resulL of Lhls lndependenL acLlvlLy ls non sLandard ordbms/mm (mulLlmedla)
sysLems LhaL dlffer ln Lhe funcLlonallLy lncluded and llmlL daLa reLrleval from mulLlple ordbm sysLem
Lypes lor example unlfled access Lo daLa sLored ln Cracle and u82 sysLems ls dlfflculL boLh ln query
formulaLlon and resulL presenLaLlon Slnce Lhe synLax of Lhe SCL3 exLenslons varles beLween or
dbms/mm lmplemenLaLlons Lhe examples used ln Lhe followlng are glven ln generlc
5Ll/1extketrievo/ (or sql3/Lr) sLaLemenLs

1ext Document ketr|eva|
1exLbased documenLs are baslcally unsLrucLured and can be complex 1hey can conslsL of Lhe raw
LexL only have a Lagged sLrucLure (such as for hLml documenLs) lnclude embedded lmages and can
have a number of flxed aLLrlbuLes conLalnlng Lhe meLadaLa descrlblng aspecLs of Lhe documenL 1hey
may also lnclude llnks Lo supplemenLary maLerlals lor example a news reporL for an elecLlon could
lnclude Lhe followlng componenLs where n m k and x are Lhe number of occurrences of each
componenL Lype
1 ldenLlfler daLe and auLhor(s) of Lhe reporL
2 n* LexL blocks (LlLles absLracL conLenL LexL)
3 m* lmages example lmage_of_candldaLe
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

10

4 k* charLs and
3 x* maps
noLe LhaL Lhe documenL elemenLs llsLed ln pL1 above funcLlon as cootext metoJoto for Lhe reporL
whlle Lhe LexL lLself can funcLlon as semootlc metoJoto for boLh Lhe LexL (Lhrough lndexlng) and Lhe
lmage maLerlals 1he Web documenL shown ln lllusLraLes elemenLs of a semlsLrucLured documenL
Slnce an C8u8 can conLaln LexL documenLs such as web pages SCL3 should be exLended wlLh
processlng operaLors LhaL supporL access Lo each of Lhe elemenL Lypes llsLed above

ketr|eva| us|ng Context Metadata
ln an C8u8 documenL descrlpLors such as uocomeot u uote and Aotbot(s) funcLlon as cootext
metoJoto 1he meLadaLa can be lmplemenLed as sLandard aLomlc aLLrlbuLes and relaLlonshlps Lhus
enabllng use of sLandard SCL querles for reLrleval of Lhe documenL(s) lor example an SCL query Lo
flnd recenL arLlcles on Jotobose moooqemeot by !oan nordboLLen could be expressed as
SelecL 8*
l8CM erson AuLhor A 8eporL 8
WPL8L ld Ald Anu A8ld8ld
Anu name !oan nordboLLen
Anu AuaLe 19991231
Anu 1lLle LlkL uaLabase
noLe LhaL Lhls query assumes LhaL Lhere could be reporLs on dlfferenL Loplcs and Lherefore requlres
use of a semanLlc descrlpLor Lo selecL only Lhose whose documenLs LhaL lndlcaLe LhaL Lhe reporL has
someLhlng Lo do wlLh daLabases 1he 1ltle aLLrlbuLe was used ln Lhls query buL oLher semanLlc
meLadaLa such as Lhe sommoty and/or keywotJ aLLrlbuLes could also have been chosen alone or ln
comblnaLlon

LxecuLlon opLlmlzaLlon of Lhls query wlll place Lhe LlkL operaLor lasL so LhaL lLs Llme consumlng
serlal search of Lhe 8eporLLlLle aLLrlbuLe wlll be resLrlcLed Lo Lhose reporLs LhaL saLlsfy Lhe
AuLhorname and daLe condlLlons Powever as noLed prevlously no Lerm lndex funcLlonallLy for
mulLlple Lerm aLLrlbuLes has been lncluded ln Lhe sLandard SCL3 Lhus Lhere ls no opLlon Lo Lhe serlal
search for Lhe LlkL operaLor

lnformaLlon reLrleval uslng Lhe sLandard SCL exacL maLch operaLors funcLlons well for Lhe conLexL
meLadaLa of all medla Lypes and moderaLely well for Lhe semanLlc conLenL meLadaLa aLLrlbuLes 1he
problem ls LhaL Lhe user musL know Lhe u8 sLrucLure Lhe aLLrlbuLe names and Lhe u8 values ln order
Lo form a query 1hls wlll noL be Lhe case for lnLerneL searchers

1ext ketr|eva| by Semant|c Content
8esearchers and developers of documenL collecLlons sLrongly recommend LhaL Lhe semanLlc
lnformaLlon conLenL of Lhe documenLs be descrlbed uslng such semootlc cooteot metoJoto
aLLrlbuLes as a LlLle (a llsL of) sub[ecL keywords and a conLenL descrlpLlon all mulLlple Lerm
descrlpLors 1hls lnformaLlon can be sLored wlLh Lhe documenL as sLandard SCL aLLrlbuLes uslng
varlable lengLh characLer daLa Lypes
lor example an C8u8 for webslLe malnLenance could be developed Lo conLaln Web documenLs
descrlbed uslng uublln Core meLadaLa elemenLs lf Lhe u8 conLalned Lhe Web page lL could be
reLrleved uslng Lhe followlng SCL sLaLemenL based on Lhe semanLlc meLadaLa and Lhe LexL lLself
SelecL * from uocumenL
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

11

where (1lLle LlkL Ldvard Crleg
or 1exL LlkL Ldvard Crleg)
ln Lhls case Lhe documenL was selecLed by a maLch ln Lhe LlLle slnce JvotJ Ctleq ls noL menLloned
by full name ln Lhe LexL of Lhe arLlcle Powever Lhe followlng SLC3 query wlll noL reLurn Lhls
documenL Lhough lL ls relevanL Lo Lhe lnLenL of Lhe query unless Lhe phrase Notweqloo composet
has been deflned ln Lhe keywotJs llsL

SelecL * from uocumenL
Where (1lLle LlkL norweglan composer
or keywords LlkL norweglan composer)
or 1exL LlkL norweglan composer)
1he mosL obvlous problems uslng a sLandard SCL3 sysLem for LexL search lnclude Lhe
r Lack of uLlllzaLlon of Lhe documenL sLrucLure
r uependency on Lhe serlal search of Lhe LlkL operaLor for Lhe mulLlple Lerm semanLlc meLadaLa
aLLrlbuLes and LexL body
r 1he poLenLlal mlsmaLch beLween Lhe user query Lerms and Lhe Lerms ln Lhe documenL descrlpLors
As noLed earller SCL3 has no concepL of a documenL or words and Lherefore Lhere are no search
operaLors for speclflcaLlon of Lhe placemenL search Lerms ln a documenL (ad[acenL near before
afLer) Slnce daLa reLrleval ln SCL3 ls based on an exacL maLch of Lhe query Lerms and Lhe u8
values no supporL ls provlded for slmllotlty evaluaLlon beLween Lhe query Lerms and Lhe documenL
conLenL Cbvlously more powerful operaLors are needed for LexL reLrleval ldeally a query language
LhaL supporLs LexL search and reLrleval by Lhe semootlc cooteot of LexL documenLs musL provlde aL
leasL Lhe followlng funcLlonallLy
Search Cr|ter|a xamp|e
LlsL of Lerms norweglan composer Crleg
1erm proxlmlLy Ldvard near Crleg
Synonym concepLs about Norweg|an composers
Slmllar documenLs ||ke Lhls documenL

1o help avold problems wlLh Lhe use of varlous Lerm forms a toot exttoctloo funcLlon musL be
avallable for boLh documenL lndexlng and query preprocesslng uslng Lhe above examples some
elemenLs ln Lhe rooLLerm Lable could be

koot 1erm Var|at|ons
norway norweglan norsk norge
Compose composer composers
composes
Muslc Lune Lunes song songs

noLe LhaL Lhere exlsL numerous elecLronlc dlcLlonarles Lhesaurl Laxonomles onLologles LhaL can be
lncorporaLed lnLo a LexL query processor

MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

12

SL3]1ext
formotio ketrievo/ 5ystems{ k5) have been under developmenL slnce Lhe mld 1930s 1hey
provlde search and reLrleval funcLlons for LexL documenL collecLlons based on documenL sLrucLure
concepLs of words and grammar lL ls funcLlonallLy from Lhese sysLems LhaL has been added by or
u8MS vendors Lo supporL managemenL of mulLlmedla daLa 1he resulLlng C8u8MS / MM
(MulLlmedla) conforms (Lo some degree) Lo Lhe MulLlmedla lnformaLlon 8eLrleval SysLems Ml8S
envlsloned by Lu (1999)

8aslc C8u8MS / MM LexL reLrleval funcLlonallLy lncludes generaLlon of mulLlple Lypes of term
|ndexes as well as a conta|ns operaLor wlLh suboperators for Lhe WPL8L clause 1he cootolos
operaLor dlffers from an exacL maLch query ln LhaL lL glves a probablllLy for a maLch a simi/ority
score beLween Lhe query search Lerms and Lhe documenLs ln Lhe daLabase raLher Lhan a Lrue/false
resulL 1hls operaLor can be used wlLh mulLlple search Lerms and operaLors LhaL speclfy relaLlonshlps
beLween Lhe search Lerms for example Lhe 8oolean operaLors Anu C8 noL and locaLlon operaLors
such as ad[acenL wlLhln same senLence or paragraph for LexL documenLs as lllusLraLed ln Lhe
followlng Lable

1erm comblnaLlon Anu C8 nC1
1erm locaLlon Au!ACLn1 nLA8 Wl1Pln
ConcepL A8Cu1 SlMlLA8
varlous oLher operaLors luZZ? LlkL
Assumlng LhaL whole Web pages are sLored ln an C8u8 aLLrlbuLe uocomeottext Lhe followlng
examples wlll reLrleve Lhe documenL ln addlLlon Lo oLher documenLs conLalnlng Lhe search Lerms

1) SelecL * from uocumenL
where 1exL CCn1AlnS (Ldvard Anu Crleg)
2) SelecL * from uocumenL
where 1exL CCn1AlnS (Ldvard Au!ACLn1 Crleg)
3) SelecL * from uocumenL
where 1exL A8Cu1 (composers)

ln processlng Lhe above querles Lhe SCL3/1exL processlng sysLem uLlllzes Lhe Lerm lndexes
generaLed for Lhe documenL seL as well as a tbesootos for query 3 noLe LhaL a Lerm locaLlon lndex
ls requlred for query 2 whlle query 1 needs a frequency lndex lf Lhe reLrleved documenLs are Lo be
tookeJ /ordered by Lhe frequency of Lhe search Lerms wlLhln Lhe documenLs

Image ketr|eva|
opular knowledge clalms LhaL an lmoqe ls worLh 1000 words unforLunaLely Lhese 1000 words may
dlffer from one lndlvldual Lo anoLher dependlng on Lhelr perspecLlve and/or knowledge of Lhe lmage
conLexL lor example llgure 6 glves a famlllar demonsLraLlon LhaL an lmage can have mulLlple qulLe
dlfferenL lnLerpreLaLlons 1hus even lf a 1000word lmage descrlpLlon were avallable lL ls noL
cerLaln LhaL Lhe lmage could be reLrleved by a user wlLh a dlfferenL descrlpLlon
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

13


1he problem ls fundamenLally one of communlcaLlon beLween an lnformaLlon/lmage seeker/user
and Lhe lmage reLrleval sysLem Slnce Lhe user may have dlfferlng needs and knowledge abouL Lhe
lmage collecLlon an lmage reLrleval sysLem musL supporL varlous forms for query formulaLlon ln
general lmage reLrleval querles can be classlfled as

1 ttribute8ose uer|es whlch use conLexL and/ sLrucLural meLadaLa values Lo reLrleve lmages
for example
o loJ lmoqe oombet x or
o loJ lmoqes ftom tbe tb of Moy (Lhe norweglan naLlonal hollday day)

2 1extuo/ uer|es whlch use a Lermbased speclflcaLlon of Lhe deslred lmages LhaL can be maLched
Lo LexLual lmage descrlpLors for example
o loJ lmoqes of nowolloo soosets or
o loJ lmoqes of lteslJeot 8osb Jellvetloq o compolqo speecb

3 Iisuo/ uer|es whlch glve vlsual characLerlsLlcs (color LexLure) or an lmage LhaL can be compared
Lo vlsual descrlpLors Lxamples lnclude
o loJ lmoqes wbete tbe Jomlooot colot ls bloe ooJ qolJ or
o loJ lmoqes llke tbls ooe
1hese query Lypes uLlllze dlfferenL lmage descrlpLors and requlre dlfferenL processlng funcLlons
lmage descrlpLors can be classlfled lnLo

r ,etooto uescriptors Lhose LhaL Jesctlbe Lhe lmage as recommended ln Lhe numerous meLadaLa
sLandards such as uublln Core CluCC/C8M and MLC7 from Lhe llbrary museum and moLlon
plcLure communlLles respecLlvely
1hese meLadaLa can agaln be classlfled as
1 AtttlboteboseJ conLexL and sLrucLural meLadaLa such as creaLor daLes genre (source) lmage
Lype slze flle name or
2 1extboseJ semanLlc meLadaLa such as LlLle/capLlon sub[ecL/keyword llsLs freeLexL descrlpLlons
and/or Lhe LexL surroundlng embedded lmages for example as used ln a hLml documenL noLe LhaL
for embedded lmages conLenL lndexlng can be generaLed uslng Lhe nearby LexL


MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

14

What are d|fferences |n Centra||zed and D|str|buted Database Systems? L|st the re|at|ve
advantages of data d|str|but|on
Ans 5 Ieatures of D|str|buted vs Centra||zed Databases or D|fferences |n D|str|buted
Centra||zed Databases
Centra||zed Contro| vs Decentra||zed Contro|
ln cenLrallzed conLrol one daLabase admlnlsLraLor ensures safeLy of daLa whereas ln dlsLrlbuLed
conLrol lL ls posslble Lo use hlerarchlcal conLrol sLrucLure based on a global daLabase admlnlsLraLor
havlng Lhe cenLral responslblllLy of whole daLa along wlLh local daLabase admlnlsLraLors who have
Lhe responslblllLy of local daLabases

Data Independence
ln cenLral daLabases lL means Lhe acLual organlzaLlon of daLa ls LransparenL Lo Lhe appllcaLlon
programmer 1he programs are wrlLLen wlLh concepLual vlew of Lhe daLa (called ConcepLual
schema) and Lhe programs are unaffecLed by physlcal organlzaLlon of daLa ln ulsLrlbuLed
uaLabases anoLher aspecL of dlsLrlbuLlon dependency ls added Lo Lhe noLlon of daLa
lndependence as used ln CenLrallzed daLabases ulsLrlbuLlon uependency means programs are
wrlLLen assumlng Lhe daLa ls noL dlsLrlbuLed 1hus correcLness of programs ls unaffecLed by Lhe
movemenL of daLa from one slLe Lo anoLher however Lhelr speed of execuLlon ls affecLed

keduct|on of kedundancy
ln cenLrallzed daLabases redundancy was reduced for Lwo reasons (a) lnconslsLencles among several
coples of Lhe same loglcal daLa are avolded (b) sLorage space ls saved 8educLlon of redundancy ls
obLalned by daLa sharlng ln dlsLrlbuLed daLabases daLa redundancy ls deslrable as (a) locallLy of
appllcaLlons can be lncreased lf daLa ls repllcaLed aL all slLes where appllcaLlons need lL (b) Lhe
avallablllLy of Lhe sysLem can be lncreased because a slLe fallure does noL sLop Lhe execuLlon of
appllcaLlons aL oLher slLes lf Lhe daLa ls repllcaLed WlLh daLa repllcaLlon reLrleval can be performed
on any copy whlle updaLes musL be performed conslsLenLly on all coples

Comp|ex hys|ca| Structures and ff|c|ent Access
ln cenLrallzed daLabases complex accesslng sLrucLures llke secondary lndexed lnLerflle chalns are
used All Lhese feaLures provlde efflclenL access Lo daLa ln dlsLrlbuLed daLabases efflclenL access
requlres accesslng daLa from dlfferenL slLes lor Lhls an efflclenL dlsLrlbuLed daLa access plan ls
requlred whlch can be generaLed elLher by Lhe programmer or produced auLomaLlcally by an
opLlmlzer
roblems faced ln Lhe deslgn of an opLlmlzer can be classlfled ln Lwo caLegorles
a) Clobal opLlmlzaLlon conslsLs of deLermlnlng whlch daLa musL be accessed aL whlch slLes and whlch
daLa flles musL consequenLly be LransmlLLed beLween slLes
b) Local opLlmlzaLlon conslsLs of decldlng how Lo perform Lhe local daLabase accesses aL each slLe

Integr|ty kecovery and Concurrency Contro|
A LransacLlon ls an aLomlc unlL of execuLlon and aLomlc LransacLlons are Lhe means Lo obLaln
daLabase lnLegrlLy lallures and concurrency are Lwo dangers of aLomlclLy lallures may cause Lhe
sysLem Lo sLop ln mldsL of LransacLlon execuLlon Lhus vlolaLlng Lhe aLomlclLy requlremenL
ConcurrenL execuLlon of dlfferenL LransacLlons may permlL one LransacLlon Lo observe an
lnconslsLenL LranslenL sLaLe creaLed by anoLher LransacLlon durlng lLs execuLlon ConcurrenL
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

13

execuLlon requlres synchronlzaLlon amongsL Lhe LransacLlons whlch ls much harder ln all dlsLrlbuLed
sysLems

r|vacy and Secur|ty
ln LradlLlonal daLabases Lhe daLabase admlnlsLraLor havlng cenLrallzed conLrol can ensure LhaL only
auLhorlzed access Lo Lhe daLa ls performed
ln dlsLrlbuLed daLabases local admlnlsLraLors face Lhe same as well as Lwo new aspecLs of Lhe
problem (a) securlLy (proLecLlon) problems because of communlcaLlon neLworks ls lnLrlnslc Lo
daLabase sysLems (b) ln cerLaln daLabases wlLh a hlgh degree of slLe auLonomy may feel more
proLecLed because Lhey can enforce Lhelr own proLecLlons lnsLead of dependlng on a cenLral
daLabase admlnlsLraLor

D|str|buted uery rocess|ng
1he uu8MS should be capable of gaLherlng and presenLlng daLa from more Lhan one slLe Lo answer
a slngle query ln Lheory a dlsLrlbuLed sysLem can handle querles more qulckly Lhan a cenLrallzed
one by explolLlng parallellsm and reduclng dlsc conLenLlon ln pracLlce Lhe maln delays (and cosLs)
wlll be lmposed by Lhe communlcaLlons neLwork

8ouLlng algorlLhms musL Lake many facLors lnLo accounL Lo deLermlne Lhe locaLlon and orderlng of
operaLlons CommunlcaLlons cosLs for each llnk ln Lhe neLwork are relevanL as also are varlable
processlng capablllLles and loadlngs for dlfferenL nodes and (where daLa fragmenLs are repllcaLed)
Lradeoffs beLween cosL and currency lf some nodes are updaLed less frequenLly Lhan oLhers Lhere
may be a cholce beLween querylng Lhe local ouLofdaLe copy very cheaply and geLLlng a more upLo
daLe answer by accesslng a dlsLanL locaLlon

D|str|buted D|rectory (Cata|og) Management
CaLalogs for dlsLrlbuLed daLabases conLaln lnformaLlon llke fragmenLaLlon descrlpLlon allocaLlon
descrlpLlon mapplngs Lo local names access meLhod descrlpLlon sLaLlsLlcs on Lhe daLabase
proLecLlon and lnLegrlLy consLralnLs (conslsLency lnformaLlon) whlch are more deLalled as compared
Lo cenLrallzed daLabases

ke|at|ve Advantages of D|str|buted Databases over Centra||zed Databases
Crgan|zat|ona| and conom|c keasons
Many organlzaLlons are decenLrallzed and a dlsLrlbuLed daLabase approach flLs more naLurally Lhe
sLrucLure of Lhe organlzaLlon 1he organlzaLlonal and economlc moLlvaLlons are amongsL Lhe maln
reasons for Lhe developmenL of dlsLrlbuLed daLabases ln organlzaLlons already havlng several
daLabases and feellng Lhe necesslLy of global appllcaLlons dlsLrlbuLed daLabases ls Lhe naLural
cholce

Incrementa| Growth
ln a dlsLrlbuLed envlronmenL expanslon of Lhe sysLem ln Lerms of addlng more daLa lncreaslng
daLabase slze or addlng more processors ls much easler

keduced Commun|cat|on Cverhead
Many appllcaLlons are local and Lhese appllcaLlons do noL have any communlcaLlon overhead
1herefore Lhe maxlmlzaLlon of Lhe locallLy of appllcaLlons ls one of Lhe prlmary ob[ecLlves ln
dlsLrlbuLed daLabase deslgn
MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

16

erformance Cons|derat|ons
uaLa locallzaLlon reduces Lhe conLenLlon for Cu and l/C servlces and slmulLaneously reduces access
delays lnvolved ln wlde area neLworks Local querles and LransacLlons accesslng daLa aL a slngle slLe
have beLLer performance because of Lhe smaller local daLabases ln addlLlon each slLe has a smaller
number of LransacLlons execuLlng Lhan lf all LransacLlons are submlLLed Lo a slngle cenLrallzed
daLabase Moreover lnLerquery and lnLraquery parallellsm can be achleved by execuLlng mulLlple
querles aL dlfferenL slLes or breaklng up a query lnLo a number of sub querles LhaL execuLe ln
parallel 1hls conLrlbuLes Lo lmproved performance

ke||ab|||ty and Ava||ab|||ty
8ellablllLy ls deflned as Lhe probablllLy LhaL a sysLem ls runnlng (noL down) aL a cerLaln Llme polnL
AvallablllLy ls Lhe probablllLy LhaL Lhe sysLem ls conLlnuously avallable durlng a Llme lnLerval When
Lhe daLa and u8MS sofLware are dlsLrlbuLed over several slLes one slLe may fall whlle oLher slLes
conLlnue Lo operaLe Cnly Lhe daLa and sofLware LhaL exlsL aL Lhe falled slLe cannoL be accessed 1hls
lmproves boLh rellablllLy and avallablllLy lurLher lmprovemenL ls achleved by [udlclously repllcaLlng
daLa and sofLware aL more Lhan one slLe

Management of D|str|buted Data w|th D|fferent Leve|s of 1ransparency ln a dlsLrlbuLed daLabase
followlng Lypes of Lransparencles are posslble
D|str|but|on or Network 1ransparency
1hls refers Lo freedom for Lhe user from Lhe operaLlonal deLalls of Lhe neLwork lL may be dlvlded
lnLo locaLlon and namlng Lransparency LocaLlon Lransparency refers Lo Lhe facL LhaL Lhe command
used Lo perform a Lask ls lndependenL of Lhe locaLlon of daLa and Lhe locaLlon of Lhe sysLem where
Lhe command was lssued namlng Lransparency lmplles LhaL once a name ls speclfled Lhe named
ob[ecLs can be accessed unamblguously wlLhouL addlLlonal speclflcaLlon

kep||cat|on 1ransparency
Coples of Lhe daLa may be sLored aL mulLlple slLes for beLLer avallablllLy performance and rellablllLy
8epllcaLlon Lransparency makes Lhe user unaware of Lhe exlsLence of coples

Iragmentat|on 1ransparency
1wo maln Lypes of fragmenLaLlon are PorlzonLal fragmenLaLlon whlch dlsLrlbuLes a relaLlon lnLo seLs
of Luples (rows) and verLlcal lragmenLaLlon whlch dlsLrlbuLes a relaLlon lnLo sub relaLlons where
each sub relaLlon ls deflned by a subseL of Lhe column of Lhe orlglnal relaLlon A global query by Lhe
user musL be Lransformed lnLo several fragmenL querles lragmenLaLlon Lransparency makes Lhe
user unaware of Lhe exlsLence of fragmenLs








MCA Semester 4 MC0077 Advanced Database Systems
Assignment Set 2 Roll No.

17

What are Comm|t rotoco|s? xp|a|n how 1wohase Comm|t rotoco| responds to fo||ow|ng
types of fa||ures
|) Ia||ure of art|c|pat|ng S|te
||) Ia||ure of Coord|nator

Ans Comm|t rotoco|s
ln dlsLrlbuLed daLa base and LransacLlon sysLems a dlsLrlbuLed commlt ptotocol ls requlred Lo ensure
LhaL Lhe effecLs of a dlsLrlbuLed LransacLlon are aLomlc LhaL ls elLher all Lhe effecLs of Lhe
LransacLlon perslsL or none perslsL wheLher or noL fallures occur Several commlL proLocols have
been proposed ln Lhe llLeraLure 1hese are varlaLlons of whaL has become a sLandard and known as
Lhe Lwophase commlL (2C) proLocol

1wophase comm|t protoco|
ln transaction processing databases and computer networking Lhe twophase comm|t protoco| (2C) ls
a Lype of atomic commitment protocol (AC) lL ls a distributed algorithm LhaL coordlnaLes all Lhe processes
LhaL parLlclpaLe ln a distributed atomic transaction on wheLher Lo .4229 or obott (toll bock) Lhe
LransacLlon (lL ls a speclallzed Lype of consensus proLocol) 1he proLocol achleves lLs goal even ln
many cases of Lemporary sysLem fallure (lnvolvlng elLher process neLwork node communlcaLlon
eLc fallures) and ls Lhus wldely uLlllzed


Powever lL ls noL reslllenL Lo all posslble fallure conflguraLlons and ln rare cases user (eg a
sysLems admlnlsLraLor) lnLervenLlon ls needed Lo remedy ouLcome 1o accommodaLe recovery from
fallure (auLomaLlc ln mosL cases) Lhe proLocols parLlclpanLs use logging of Lhe proLocols sLaLes Log
records whlch are Lyplcally slow Lo generaLe buL survlve fallures are used by Lhe proLocols recovery
procedures 1hough usually lnLended Lo be used lnfrequenLly recovery procedures comprlse a
subsLanLlal porLlon of Lhe proLocol due Lo many posslble fallure scenarlos Lo be consldered and
supporLed by Lhe proLocol

(I) Ia||ure of art|c|pat|ng S|te
1he commlttepoest pbose (or votloq pbose) ln whlch a cootJlootot process aLLempLs Lo prepare all
Lhe LransacLlons parLlclpaLlng processes (named pottlclpoots cobotts or wotkets) Lo Lake Lhe
necessary sLeps for elLher commlLLlng or aborLlng Lhe LransacLlon and Lo vote elLher ?es commlL
(lf Lhe LransacLlon parLlclpanLs local porLlon execuLlon has ended properly) or no aborL (lf a
problem has been deLecLed wlLh Lhe local porLlon) and

1he commlt pbose ln whlch based on votloq of Lhe cohorLs Lhe coordlnaLor decldes wheLher Lo
commlL (only lf oll have voLed ?es) or aborL Lhe LransacLlon (oLherwlse) and noLlfles Lhe resulL Lo
all Lhe cohorLs 1he cohorLs Lhen follow wlLh Lhe needed acLlons (commlL or aborL) wlLh Lhelr local
LransacLlonal resources (also called tecovetoble tesootces eg daLabase daLa) and Lhelr respecLlve
porLlons ln Lhe LransacLlons oLher ouLpuL (lf appllcable)

(ii) FaiIure of Coordinator
lf any cohorL voLes no durlng Lhe commlLrequesL phase (or Lhe coordlnaLors LlmeouL explres)
(1) 1he coordlnaLor sends a rollback message Lo all Lhe cohorLs
(2) Lach cohorL undoes Lhe LransacLlon uslng Lhe undo log and releases Lhe resources and locks held
durlng Lhe LransacLlon
(3) Lach cohorL sends an acknowledgemenL Lo Lhe coordlnaLor
(4) 1he coordlnaLor undoes Lhe LransacLlon when all acknowledgemenLs have been recelved

You might also like