33
DAT 360: DAT 360: DTS in SQL Server 2000 Best DTS in SQL Server 2000 Best Practices Practices Euan Garden Euan Garden Group Manager, SQL Server Group Manager, SQL Server Microsoft Corporation Microsoft Corporation

DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Embed Size (px)

Citation preview

Page 1: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

DAT 360:DAT 360:DTS in SQL Server 2000 Best PracticesDTS in SQL Server 2000 Best Practices

Euan GardenEuan Garden

Group Manager, SQL ServerGroup Manager, SQL Server

Microsoft CorporationMicrosoft Corporation

Page 2: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Technologies CoveredTechnologies Covered

• SQL Server 2000 DTSSQL Server 2000 DTS• SQL Server 2000 SQL Server 2000 • SQL Server 2000 Analysis ServicesSQL Server 2000 Analysis Services• Transact SQL Transact SQL • ActiveX ScriptingActiveX Scripting• SQL Server Accelerator for Business SQL Server Accelerator for Business

Intelligence (SSABI)Intelligence (SSABI)

Page 3: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

““Best Practices” AgendaBest Practices” Agenda

• Package DesignPackage Design• Data LoadingData Loading• Analysis Services ManagementAnalysis Services Management• Auditing and Error HandlingAuditing and Error Handling• Putting it all together - SSABIPutting it all together - SSABI

Page 4: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Package Design PracticesPackage Design Practices

Drive Packages through MetadataDrive Packages through Metadata– Dynamic Properties TaskDynamic Properties Task• Access to Property of any objectAccess to Property of any object• Can get property values from .INI, SQL, etc.Can get property values from .INI, SQL, etc.

– Global VariablesGlobal Variables• Building blocks for communicating metadataBuilding blocks for communicating metadata• Populated by the Dynamic Properties TaskPopulated by the Dynamic Properties Task

– UDL FilesUDL Files• Configurable File for storing Connection Configurable File for storing Connection

InformationInformation

Page 5: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Package Design PracticesPackage Design Practices

Designing Modular Parent/Child PackagesDesigning Modular Parent/Child Packages– Execute Package TaskExecute Package Task• Allows joining of TransactionAllows joining of Transaction• Supports passing of GlobalsSupports passing of Globals

– Execute through COM AutomationExecute through COM Automation• LoadfromSQLServer, LoadfromRepository, LoadfromSQLServer, LoadfromRepository,

LoadfromStorageFile methodsLoadfromStorageFile methods• Eliminates Version Affinity Eliminates Version Affinity • Programmatic access to Package objectsProgrammatic access to Package objects

Page 6: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Parent/Child PackagesParent/Child Packages

Parent PackageParent Package

Fact ETLFact ETLDimension Dimension ETLETL

Global Variables, Global Variables, Return CodeReturn Code

Cube Cube ProcessingProcessing

Global Variables, Global Variables, Return CodeReturn Code

Page 7: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Parent/Child Package(s) Parent/Child Package(s) and UDL Filesand UDL Files

demodemo

Page 8: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

““Best Practices” AgendaBest Practices” Agenda

• Package DesignPackage Design• Data LoadingData Loading• Analysis Services ManagementAnalysis Services Management• Auditing and Error HandlingAuditing and Error Handling• Putting it all together - SSABIPutting it all together - SSABI

Page 9: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Data Loading PracticesData Loading Practices

• Leveraging High Perf. Interface(s)Leveraging High Perf. Interface(s)– Execute SQL Task Rowset ParameterExecute SQL Task Rowset Parameter– ADO Disconnected Recordsets ADO Disconnected Recordsets – DTS Multiphase Data PumpDTS Multiphase Data Pump

• BenefitsBenefits– Cache Rowset on Client (fast lookups)Cache Rowset on Client (fast lookups)– Hold updates on ClientHold updates on Client– Conditional Inserts/Updates w/out Data Conditional Inserts/Updates w/out Data

Driven QueryDriven Query

Page 10: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Conditional Inserts Conditional Inserts and Updatesand Updates

demodemo

Page 11: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Advanced PracticesAdvanced Practices

