Sei sulla pagina 1di 20

17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

Overview

Purpose

ThistutorialshowsyouhowtousetheAggregatePersistenceWizardinOracleBI11g,tocreateandmodelaggregatetablesto
increasequeryperformancebyprecalculatingfrequentlyaccessedmeasureaggregations.

TimetoComplete

Approximately30minutes

Overview

ThistutorialshowsyouhowtocreateandmodelaggregatetablesusingtheAggregatePersistenceWizard.Datawarehouse
performancebottlenecksareoftenduetomeasureaggregation(forexample,summingordersatdifferentlevelsofadimensional
hierarchy)thatisbeingperformedatruntime.Havingidentifiedcandidateaggregatetablesforinclusioninyourdatawarehouse,
youusetheAggregatePersistenceWizardtocreateandmodelaggregatestorelievethebottleneckandprecalculateandstore
thedataforbetterqueryresponse.

WhenyouusetheAggregatePersistenceWizardtocreateaggregates,itisimportantthatyouhaveafullyfunctionalbusiness
model,withacompletesetofmeasures,dimensions,andhierarchies.Beforebuildingtableswiththewizard,youshouldhave
conceptuallydesignedthedesiredsetofaggregatesonpaper.Theconceptualdesignshouldincludethesetofaggregatestars
byname,thesetoffactsineachstar,andthedimensionalityandgrainofeach.Tohelpyouindesigningaggregates,youcan
enableusagetracking.Whenusagetrackingisenabled,theOracleBIServercollectsusagetrackingdataforeachquery,andit
insertsthestatisticsdirectlyintoadatabasetable.Usagetrackingisalsohelpfulindeterminingwhichuserqueriesarecreating
performancebottlenecks,basedonqueryfrequencyandresponsetime.Tolearnhowtosetupusagetracking,youcango
throughthetutorialonSettingUpUsageTrackinginOracleBI11g.Youshouldalsodeterminethedatabasewherethe
aggregatesaretobedeployedin.Thisisusuallytheexistingdatabasethatcontainsthebasetablesthatarebeingaggregated.
However,thetablescanbeplacedinadifferentdatabase.Theseminimumrequirementsforthelogicalandphysicaldesign
detailsaresufficienttocreatethetableswiththeAggregatePersistenceWizard.YoucouldusetheModelCheckertoseeifthere
areanyerrorsinthemodel.

Prerequisites

Beforestartingthistutorial,youshould:

HaveaccesstoorhaveinstalledOracleDatabase11.2orhigher
HaveaccesstoorhaveinstalledOracleBIEE11.1.1.7OBIEE
DownloadtheSamplerpdfromhere.
HaveSampleAppsrpdrunninginonlinemode.

SettingUptheDataSchemainOracleDatabase

TocreatetherequiredtablespaceandBISAMLE_EXAuser(replacepathstoappropriatevaluesonyourenvironment)execute
thefollowingSQLstatements:

1.createtablespaceBISAMPLE_EXAdatafile'\home\oracle\app/oracle\oradata\orcl\bisample_exa.dbf'size10M
autoextendondefaultcompress

createtemporarytablespaceBISAMPLE_EXA_TEMPtempfile
'\home\oracle\app\oracle\oradata\orcl\bisample_exa_temp.dbf'size10Mautoextendon

2.createuserBISAMPLE_EXAidentifiedbyBISAMPLE_EXAdefaulttablespaceBISAMPLE_EXAtemporarytablespace
BISAMPLE_EXA_TEMP

grantdbatoBISAMPLE_EXA

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 1/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

3.Copythedumpfilefromhere.Unzipandcopyovertoyourdatabasemachine.

LogintoBISAMPLE_EXAschemaandcreateadirectoryobjecttopointtothedirectorywhereyouvecopiedthisfile.
ExecutetheSQLstatement:
Createorreplacedirectorysampleappas'C:\bisample_exa'

4.OpenWindowscommandandnavigatetothedirectorycontainingbisample_exa.dmpfile.Importthedumpusingthe
followingcommand:
impdpBISAMPLE_EXA/BISAMPLE_EXAdirectory=sampleappdumpfile=bisample_exa.dmpschemas=bisample_exa

