Tải bản đầy đủ - 0 (trang)
Chapter 20. Report Execution and Processing

Chapter 20. Report Execution and Processing

Tải bản đầy đủ - 0trang

ManagingSchedules

SchedulesareusedwithinSSRStotriggerexecutionsof

subscriptionsandsnapshots,generallyclassifiedasevents.

Schedulescantriggeraone-timeevent,orcauseeventstorun

continuouslyatspecifiedintervalsmonthly,daily,orhourly.

SchedulescreateeventsontheReportServer.Actionswithin

theReportServer,suchasexpiringasnapshotorprocessinga

subscription,aretriggeredbytheevent.WhatSSRSactually

doesiscreateascheduledjobonthedatabaseserverthat

hoststheSSRSdatabase.TheSQLAgentthenrunsthejobs,

whichusuallycontainnothingmorethanthecommandto

executeastoredproceduretotriggeranevent.Theotherhalf

oftheSchedulingandDeliveryProcessorwithinSSRSisthe

ReportServerWindowsservicereferredtoasSQLServer

ReportingServicesunderservicesinControlPanel.

Thisserviceisresponsibleforqueryingthedatabaseserverfor

eventsandrunningtheprocessesthatthoseeventstrigger.

BothsidesoftheSchedulingandDeliveryProcessormustbe

enabledforittowork.IftheSQLAgentonthedatabaseserver

isturnedoff,thejobsdonotrun,hencetheeventsdonotfire

andthecorrespondingactionsarenottaken.IftheReport

Serverserviceisdown,thejobsshowthattheyran

successfully,butnoprocessingactuallyoccurs.



TypesofSchedules

TherearetwotypesofschedulesusedinSSRS:ashared

scheduleandareport-specificschedule.Therelationshipis

analogoustotherelationshipbetweenashareddatasourceand

acustomdatasource.Thesharedschedulecanbeusedto

triggeranumberofeventsthroughouttheReportServer.A



report-specificscheduleisusedforoneandonlyonespecific

event.Asecondeventmightoccuratexactlythesametime,

butasfarasSSRSisconcerned,itisadifferentschedule.

Becausetheyaresosimilarthequestionoftenbroughtupis,

"Whenshouldyouuseareport-specificscheduleoverashared

schedule?"Ingeneral,createareport-specificscheduleifa

sharedscheduledoesnotprovidethefrequencyorrecurrence

patternthatyouneed.

Table20.1detailsthedifferencebetweensharedschedulesand

report-specificschedules.

Table20.1.SharedVersusReport-SpecificSchedules







SharedSchedule



Permissionsneeded Needssystem-level

tocreate/modify



Report-Specific

Schedule

Canbecreatedby

individualusers



Canbetemporarily

disabled?



Cantemporarilypause Havetobemodifiedto

andthenresumeshared changethetime

schedules



Manageability



Aremanagedcentrally

fromtheSiteSettings

tabintheReport

ManagerorObject

Browser



Havetobemanaged

fromtheindividual

items



Customizable



Cannotbecustomized

foraspecificitem



Canbeeasilywithout

anyotherdownstream

implications



Creating/ModifyingSchedules

Theprocessforcreatingormodifyingschedulesisgenerallythe



samewhetheritisasharedorreport-specificschedule.The

onlydifferenceisthescope.Forthesharedschedule,itis

createdonceandcanbereferencedinasubscriptionor

propertypagewhenyouneedtospecifyscheduleinformation.

FromReportManagerorObjectExplorer,administratorscan

specifywhichitemsusethesharedschedule.Report-specific

schedulesarecreatedandreferencedbyonlythatonereport,

subscription,orreportexecutionoperationtodeterminecache

expirationorsnapshotupdates.

TocreateasharedscheduleusingSQLServerManagement

Studio,followthesesteps:

1. FromObjectExplorer,navigatetotheSharedSchedules

folder,right-clickonSharedSchedules,andselectNew

Schedule.

2. Enteranamefortheschedule.

3. 3.Selecthowoftenyouwantthescheduletorecurorselect

Onceforaone-timeevent.

4. ClickOK.



Alternatively,youcancreateasharedschedulefromReport

Managerbycompletingthefollowingsteps(seeFigure20.1):

1. NavigatetoSiteSettings.

2. ClickManageSharedSchedulesundertheOthersection

towardthebottomofthescreen.

3. ClickNewSchedule.