• ApproachesApproaches– Multi-Threaded Data LoadingMulti-Threaded Data Loading– Task LoopingTask Looping– Communication through Global VariablesCommunication through Global Variables

• BenefitsBenefits– Higher Utilization during Data LoadHigher Utilization during Data Load– Compressed Data Loading WindowCompressed Data Loading Window– Easy Orchestration within DTSEasy Orchestration within DTS

Page 12: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Multi-Threaded Data Multi-Threaded Data File LoadFile Load

demodemo

Page 13: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

““Best Practices” AgendaBest Practices” Agenda

• Package DesignPackage Design• Data LoadingData Loading• Analysis Services ManagementAnalysis Services Management• Auditing and Error HandlingAuditing and Error Handling• Putting it all together - SSABIPutting it all together - SSABI

Page 14: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Analysis Services and DTSAnalysis Services and DTS• Analysis Services Processing TaskAnalysis Services Processing Task

– Supports Processing of all OLAP ObjectsSupports Processing of all OLAP Objects– Customizable Processing through TreeKey Customizable Processing through TreeKey

and other propertiesand other properties• Prominent PropertiesProminent Properties

– TreeKey TreeKey ServerName\DBName\CubeFolder\CubeName ServerName\DBName\CubeFolder\CubeName

– ItemType ItemType 1=OLAP DB, 4=Cube, 7=Partition and 1=OLAP DB, 4=Cube, 7=Partition and

9=Dimension 9=Dimension – ProcessingOption ProcessingOption

0=Full Process, 1=Refresh Data and 0=Full Process, 1=Refresh Data and 2=Incremental Update 2=Incremental Update

Page 15: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Analysis Services and DTSAnalysis Services and DTS• Decision Support ObjectsDecision Support Objects

– Provide access to the AS Management Provide access to the AS Management InterfacesInterfaces

– Automated via AxScriptAutomated via AxScript– Supports Partition ManagementSupports Partition Management• CreatingCreating• CloningCloning• DroppingDropping• Merging of partitionsMerging of partitions

– Should be an OLAP Administrator to UseShould be an OLAP Administrator to Use

Page 16: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

DSO Object HierarchyDSO Object Hierarchy

Page 17: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Dynamic Partition Dynamic Partition Creation and Creation and ProcessingProcessing

demodemo

Page 18: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Analysis Services and DTSAnalysis Services and DTS

BenefitsBenefits– Opportunity to Dynamically Manage Opportunity to Dynamically Manage

Partitions and other ObjectsPartitions and other Objects

– Support for Dynamic ProcessingSupport for Dynamic Processing

– Inclusion in the BI Solution LoadInclusion in the BI Solution Load

Page 19: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

““Best Practices” AgendaBest Practices” Agenda

• Package DesignPackage Design• Data LoadingData Loading• Analysis Services ManagementAnalysis Services Management• Auditing and Error HandlingAuditing and Error Handling• Putting it all together - SSABIPutting it all together - SSABI

Page 20: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Auditing and Error HandlingAuditing and Error Handling• Logging OptionsLogging Options

– Logging to MSDBLogging to MSDB– Logging to Event LogLogging to Event Log– Logging to Text FileLogging to Text File

• Enabled through PropertiesEnabled through Properties– Granularity at Step and Package LevelGranularity at Step and Package Level

• Enabled through Data Pump PropertiesEnabled through Data Pump Properties– Capture Erroneous DataCapture Erroneous Data

Page 21: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Auditing and Error HandlingAuditing and Error Handling

Scripting OptionsScripting Options• DTSPackageLog Object DTSPackageLog Object

– WriteTaskRecord()WriteTaskRecord()– WriteStringToLog()WriteStringToLog()

Lineage OptionsLineage Options• DTS Lineage Global VariablesDTS Lineage Global Variables

– DTSLineage_FullDTSLineage_Full– DTSLineage_ShortDTSLineage_Short

Page 22: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Custom Logging Custom Logging using Intrinsic DTS using Intrinsic DTS OptionsOptions

demodemo

Page 23: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Auditing and Error HandlingAuditing and Error HandlingMonitoring Execution – Simple as Writing SQLMonitoring Execution – Simple as Writing SQL

select select

