... 90accountingdata,perhapswithaDEBITandCREDITtable.Onthedebitside,wehavealloftheextentsallocatedtoobjects.Onthecreditside,wehaveallofthefreeextentsavailableforuse.Whenanobjectneededanotherextent,itwouldaskthesystemtoget one. Oraclewouldthengotoitsdatadictionarytables,runsomequeries,findthespace(ornot),andthenupdatearowin one table(orremoveitalltogether),andinsertarowintoanother.Oraclemanagedspaceinverymuchthesamewayyouwillwriteyourapplicationsbymodifyingdata,andmovingitaround.ThisSQL,executedonyourbehalfinthebackgroundtogettheadditionalspace,isreferredtoasrecursiveSQL.YourSQLINSERTstatementcausedotherrecursiveSQLtobeexecutedtogetmorespace.ThisrecursiveSQLcouldbequiteexpensive,ifitisdonefrequently.Suchupdatestothedatadictionarymustbeserialized;theycannotbedonesimultaneously.Theyaresomethingtobeavoided.InearlierreleasesofOracle,wewouldseethisspacemanagementissue,thisrecursiveSQLoverhead,mostoftenoccurredintemporarytablespaces(thisisbeforetheintroductionofʹrealʹtemporarytablespaces).Spacewouldfrequentlybeallocated(wehavetodeletefrom one dictionarytableandinsertintoanother)andde‐allocated(puttherowswejustmovedbackwheretheywereinitially).Theseoperationswouldtendtoserialize,dramaticallydecreasingconcurrency,andincreasingwaittimes.Inversion7.3,Oracleintroducedtheconceptofatemporarytablespacetohelpalleviatethisissue.Atemporarytablespacewas one inwhichyoucouldcreatenopermanentobjectsofyourown.Thiswasfundamentallytheonlydifference;thespacewasstillmanagedinthedatadictionarytables.However,onceanextentwasallocatedinatemporarytablespace,thesystemwouldholdontoit(wouldnotgivethespaceback).Thenexttimesomeonerequestedspaceinthetemporarytablespaceforanypurpose,Oraclewouldlookforanalreadyallocatedextentinitsmemorysetofallocatedextents.Ifitfound one there,itwouldsimplyreuseit,elseitwouldallocate one theoldfashionedway.Inthisfashion,oncethedatabasehadbeenupandrunningforawhile,thetemporarysegmentwouldappearfullbutwouldactuallyjustbeʹallocatedʹ.Thefreeextentswereallthere;theywerejustbeingmanageddifferently.Whensomeoneneededtemporaryspace,Oraclewouldjustlookforthatspaceinanin‐memorydatastructure,insteadofexecutingexpensive,recursiveSQL.InOracle8.1.5andlater,Oraclegoesastepfurtherinreducingthisspacemanagementoverhead.Theyintroducedtheconceptofalocallymanagedtablespaceasopposedtoadictionarymanaged one. Thiseffectivelydoesforalltablespaces,whatOracle7.3didfortemporarytablespaces‐itremovestheneedtousethedatadictionarytomanagespaceinatablespace.Withalocallymanagedtablespace,abitmapstoredineachdatafileisusedtomanagetheextents.Now,togetanextentallthesystemneedstodoissetabitto1inthebitmap.Tofreespace‐setitbackto0.Comparedtousingdictionary‐managedtablespaces,thisisincrediblyfast.Wenolongerserializeforalongrunningoperationatthedatabaselevelforspacerequestsacrossalltablespaces.Rather,weserializeattheExpert one- on -one Oracle 3ContentIntroduction 18 WhatthisBookisAbout 18 WhoShouldUsethisBook? 19 HowThisBookisStructured ... 41Attheendoftheweekthedevelopers,whohadbeeninsulatedfromthedatabase,wereamazedatwhatthedatabasecouldactuallyprovideforthem,howeasyitwastogetthatinformationand,mostimportantly,howbigadifferenceitcouldmaketotheperformanceoftheirapplication.Wedidnʹtdothebenchmarkthatweek(theyhadsomereworkingtodo!)butintheendtheyweresuccessful‐justbehindschedulebyacoupleofweeks.ThisisnotacriticismoftoolsortechnologieslikeEJBsandcontainermanagedpersistence.Thisisacriticismofpurposelyremainingignorantofthedatabaseandhowitworksandhowtouseit.Thetechnologiesusedinthiscaseworkedwell‐afterthedevelopersgotsomeinsightintothedatabaseitself.Thebottomlineisthatthedatabaseistypicallythecornerstoneofyourapplication.Ifitdoesnotworkwell,nothingelsereallymatters.Ifyouhaveablackboxanditdoesnotworkwell‐whatareyougoingtodoaboutit?Abouttheonlythingyoucandoislookatitandwonderwhyitisnotdoingsowell.Youcannotfixit,youcannottuneit,youquitesimplydonotunderstandhowitworks‐andyoumadethedecisiontobeinthisposition.ThealternativeistheapproachthatIadvocate:understandyourdatabase,knowhowitworks,knowwhatitcandoforyou,anduseittoitsfullestpotential.How(andhownot)toDevelopDatabaseApplicationsThatʹsenoughhypothesizing,fornowatleast.Intheremainderofthischapter,Iwilltakeamoreempiricalapproach,discussingwhyknowledgeofthedatabaseanditsworkingswilldefinitelygoalongwaytowardsasuccessfulimplementation(withouthavingtowritetheapplicationtwice!).Someproblemsaresimpletofixaslongasyouunderstandhowtofindthem.Othersrequiredrasticrewrites. One ofthegoalsofthisbookistohel ... ORA‐06519ʺactiveautonomoustransactiondetectedandrolledbackʺ 860 Expert one- on -one Oracle 15Summary 1268 DBMS_PIPE 1268 PipeServersversusExternalRoutines 1271 OnlineExample 1273 Summary 1273 AppendixAC:DBMS_APPLICATION_INFO...