5.Onceimported,logintoBISAMPLE_EXAschemaandverifyalltablesarecreatedandloaded(SAMP_REVENUE_F
tableshouldhave5millionrows)

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 2/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

6.DownloadthetutorialSampleApp30212AforAPrpdfromhereandmakeitonline.ThisisaSampleAppsrpdmodified
forthistutorial.Forthetutorial,BSampleSalesExasubjectareawillbeused.EnterAdmin123astheRepository
password.

7.Createaquerywiththefollowing:

Time.T02PerNameMonth
Products.P4Brand
Offices.D4Company
BaseFacts.1Revenue
BaseFacts.2BilledQuantity
BaseFacts.3DiscountAmount
BaseFacts.4PaidAmount

8.ClickResults.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 3/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

9.Notehowlongittakesforthequerytoreturntheresults.

CreatingtheAggregates

Inthistopic,youunderstandtheroleandfunctionoftheAggregatePersistenceWizardincreatingandmodelingaggregatesto
resolvequerybottlenecks.

Aggregatetablesstoreprecomputedresults,whicharemeasuresthathavebeenaggregated(typicallysummed)overasetof
dimensionalattributes.Usingaggregatetablesisaverypopulartechniqueforspeedingupqueryresponsetimesindecision
supportsystems.Thiseliminatestheneedforruntimecalculationsanddeliversfasterresultstousers.Thecalculationsaredone
aheadoftimeandtheresultsarestoredintables.Aggregatetablesshouldhavefewerrowsthanthenonaggregatetablesand,
therefore,processingshouldbequicker.

TheaggregatenavigationcapabilityofOracleBIServerallowsqueriestousetheinformationstoredinaggregatetables
automatically,withoutqueryauthorsortoolshavingtospecifyaggregatetablesinthequeries.OracleBIServerallowsusersto
concentrateonaskingtherightbusinessquestions,becausetheserverdecideswhichtablesprovidethefastestanswers.For
OracleBIServertohaveenoughinformationtonavigatetoaggregatetables,certainmetadataintherepositorymustbecorrectly
configured.

ThetraditionalprocessofcreatingaggregatesforOracleBIServerqueriesismanual.Itcanbetedious,requiringcomplicated
datadefinitionlanguage(DDL)anddatamanipulationlanguage(DML)scriptstobewrittenforcreatingtablesinthedatabases
involved.Additionally,theseaggregatedtablesneedtobemappedtotherepositorymetadatatobeavailableforqueries.Thisisa
timeconsumingand,possibly,errorproneprocess.

TheAggregatePersistenceWizardenablesyoutoautomatethecreationofphysicalaggregatetablesandtheircorresponding
objectsintherepository.TheAggregatePersistenceWizardcreatesanOracleBIEnterpriseEditionSQLscript,whichisexecuted
bytheBIServer.Thescriptspecifieseachaggregatetabletobecreated,thefactsfromthebusinessmodelthatshouldbe
includedinit,anditsdimensionsandgrain.WhentheBIServerrunstheaggregatepersistenceSQLscript,itgeneratesDDLto
createtherequiredtablesinthetargetdatabase,internalinstructionstogeneratethecorrespondingphysicalandaggregate
navigationmetadata,anddatamanipulationlanguage(DML)toaggregateandloaddatafromthebasetablesintotheaggregate
tables.Theaggregatepersistencescriptisintendedtoberunaftereachextraction,transformation,andloading(ETL)ofthebase
tables,typicallynightly.ThiscanbedonebyanOracleBIEEJobManagerjob,oritcanberunasa.batoranyotherscriptcalled
byacustomprogram.

ThedefaultprefixSA_isautomaticallyaddedtodimension(level)aggregates.Youcanchangethisdefaultprefixbyupdatingthe
AGGREGATE_PREFIXparameterintheAGGREGATE_PERSISTENCEsectionoftheNQSConfig.INIfile:AGGREGATE_PREFIX
="prefix_name"

Inthistopic,youusetheAggregatePersistenceWizardtocreateandmodelaggregatetablestosupportqueryperformance.

Theconceptualdesignofyouraggregatestarincludesthefollowingcharacteristics.

Measures Dimension/Grain SourceDatabase

Products/P4Brand
BaseFacts.1
Revenue",2Billed Time/T02PerNameMonth"
Quantity",3Discount BISAMPLE_EXA
Amount,4Paid Office/"D4Comapny"
Amount