4. Enteranameandhowoftenthescheduleshouldrecur,and

thenclickOK.



Figure20.1.Creatinganewsharedschedulein

SSRS.



[Viewfullsizeimage]



Afterbeingcreated,aschedulecanbemodifiedatanytime.

Modifyingthescheduleofarunningprocess(subscription,

snapshot,andsoon)doesnotcausethatprocesstostop.Ifthe

processthatascheduletriggeredisalreadyrunning,modifying

thescheduleservesonlytostarttheprocessagainatthenew

time.

Deletingascheduledoesnotguaranteethattheeventsthatit



triggerswillstopfiring.Deletingasharedscheduleonlyserves

tocreatereport-specificschedulesforanyitemsthatreference

it.Abetterwaytostopascheduleistoexpireit,byputtingan

enddateonit.Expiredschedulesareindicatedassuchbythe

statusfield.Schedulesthathavebeenexpiredcanberestarted

byextendingtheenddate.

Anotheralternativeistopauseasharedschedule.Apaused

schedulecanberesumedatalaterdateandtime.Reportspecificschedulescannotbepaused.Pausingascheduleis

similartomodifyingit.Pausingthescheduleofaprocessthatis

alreadyrunningorofonethatisinqueueonlystopsthe

subsequentruns.Ithasnoeffectonthecurrentlyexecuting

process.



Note

Administratorscanpauseschedulesfrom

ReportManager.



Topauseasharedschedule,selectitfromthelistoftheReport

Managerschedules,andclickthePausebutton.Thesame

processisusedtodeleteasharedschedule.



ReportExecutionandProcessing

SSRS'sReportProcessorgenerallyexecutesreportsinathreestageprocess:

DatagatheringInvolvestheprocessusedtogetthe

reportdefinitionfromtheReportServerdatabase,initializes

parametersandvariablesthatareinexpressions,and

performsotherpreliminaryprocessingthatpreparesthe

reportfordata.Thedata-processingextensionthen

connectstothedatasourceandretrievesthedata.

LayoutprocessingCombinesthereportdatawiththe

reportlayoutfromthereportdefinition.Dataisprocessed

byrowforeachsection.Sectionsincludethereportheader

andfooter,groupheadersandfooters,anddetail.

Aggregatefunctionsandexpressionsarealsoprocessedat

thistime.

RenderingTakestheintermediateformatandthe

renderingextensionpaginatesthereportandprocesses

expressionsthatcannotbeprocessedduringtheexecution

stage.Thereportisthenrenderedintheappropriate

device-specificformat(MHTML,Excel,PDF,andsoon).

Dependingonthemethodofaccess,theserverdeterminesifit

needstoexecuteallthreeprocessesorifitcanskiponeortwo.

Thetrickisinthereporthistory.Iftheadministratorspecifies

thatthereportshouldberenderedfromasnapshotorcache,

thereportisrenderedfromtheintermediateformatstoredin

thedatabase.Otherwise,theReportServerstartsitsprocessing

fromthedatagatheringstage.Reportprocessingfordrillthroughreportsissimilar,exceptthatreportscanbeauto

generatedfrommodelsratherthanreportdefinitions.Data



processingisinitiatedthroughthemodeltoretrievedataof

interest.



ReportExecutionTimeouts

Thetimeittakestoprocessareportcanvarytremendously.

Whilereportsprocess,theytakeuptimeontheReportServer

andpossiblythereportdatasource.Asamatterofpractice,

mostlong-runningreportstakealongtimetoprocessduetoa

long-runningquery.

SSRSusestimeoutstosetanupperlimitonhowmuchtime

individualreportscantaketoprocess.Twokindsoftimeouts

areusedbySSRS.Thefirstkindisthequerytimeout.The

secondkindisthereportexecutiontimeout.

Querytimeoutsspecifyhowlonganindividualquerycantaketo

comebackfromthedatasource.Thisvalueisspecifiedinside

thereports,byspecifyingthetimeoutpropertywhilecreatinga

dataset.Querytimeoutscanalsoapplytodata-driven

subscriptions.

Thereportexecutiontimeoutistheamountoftimeareportcan

taketoprocess.Thisvalueisspecifiedatasystemlevel,and

canbeoverriddenforindividualreports.Tosetthissetting,click

theSiteSettingstabandmodifytheReportExecutionTimeout

property.Thedefaultvalueis1800seconds.

SSRSevaluatestheexecutiontimeoutforrunningjobsevery60