package.name, package.description, package.name, package.description, step.stepname, step.stepname,

step.errorcode, step.errordescription step.errorcode, step.errordescription

fromfrom

msdb..sysdtspackagelog package, msdb..sysdtspackagelog package, msdb..sysdtssteplog stepmsdb..sysdtssteplog step

wherewhere

package.lineagefull = step.lineagefull andpackage.lineagefull = step.lineagefull and

step.errorcode <> 0step.errorcode <> 0

Page 24: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

““Best Practices” AgendaBest Practices” Agenda

• Package DesignPackage Design• Data LoadingData Loading• Analysis Services ManagementAnalysis Services Management• Auditing and Error HandlingAuditing and Error Handling• Putting it all together - SSABIPutting it all together - SSABI

Page 25: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

ETLM Architecture OverviewETLM Architecture Overview

SourceSourceSystemsSystems

DTSDTS

ETLETL

Subject MatterSubject MatterDbDb

StagingStagingDbDb KPI’sKPI’s

CubesCubes

*.txt

DTS

DTS

DTSDTS

Page 26: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Loading Staging TablesLoading Staging Tables

• Source Data RequirementsSource Data Requirements– Cleansed, validated dataCleansed, validated data– Separate data file for each tableSeparate data file for each table– Data files are | delimited Data files are | delimited

• Data Load ProcessData Load Process– DTS Package calls the BULK INSERT T-SQL StatementDTS Package calls the BULK INSERT T-SQL Statement– BULK INSERT parameters controlled by DTS Package BULK INSERT parameters controlled by DTS Package

global variablesglobal variables

StagingStagingDbDb

*.txt

1|ABC Co.|110…DTS

DTS

Page 27: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

• Staging Data OptionsStaging Data Options– Inserts and Updates can be inferred or Inserts and Updates can be inferred or

indicatedindicated

– Slowly Changing Dimension supportSlowly Changing Dimension support

• Data Load ProcessData Load Process– DTS Package calls Stored ProceduresDTS Package calls Stored Procedures– Stored Procedures provide error Stored Procedures provide error

handlinghandling– Transform Data task uses Copy Transform Data task uses Copy

Column transformationColumn transformation

Loading Dimension and Fact Loading Dimension and Fact TablesTables

StagingStagingDbDb

DTS

DTS

Page 28: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Processing Dimensions and Processing Dimensions and CubesCubes

• DimensionsDimensions– Incremental vs. Full Incremental vs. Full

ProcessingProcessing

• CubesCubes– Data RefreshData Refresh– Incremental vs. Full Incremental vs. Full

ProcessingProcessing– Partitioning by MonthPartitioning by Month

DTS

DTS

KPI’sKPI’sCubesCubes

Page 29: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

SQL Server SQL Server Accelerator for Accelerator for Business IntelligenceBusiness Intelligence

demodemo

Page 30: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

For More InformationFor More Information• Encore DevelopmentEncore Development

www.encoredev.comwww.encoredev.com

• Professional Association for SQL Server Professional Association for SQL Server www.sqlpass.orgwww.sqlpass.org

• Professional SQL Server 2000 DTS Professional SQL Server 2000 DTS wrox press, www.wrox.comwrox press, www.wrox.com

• DTS newsgroupDTS newsgroupmicrosoft.public.sqlserver.dtsmicrosoft.public.sqlserver.dts

• SQLServer CentralSQLServer Centralwww.sqlservercentral.comwww.sqlservercentral.com

• SQLDTS Site SQLDTS Site www.sqldts.comwww.sqldts.com

• SQL Server Developers Network SQL Server Developers Network www.sqldev.netwww.sqldev.net

Page 31: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Questions?Questions? [email protected]@microsoft.com

Page 32: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

Don’t forget to complete the Don’t forget to complete the on-line Session Feedback form on-line Session Feedback form on the Attendee Web siteon the Attendee Web site

https://web.mseventseurope.com/teched/https://web.mseventseurope.com/teched/

Page 33: DAT 360: DTS in SQL Server 2000 Best Practices Euan Garden Group Manager, SQL Server Microsoft Corporation

© 2002 Microsoft Corporation. All rights reserved.© 2002 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.