DoingaConsistencyCheck
1.OpenSampleApp30212forAP.rpdinonlinemodeinBIAdministrationTool.EnterAdmin123astheRepository
password.Entertheuseridandpasswordforyourinstallation.ForthistutorialwewilluseasUserweblogicand
Passwordwelcome1.MakeanoteoftheODBCdatasourcename.Inthisexampleitis
coreapplication_OH1291352497.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 4/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g
coreapplication_OH1291352497.

2.ClickFile>CheckGlobalConsistency.

3.TheConsistencycheckisdone.

4.OncetheconsistencycheckiscompleteConsistencyCheckManagerwindowisopened.Makesurethereareno
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 5/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g
4.OncetheconsistencycheckiscompleteConsistencyCheckManagerwindowisopened.Makesurethereareno
errors.CloseConsistencyCheckManagerandsavetherpd.Ifthereareanyerrors,pleaseremovetheerrors.

RunningtheModelChecker
YoucanuseModelCheckManagertocheckyourrepositorymetadataforissuesthatmightaffectthesuccessofthe
aggregatepersistenceengine,suchasidentifyinglevelprimarykeysthatarenotunique.

AlthoughtheuserexperienceofrunningModelCheckManagerisverysimilartorunningtheConsistencyCheckManager,
therearethreekeydifferencesbetweenthetwotools:

UnliketheConsistencyCheckManager,ModelCheckManagerrequiresaccesstobackenddatasourcesforsome
checks.Becausesomeofthebackendqueriescanbeexpensive,itisrecommendedtorunModelCheckManager
duringoffpeakperiods.

ModelCheckManagercanonlyberuninonlinemode.

ModelCheckManagerdoesnotmakeanychangestorepositorymetadataitonlyflagspossibleproblems.

SimilartotheConsistencyCheckManager,ModelCheckManagerreturnsbotherrorandwarningmessages.Youmustfix
errorsidentifiedbyModelCheckManager,ortheaggregatepersistenceenginemightfailtocreateaggregates.Itis
recommendedthatyoufixwarnings,butnotrequired.

RunModelCheckManagerrightbeforeyouruntheAggregatePersistenceWizard.Alternatively,youcanrunModelCheck
Managertoidentifyproblemsforselectedobjectsafterinitialaggregatecreationfailure.IfthereareerrorsinModelChecker,
makesuretheyarenotrelatedtothedimensionsyouareselectingtobuildtheaggregate.

SincetherpdforthistutorialisamodifiedversionofSampleAppsrpd,runtheModelCheckerforthedimensionsthatwillbe
usedforthistutotrial.TorunModelCheckManagerforthedimensionsperformthefollowingsteps:

1.IntheBusinessModelandMappingLayer,selecttheD0Timedimensionin01SampleAppExabusinessmodel.
RightclickandselectCheckModel.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 6/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

2.ModelCheckerhasthefollowingtwooptions:

Complete:ChecksallobjectsintheBusinessModelandMappinglayeroftheOracleBIrepository.

FilteredbyStatistics:ChecksonlyfacttableobjectsandassociateddimensionsintheBusinessModeland
Mappinglayerthathavebeenactivelyqueriedaccordingtothestatisticstable.Selectthisoptiontospeed
uptheprocessforlargerepositories.

ThisoptionisonlyavailableontheOracleExalyticsMachine.Ifyouattempttofilterbystatisticsonanon
Exalyticssystem,orifyouattempttofilterwhenthestatisticstableisnotavailable,awarningappears
explainingthatModelCheckManagercannotfilterbystatistics.

3.ClickComplete.WhencompleteModelCheckerManagerwindowwillshowalltheerrors,ifany.Makesurethere
arenoerrors.CloseModelCheckerManager.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 7/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

4.SimilarlyruntheModelCheckerfortheProductandOfficedimensions.Ineachcase,makesurethereareno
errors.CloseModelCheckerManager.

UsingtheAggregatePersistenceWizard
1.SelectTools>Utilitiesfromthemenubar.

2.FromtheUtilitieswindowsselectAggregatePersistenceandclickExecute.TheAggregatePersistencewizard
opens.