seconds.Whatthismeansisthateveryminute,SSRS

enumeratesthrougheveryrunningjobandcompareshowlong

ithasbeenrunningagainsthowlongitissupposedtorun.The

downsideofthisisthatreportsactuallyhaveabitmoretime

thanthespecifiedtimeoutvalueinwhichtorun.Ifthetimeout

forareportissetto30seconds,SSRSdoesnotchecktoseeif

itexceededthetimeoutuntil60seconds,sothereportactually



getsanadditional30secondsofruntime.



RunningProcesses

AprocessintheReportServerisalsocalledajob.Thetwo

kindsofjobsareuserjobsandsystemjobs.Userjobsarethose

jobsthatarestartedbyindividualusersorbyauser's

subscription.

Someexamplesofuserjobsincludethefollowing:

Runninganon-demandreport

Renderingareportfromasnapshot

Generatinganewsnapshot

Processingasubscription

SystemjobsarethosejobsthatarestartedbytheReport

Server,includingthefollowing:

Processingadata-drivensubscription

Schedulingagenerationofasnapshot

Schedulingreportexecution

Asmentionedintheprevioussection,SSRScomesbyevery60

secondsandchecksonthestatusofanyin-progressjobs.

Thesejobscouldbequeryingtheirdatasource,renderinginto

intermediateformat,orrenderingintofinalformat.Itdropsthe

statusofthesejobsintotheReportServerdatabase.This



generallymeansthatajobhastoberunningforatleast60

secondsforittobecanceledorviewed.Tocancelorview

runningjobs,clicktheManageJobslinkunderSiteSettings.

Fromhere,administratorscanviewuserandsystemjobsand

cancelanyrunningjob.



Note

Cancelingarunningjobdoesnotguarantee

thataqueryhasstoppedprocessingonthe

remotedataserver.Toavoidlong-running

queries,specifyatimeoutforthequeryduring

thereportdevelopmentphase.



LargeReports

Mostofthereportsshownsofarinthesamplesarefairlysmall

andeasytorun.However,intherealworld,youmightruninto

areportthat,whenrendered,equalshundredsofpages.For

thesereports,youneedtotakeintoaccountsomespecial

considerations.

First,theamountoftimeareporttakestoprocessisalmost

directlyproportionaltotheamountofrowsreturnedfromthe

databasequery,andhowlongittakestogetthoserowsback.

ItisagoodideatocheckwiththeDBAbeforerunninglongrunningqueriesagainstadatabase.Also,checktheexecution

planofthequerybeforerunningit.Perhapsfurtherindexing

canbedone.Lastly,don'tbringbackanymorerowsthan

needed.ModernRDBMsareverygoodatsortingandgrouping

data.LettheRDBMSgroupandsortthedatawhereitcan;this

savesCPUcyclesontheReportServeraswellasthenetwork



traffic.

Second,takeintoaccounttherenderingformat.Youshould

notethatdifferentrenderingextensionshavedifferenteffects

ontheReportServer.Thefastestextensionsandthosethatuse

theleastamountofRAMarethosewhoseoutputisessentially

textMHTML,CSV,andXML.ExcelandPDFareveryresource

intensive,whereasTIFFandJPEGfallinbetweenthetwo

extremes.

Third,takeintoaccountthedeliverymethodofthereport.Ifa

reportusespagination,itcanberenderedlikeanyotherreport.

ThedefaultrenderingformatisHTML,whichincludesasoft

pagebreak.Thepagebreakisincludedintentionallyand,in

effect,producesasortofpoorman'spaging.Ifareportis

extremelylarge,thishelpstodeliveritviabrowser.Ifthereport

isdeliveredviasubscriptions,itmakessensetodeployittoa

fileshareandlettheuser'sdesktopberesponsibleforopening

it.ThistakestheloadofftheReportServerandisthe

recommendedcourseofactionifusingPDForExcel.

Thefollowinglistincludessomegeneraltipstohelphandle

largereports:

Makesurethereportsupportspagination.

Runthereportasascheduledsnapshot,anddonotletitbe

runondemand.

Setthereporttouseashareddatasource.Shareddata

sourcescanbedisabled,ensuringthereportcannotberun

ondemand.

Limitaccesstothereporttoensurethatonlythosewho

needtorunitcanrunit.







Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 20. Report Execution and Processing

Tải bản đầy đủ ngay(0 tr)

×