3.IntheAggregatePersistenceSelectFileLocationwindowenterthenameoftheSQLscriptfileasaggregate.sql.
Enterthefolderwherethisfilewillbeplaced.ClickNext.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 8/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

4.IntheAggregatePersistenceSelectBusinessMeasureswindow,selectthesubjectarea01SampleAppExa
andfollowingmeasuresfromtheF0SalesBaseMeasurestable:

1Revenue

2BilledQuantity

3DiscountAmount

4PaidAmount

ClickNext.

5.IntheAggregatePersistenceSelectLevelswindow,selectdimensionH0Time.Month,H1Products.Product
Brand,andH3Offices.Company.ClickNext.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 9/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

6.IntheAggregatePersistenceSelectConnectionPoolwindow,selectthedatabaseas02SampleAppExaData
(ORCL).MakesureyouselecttheOracledatabase(ORCL)andnotEssbase(ESSB).SelectCatalog/Schemaas
02SampleAppExaData(ORCL)>BISAMPLE_EXA.SelecttheConnectPoolExaSampleConnection.
Changethedefaultaggregatetablenametoag_BISAMPLE_EXA.ClickNext.

7.IntheAggregatePersistenceFinishwindow,checkthescript.SelectIamdoneandclickNext.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 10/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

8.IntheAggregatePersistenceFinishScriptwindow,checkthatthescriptiscreatedandplacedinthespecified
folder.ClickFinish.

9.Opentheaggragate.sqlscriptfileineditmode.Checkthescript.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 11/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

RunningnqcmdinCommandLine
1.Openacommandwindow.Changedirectoryto
c:\bi\instances\intance1\bifoundation\OracleBIApplication\coreapplications\setup.Yourenvironmentmayhave
adifferentpath.Enterandrunbiinitinthecommandwindow.

2.Asecondwindowopens.Atthepromptinthesecondcommandwindow,enter:

nqcmddcoreapplication_OH1291352497uweblogicsc:\temp\aggregates.sql

dIstheODBCdatasourcenamefortheOracleBIServertowhichyouwanttoconnect.

uUsername

sSQLscriptfileyoucreatedusingtheAggregatePersistencewizard.Forthistutorialitisc:\temp\aggregate.sql

3.Enterwelcome1asthepasswordandpressEnter.

4.WaittillyougetStatementexecutesucceededmessage.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 12/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

YoucompletedrunningthenqcmdcommandforcreatingaggregateswithAggregatePersistenceWizard..

Note:Ifthestatementexecutionfailed,makesureyoudonothaveanysummarytablesinthedatabase,BusinessModel
layer,andinthePhysicallayerforthedimensionsyouareusing,priortorunningthenqcmdcommand.Youcanusethe
Deleteaggregatescommandtodeletethem.

VerifyingthattheAggregateswereSuccessfullyCreated

Inthissectionyouwillcheckwhetheralltheaggregatesweresuccessfullycreated.

VerifyingtheAggregatesinPhysicalLayer
1.CloseandopentheBIAdministrationToolinonlinemode.InthePhysicalLayer,ensurethattheaggregateswere
createdinBISAMPLE_EXAschema.Thereshouldbeonenewag_BISAMPLE_EXAaggregatetablewiththe
columnsyouselectedforaggregation.

2.ScrolldownthePhysicalLayerandyoushouldhavethreedimensionaggregatestablesbeginningwithSA_.One
foreachdimensionselected.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 13/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

3.ViewcompanynamesfromOfficesdimensionaggregatetable.Checkoutobjectswhenprompted.

4.UpdaterowcounttoseethenumberofrowsforFactaggregate.Thereare648rowsinthetable.Checkoutobjects
whenprompted.

5.Updaterowcountsforallthenewaggregatesandyoushouldseethefollowingrowcount.Checkoutobjectswhen
prompted.

ag_BISAMPLE_EXA684rows

SA_Month*79

SA_Product*9

SA_Offices*3

6.Doubleclickag_BISAMPLE_EXAtoopenthephysicaldialogbox,clicktheForeignKeystab.Verifythatthejoins
arecreatedbetweenag_BISAMPLE_EXAandthethreedimensionaggregates.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 14/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

7.Doubleclicktheforeignkeyforthemonthdimension,toviewtherelationshipinthePhysicalForeignKeydialog
box.

8.Doubleclicktheforeignkeyfortheproductbranddimension,toviewtherelationshipinthePhysicalForeignKey
dialogbox.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 15/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

SimilarlyyoucancheckforOfficeCompany.

VerifyingtheAggregatesintheBusinessModelandMappingLayer
1.InBusinessModelandMappingLayer,openSourcesfolderfor01SampleAppExa.F0SalesBaseMeasures
andconfirmthatanewlogicaltablecalled02SampleAppExaData
(ORCL)_BISAMPLE_Exa_ag_BISAMPLE_EXAiscreated.

2.OpenSourcesfolderforD0Timedimensionandconfirmthatanewlogicaltablecalled01SampleApp_Exa
Data(ORCL)_BISAMPLE_EXA_SA_Monthxxxxxxxiscreated.

3.OpenSourcesfolderforD1Products(LevelBasedHier)dimensionandconfirmthatanewlogicaltablecalled01
SampleAppData(ORCL)_BISAMPLE_SA_Productxxxxxxxiscreated.

4.OpenSourcesfolderforD3Officesdimensionandconfirmthatanewlogicaltablecalled02SampleAppExa
Data(ORCL)_BISAMPLE_Exa_SA_Officesxxxxxxxiscreated.

5.Doubleclickthe01SampleAppData(ORCL)_BISAMPLE_ag_BISAMPLElogicaltablesource.ClickCheck
Out.IntheGeneraltabandconfirmthatthe02SampleAppExaData
(ORCL)_BISAMPLE_Exa_ag_BISAMPLE_Exalogicaltablesourcemapstothe02SampleAppExaData
(ORCL).._BISAMPLE_Exa.ag_BISAMPLE_Exaphysicaltable.

6.ClicktheColumnMappingtabandconfirmthatthelogicalmeasurecolumnsmaptocorrespondingphysical
columnsintheag_BISAMPLE_Exaphysicaltable.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 16/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

7.ClicktheContenttabandconfirmthatthelogicallevelsaresetcorrectly.

8.ClickCanceltoclosetheLogicalTableSourcedialogbox.

RepeatforD0Time,D1Products(LevelBasedHier),andD3Officestoconfirmthatthelogicallevelsareset
correctlyforthenewlogicaltablesourcesgeneratedbytheaggregatepersistencewizard.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 17/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

9.Closealldialogboxes.Note:YoudonothavetodoanythinginthePresentationLayer.

CreatingAnalysistoUsetheAggregates

1.SignintoOracleBIasweblogicwithpasswordwelcome1.ReturntoAnalysesEditorandcreateanewanalysisinB
SampleSalesExasubjectarea.

2.Reloadservermetadataorifrequiredrestartalltheservices.

3.Createaquerywithallyourselections.Selectthefollowing:

Time.T02PerNameMonth

Products.P4Brand

Offices.D4Company

BaseFacts.1Revenue

BaseFacts.2BilledQuantity

BaseFacts.3DiscountAmount

BaseFacts.4PaidAmount

4.ClickResults.

Noticehowfastthequeryreturned.

5.Youcansavethequery.ClicktheAdministrationlinkatthetop.ClickManageSessionfromtheAdministrationtab.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 18/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

6.Inspectthequerystatementandconfirmthatthequeryusedthecolumnsyourequested.

7.ClickViewLogintheActioncolumn.

8.Scrolldownandinspectthequerylog.Confirmthatthequeryusedtheag_BISAMPLE_EXAaggregatetableandthe
relateddimensionSA_Month,SA_ProductBrand,andSA_OfficesCompanyaggregates.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 19/20
17/04/2017 CreateAggregatesUsingAggregatePersistenceWizardinOracleBI11g

Summary

Inthistutorial,youhavelearnedhowtocreateandmodelaggregatetablesusingtheAggregatePersistenceWizard.

Resources

LinktoadditionaltutorialsonBusinessIntelligenceonOLL
LinktotheproductpageonOTN

Credits

LeadCurriculumDeveloper:KasturiShekhar
OtherContributors:AlanLee,PravinJanardanam,PhilippeLions,andLalithaVenkataraman

http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11117/agp/agr.html 20/20

Potrebbero piacerti anche