SlideShare a Scribd company logo
SSIS : EVENT HANDLER, LOGGING AND
CONFIGURATION FILE
KIKI NOVIANDI – DATA PLATFORM MVP
Microsoft Data Platform MVP Since 2006
Founder SQL Server Indonesia User Group Community
ABOUT ME
My Name : Kiki Rizki Noviandi
Milis : sqlserver-indo@yahoogroups.com
https://www.facebook.com/groups/sqlserverindonesia
http://www.kwad5.com
https://mvp.microsoft.com/en-us/PublicProfile/33869?fullName=Kiki%20Rizki%20Noviandi
EVENT HANDLER, LOGGING & CONFIGURATION FILE
Basic aspects in
Datawarehouse
Integration
ETL
Package
Configurations
Error
Handling
Event
Handling /
tracking
Events
Logging /
Auditing
Package
Deployment
SQL SERVER INTEGRATION SERVICES (SSIS)
SQL Server Integration Services (SSIS)
ETL = Extract – Transform – Load
Get the data from
source system as
efficiently as possible
Source Destination
Perform
Calculations on the
data
Load the data in the
target storage
Reasons
 Failure of ancestors control
 Truncation or source/destination
connection issue
 Conversion failure
 Issues from migrating files and
data
 Package has an error due to
privileges of OS controls
 Other failure reasons
Package task failed !!!!
SQL Server Integration Services (SSIS)
Error Handling in SSIS
Error Handling in SSIS
Control Flow:
 Add a failure constraint and redirects the workflow to an alternate
Data Flow:
 Send the row out to an error path by configuring the error output of
the Source/ Destination/Transformation as redirect to error row and
save it to review later.
 Use Event Handler: OnError event in a separate window. Write
custom script or just send an email to a team to notify the error.
SQL Server Integration Services (SSIS)
Logging in SSIS: Log providers
SQL Server Integration Services (SSIS)
Log Providers Description
Text File log provider writes log entries to ASCII text files in a
comma-separated value (CSV) format
SQL Server Profiler
log provider
writes traces that you can view using SQL
Server Profiler (.trc)
SQL Server log
provider
writes log entries to the sysssislog table in
a SQL Server database
Windows Event log
provider
writes entries to the Application log in the
Windows Event log on the local computer
XML File log writes log files to an XML file (.xml)
Event Handling in SSIS
Integration Services packages are event-driven. This means we can specify
routines to execute when a particular event occurs. An event can be the
completion of a task or an error that occurs during task execution.
SQL Server Integration Services (SSIS)
Event Handlers Description
OnError Generated as the result of an error condition
OnPreValidate Fired before Validation process starts
OnQueryCancel Fired when user clicks on cancel or during an executable to determine whether it
should stop running
OnTaskFailed Signals the failure of a task and typically follows OnError Event
OnPreExecute Indicates that an executable component is about to be launched
OnPostExecute Takes place after an executable component finishes running
SSIS Auditing
 Add task(s) to the Event Handlers of the package.
 Select auditing for the entire package or for a specific task.
 Select events OnError, OnPostExecution, OnVariableValueChanged etc.
 Inside every dataflow task add row count components after source and
target to track extracted and loaded row count.
 Add Variables at package level scope to store rowcount for each dataflow.
 Add Variables in the OnPostExecute event handler scope to store certain
information about DataFlow source/target (e.g. Query, TableName ...)
SQL Server Integration Services (SSIS)
SSIS Auditing:
Helps to answer the following questions
 Which package was run and for how long?
 Who owns the package? Or who modified the package?
 When was the package executed?
 What kind of data and how many records were written or changed by
ETL?
 What kind of errors and how many errors occurred?
SQL Server Integration Services (SSIS)
Benefits that Custom Auditing and Logging can bring to your ETL
process
 Help you provide regulatory compliance
 Provide a deep understanding of database activity and additional
insight into data anomalies that may occur
 Can help answer important questions like, “When was that row last
updated?”
 help you identify specific data for targeted rollbacks
SQL Server Integration Services (SSIS)
Logging vs Custom Auditing
SQL Server Integration Services (SSIS)
Logging Custom Auditing
o Captures Metadata- Information
package execution itself
o Captures Information about data,
along with package metadata
o Errors encountered, Execution Time
package, Data bytes, data flow buffer
details, Machine name, Package
Task name
o Row counts of Extracts, Inserts,
Updates, Deletes and Errors, you can
default the status of the changed
and package execution
o Choose the Log providers and its
location
o Use Execute SQL task to define
variables , parameter binding, and
assigning values to the parameters
o Provides limited information on the
package
o Designed for DBAs/ Users who can
query and request for more
information about the data
Question:
SQL Server Integration Services (SSIS)
If Change Data Capture (CDC)
reads and tracks every Historical
data and net changes from SQL
Server transaction logs, then
whey not use CDC for Auditing?
SQL Server Integration Services (SSIS)
Answer: There’s a downside to this
1. The amount of history data can become huge fast
2. Does not return all information about the changes you
might need, for e.g. who made the change, when and
how? (when a record is deleted or updated)
3. Delay possible: The history data takes some time to catch
up, because it is based on the transaction logs and the
operation is asynchronous.
4. It depends on the SQL Server Agent. If the Agent is not
running or crashes, no history is being tracked.
Longer running package? How would you optimize the Package Execution?
 Parallel execution of SSIS tasks
 In case of Incremental load, Use Execute SQL task instead of OLEDB Command
transformation to process the updated/ new inserts
 Avoid processing the redundant columns in the data flow task
 Keep notice of buffers and execution tree
 Avoid using checkpoints while auditing SSIS package as they cannot store variables as
Type objects and cannot integrate with, or are most often ignored by event handlers
 Use Lookup, Conditional split to customize the SCD work flow
 Enable Error handling and logging on package failure
SQL Server Integration Services (SSIS)
Key Components in SSIS Package Custom Auditing
SQL Server Integration Services (SSIS)
ETL: Data warehouse tables (Staging,
Dimensions, Facts, Data marts)
Slowly Changing Dimensions Type 1/2
Extract Meta data and Row counts (DML
Operations)
Parent-Package Configuration
On-Error Event Handler to Capture Error message
Audit SSIS
Package
DEMO
An Audit table was structured by defining the components with the required information
regarding the Metadata and the transactional records.
Attributes Definition
Audit Key A global unique ID assigned to every execution of
ETL package or packages in the target table. Usually
it is an auto identity integer starting from ‘1’
ParentAuditkey Surrogate ID assigned to the execution of child
packages as metadata. ID inherited from the audit
key of master package. Batch/ Load ID mapped with
the process of every loads/ updates
PkgName assigns the Name of every Corresponding Package
executed including Master package and child
packages.
PkgID Internal GUID of every SSIS package
ExecStartDT Start time of package execution
Demo (contd.)
Attributes Definition
ExecStopDT End time of package execution
TableName Assigns the table name when package executes to
define or populate a table.
PkgName assigns the Name of every Corresponding Package
executed including Master package and child
packages.
ExecutionInstanceGUID Contains the Global Unique ID for every process,
generated by SSIS
ExtractRowCnt Contains the Count of records extracted from the
source file
InsertRowCnt Contains the Count of Inserted Records in Staging
and Dimension tables by the ETL process.
UpdateRowCnt: Contains the count of updated records, especially
in dimension Tables which uses the SCD Type II
functionality.
Demo (contd.)
Attributes Definition
ErrorRowCnt Contains the records which were erroneous or not
processed in ETL
TableInitialRowCnt Contains the number of records initially existing in
any staging and Dimension table
TableFinalRowCnt Contains the total number of records in any staging
and Dimension table after inserted , updated or
deleted in the execution process
DeleteRowCnt Contains the number records deleted in the ETL
process
SuccessfullyProcessingInd determines the status of execution of every ETL. If
successfully executed then sets ‘Y’. Default is set to
‘N’.
 Master package (Capturing Meta data)
Demo (contd.): Workflow
Execute SQL task that checks for the number of rows affected and inserts a Temporary
Dummy row in the beginning of the Audit table
Add Audit key and Parent Audit Key variables and add Execute SQL task that Stores
the highest value of Audit key in the parameter.
Add Execute SQL task which populates the Meta data in the Audit table. In the Task
Editor connect to the target database and write a T-SQL query to insert the Meta data
to the defined Parameters including Audit and Parent audit keys
 Master package (calling child packages in data warehouse)
Demo (contd.): Workflow
Add the Execute Package Task to call the Child package (e.g Audit package of a
Staging table) which processes the loading and auditing of the first Staging table
Add the Execute Package Task to call the Child package (e.g Audit package of a
Dimension table) which processes the loading and auditing of the firs Dicmension table
updates the Metadata specifically the end time of the execution and success status of
the execution process in the audit table
 SQL Server Integration Services is an exceptionally high performance integration
and transformation tool
 Customize the Auditing using Execute SQL tasks, Row counts, parameters, system
package variables to capture transactional information and metadata (DMLs)
 Recommended using an alternative to SCD transform component to preserve
historical record and counts in Dimension tables if implementing SCD Type 2
 Implement Error capturing strategies in Data flow and Control flow tasks
 Unless required, limit the use of Event handlers to OnError and/ or OnTaskFailed
events as it carries a large I/O overhead and can slow the application performance
dramatically
 Use Script component and Script task to customize the error information at the
package level and at individual task flow
TAKE AWAYS
QUESTION ?

More Related Content

Similar to Ssis event handler

Ssis2008 120710214348-phpapp02
Ssis2008 120710214348-phpapp02Ssis2008 120710214348-phpapp02
Ssis2008 120710214348-phpapp02
sumitkumar3201
 
Ssis 2008
Ssis 2008Ssis 2008
Ssis 2008
maha2886
 
Oracle RI ETL process overview.
Oracle RI ETL process overview.Oracle RI ETL process overview.
Oracle RI ETL process overview.
Puneet Kala
 
B Woodward Portfolio
B Woodward PortfolioB Woodward Portfolio
B Woodward Portfolio
bwoodward
 
Microsoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbaiMicrosoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbai
Unmesh Baile
 
MMYERS Portfolio
MMYERS PortfolioMMYERS Portfolio
MMYERS Portfolio
Mike Myers
 
Ssis Best Practices Israel Bi U Ser Group Itay Braun
Ssis Best Practices   Israel Bi U Ser Group   Itay BraunSsis Best Practices   Israel Bi U Ser Group   Itay Braun
Ssis Best Practices Israel Bi U Ser Group Itay Braun
sqlserver.co.il
 
To Study E T L ( Extract, Transform, Load) Tools Specially S Q L Server I...
To Study  E T L ( Extract, Transform, Load) Tools Specially  S Q L  Server  I...To Study  E T L ( Extract, Transform, Load) Tools Specially  S Q L  Server  I...
To Study E T L ( Extract, Transform, Load) Tools Specially S Q L Server I...
Shahzad
 
7\9 SSIS 2008R2_Training - Script Task
7\9 SSIS 2008R2_Training - Script Task7\9 SSIS 2008R2_Training - Script Task
7\9 SSIS 2008R2_Training - Script Task
Pramod Singla
 
Tracing Sql Server 2005
Tracing Sql Server 2005Tracing Sql Server 2005
Tracing Sql Server 2005
sqlserver.co.il
 
Advanced integration services on microsoft ssis 1
Advanced integration services on microsoft ssis 1Advanced integration services on microsoft ssis 1
Advanced integration services on microsoft ssis 1
Skillwise Group
 
Building the DW - ETL
Building the DW - ETLBuilding the DW - ETL
Building the DW - ETL
ganblues
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
Syed Asrarali
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
Syed Asrarali
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
Mark Leith
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
Mark Leith
 
David Weston SSIS Portfolio
David Weston SSIS PortfolioDavid Weston SSIS Portfolio
David Weston SSIS Portfolio
dlweston
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
rainynovember12
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012
Steve Xu
 
Test Strategy Utilising Mc Useful Tools
Test Strategy Utilising Mc Useful ToolsTest Strategy Utilising Mc Useful Tools
Test Strategy Utilising Mc Useful Tools
mcthedog
 

Similar to Ssis event handler (20)

Ssis2008 120710214348-phpapp02
Ssis2008 120710214348-phpapp02Ssis2008 120710214348-phpapp02
Ssis2008 120710214348-phpapp02
 
Ssis 2008
Ssis 2008Ssis 2008
Ssis 2008
 
Oracle RI ETL process overview.
Oracle RI ETL process overview.Oracle RI ETL process overview.
Oracle RI ETL process overview.
 
B Woodward Portfolio
B Woodward PortfolioB Woodward Portfolio
B Woodward Portfolio
 
Microsoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbaiMicrosoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbai
 
MMYERS Portfolio
MMYERS PortfolioMMYERS Portfolio
MMYERS Portfolio
 
Ssis Best Practices Israel Bi U Ser Group Itay Braun
Ssis Best Practices   Israel Bi U Ser Group   Itay BraunSsis Best Practices   Israel Bi U Ser Group   Itay Braun
Ssis Best Practices Israel Bi U Ser Group Itay Braun
 
To Study E T L ( Extract, Transform, Load) Tools Specially S Q L Server I...
To Study  E T L ( Extract, Transform, Load) Tools Specially  S Q L  Server  I...To Study  E T L ( Extract, Transform, Load) Tools Specially  S Q L  Server  I...
To Study E T L ( Extract, Transform, Load) Tools Specially S Q L Server I...
 
7\9 SSIS 2008R2_Training - Script Task
7\9 SSIS 2008R2_Training - Script Task7\9 SSIS 2008R2_Training - Script Task
7\9 SSIS 2008R2_Training - Script Task
 
Tracing Sql Server 2005
Tracing Sql Server 2005Tracing Sql Server 2005
Tracing Sql Server 2005
 
Advanced integration services on microsoft ssis 1
Advanced integration services on microsoft ssis 1Advanced integration services on microsoft ssis 1
Advanced integration services on microsoft ssis 1
 
Building the DW - ETL
Building the DW - ETLBuilding the DW - ETL
Building the DW - ETL
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
 
David Weston SSIS Portfolio
David Weston SSIS PortfolioDavid Weston SSIS Portfolio
David Weston SSIS Portfolio
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012
 
Test Strategy Utilising Mc Useful Tools
Test Strategy Utilising Mc Useful ToolsTest Strategy Utilising Mc Useful Tools
Test Strategy Utilising Mc Useful Tools
 

More from Kiki Noviandi

Power bi overview
Power bi overview Power bi overview
Power bi overview
Kiki Noviandi
 
SSIS: Flow tasks, containers and precedence constraints
SSIS: Flow tasks, containers and precedence constraintsSSIS: Flow tasks, containers and precedence constraints
SSIS: Flow tasks, containers and precedence constraints
Kiki Noviandi
 
Developing (KPI) Key Performance Indicators
Developing (KPI) Key Performance IndicatorsDeveloping (KPI) Key Performance Indicators
Developing (KPI) Key Performance Indicators
Kiki Noviandi
 
Sql server master data services
Sql server master data servicesSql server master data services
Sql server master data services
Kiki Noviandi
 
SSIS : Ftp and script task
SSIS : Ftp and script taskSSIS : Ftp and script task
SSIS : Ftp and script task
Kiki Noviandi
 
Cyber crime Bani Umar bintaro
Cyber crime   Bani Umar bintaroCyber crime   Bani Umar bintaro
Cyber crime Bani Umar bintaro
Kiki Noviandi
 
Database overview
Database  overviewDatabase  overview
Database overview
Kiki Noviandi
 
Query and operators optimization
Query and operators optimizationQuery and operators optimization
Query and operators optimization
Kiki Noviandi
 
Sql in memory database
Sql in memory databaseSql in memory database
Sql in memory database
Kiki Noviandi
 
Sql performance tools
Sql performance toolsSql performance tools
Sql performance tools
Kiki Noviandi
 

More from Kiki Noviandi (10)

Power bi overview
Power bi overview Power bi overview
Power bi overview
 
SSIS: Flow tasks, containers and precedence constraints
SSIS: Flow tasks, containers and precedence constraintsSSIS: Flow tasks, containers and precedence constraints
SSIS: Flow tasks, containers and precedence constraints
 
Developing (KPI) Key Performance Indicators
Developing (KPI) Key Performance IndicatorsDeveloping (KPI) Key Performance Indicators
Developing (KPI) Key Performance Indicators
 
Sql server master data services
Sql server master data servicesSql server master data services
Sql server master data services
 
SSIS : Ftp and script task
SSIS : Ftp and script taskSSIS : Ftp and script task
SSIS : Ftp and script task
 
Cyber crime Bani Umar bintaro
Cyber crime   Bani Umar bintaroCyber crime   Bani Umar bintaro
Cyber crime Bani Umar bintaro
 
Database overview
Database  overviewDatabase  overview
Database overview
 
Query and operators optimization
Query and operators optimizationQuery and operators optimization
Query and operators optimization
 
Sql in memory database
Sql in memory databaseSql in memory database
Sql in memory database
 
Sql performance tools
Sql performance toolsSql performance tools
Sql performance tools
 

Recently uploaded

14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 

Recently uploaded (20)

14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 

Ssis event handler

  • 1. SSIS : EVENT HANDLER, LOGGING AND CONFIGURATION FILE KIKI NOVIANDI – DATA PLATFORM MVP
  • 2. Microsoft Data Platform MVP Since 2006 Founder SQL Server Indonesia User Group Community ABOUT ME My Name : Kiki Rizki Noviandi Milis : sqlserver-indo@yahoogroups.com https://www.facebook.com/groups/sqlserverindonesia http://www.kwad5.com https://mvp.microsoft.com/en-us/PublicProfile/33869?fullName=Kiki%20Rizki%20Noviandi
  • 3. EVENT HANDLER, LOGGING & CONFIGURATION FILE
  • 4. Basic aspects in Datawarehouse Integration ETL Package Configurations Error Handling Event Handling / tracking Events Logging / Auditing Package Deployment SQL SERVER INTEGRATION SERVICES (SSIS)
  • 5. SQL Server Integration Services (SSIS) ETL = Extract – Transform – Load Get the data from source system as efficiently as possible Source Destination Perform Calculations on the data Load the data in the target storage
  • 6. Reasons  Failure of ancestors control  Truncation or source/destination connection issue  Conversion failure  Issues from migrating files and data  Package has an error due to privileges of OS controls  Other failure reasons Package task failed !!!! SQL Server Integration Services (SSIS) Error Handling in SSIS
  • 7. Error Handling in SSIS Control Flow:  Add a failure constraint and redirects the workflow to an alternate Data Flow:  Send the row out to an error path by configuring the error output of the Source/ Destination/Transformation as redirect to error row and save it to review later.  Use Event Handler: OnError event in a separate window. Write custom script or just send an email to a team to notify the error. SQL Server Integration Services (SSIS)
  • 8. Logging in SSIS: Log providers SQL Server Integration Services (SSIS) Log Providers Description Text File log provider writes log entries to ASCII text files in a comma-separated value (CSV) format SQL Server Profiler log provider writes traces that you can view using SQL Server Profiler (.trc) SQL Server log provider writes log entries to the sysssislog table in a SQL Server database Windows Event log provider writes entries to the Application log in the Windows Event log on the local computer XML File log writes log files to an XML file (.xml)
  • 9. Event Handling in SSIS Integration Services packages are event-driven. This means we can specify routines to execute when a particular event occurs. An event can be the completion of a task or an error that occurs during task execution. SQL Server Integration Services (SSIS) Event Handlers Description OnError Generated as the result of an error condition OnPreValidate Fired before Validation process starts OnQueryCancel Fired when user clicks on cancel or during an executable to determine whether it should stop running OnTaskFailed Signals the failure of a task and typically follows OnError Event OnPreExecute Indicates that an executable component is about to be launched OnPostExecute Takes place after an executable component finishes running
  • 10. SSIS Auditing  Add task(s) to the Event Handlers of the package.  Select auditing for the entire package or for a specific task.  Select events OnError, OnPostExecution, OnVariableValueChanged etc.  Inside every dataflow task add row count components after source and target to track extracted and loaded row count.  Add Variables at package level scope to store rowcount for each dataflow.  Add Variables in the OnPostExecute event handler scope to store certain information about DataFlow source/target (e.g. Query, TableName ...) SQL Server Integration Services (SSIS)
  • 11. SSIS Auditing: Helps to answer the following questions  Which package was run and for how long?  Who owns the package? Or who modified the package?  When was the package executed?  What kind of data and how many records were written or changed by ETL?  What kind of errors and how many errors occurred? SQL Server Integration Services (SSIS)
  • 12. Benefits that Custom Auditing and Logging can bring to your ETL process  Help you provide regulatory compliance  Provide a deep understanding of database activity and additional insight into data anomalies that may occur  Can help answer important questions like, “When was that row last updated?”  help you identify specific data for targeted rollbacks SQL Server Integration Services (SSIS)
  • 13. Logging vs Custom Auditing SQL Server Integration Services (SSIS) Logging Custom Auditing o Captures Metadata- Information package execution itself o Captures Information about data, along with package metadata o Errors encountered, Execution Time package, Data bytes, data flow buffer details, Machine name, Package Task name o Row counts of Extracts, Inserts, Updates, Deletes and Errors, you can default the status of the changed and package execution o Choose the Log providers and its location o Use Execute SQL task to define variables , parameter binding, and assigning values to the parameters o Provides limited information on the package o Designed for DBAs/ Users who can query and request for more information about the data
  • 14. Question: SQL Server Integration Services (SSIS) If Change Data Capture (CDC) reads and tracks every Historical data and net changes from SQL Server transaction logs, then whey not use CDC for Auditing?
  • 15. SQL Server Integration Services (SSIS) Answer: There’s a downside to this 1. The amount of history data can become huge fast 2. Does not return all information about the changes you might need, for e.g. who made the change, when and how? (when a record is deleted or updated) 3. Delay possible: The history data takes some time to catch up, because it is based on the transaction logs and the operation is asynchronous. 4. It depends on the SQL Server Agent. If the Agent is not running or crashes, no history is being tracked.
  • 16. Longer running package? How would you optimize the Package Execution?  Parallel execution of SSIS tasks  In case of Incremental load, Use Execute SQL task instead of OLEDB Command transformation to process the updated/ new inserts  Avoid processing the redundant columns in the data flow task  Keep notice of buffers and execution tree  Avoid using checkpoints while auditing SSIS package as they cannot store variables as Type objects and cannot integrate with, or are most often ignored by event handlers  Use Lookup, Conditional split to customize the SCD work flow  Enable Error handling and logging on package failure SQL Server Integration Services (SSIS)
  • 17. Key Components in SSIS Package Custom Auditing SQL Server Integration Services (SSIS) ETL: Data warehouse tables (Staging, Dimensions, Facts, Data marts) Slowly Changing Dimensions Type 1/2 Extract Meta data and Row counts (DML Operations) Parent-Package Configuration On-Error Event Handler to Capture Error message Audit SSIS Package
  • 18. DEMO An Audit table was structured by defining the components with the required information regarding the Metadata and the transactional records. Attributes Definition Audit Key A global unique ID assigned to every execution of ETL package or packages in the target table. Usually it is an auto identity integer starting from ‘1’ ParentAuditkey Surrogate ID assigned to the execution of child packages as metadata. ID inherited from the audit key of master package. Batch/ Load ID mapped with the process of every loads/ updates PkgName assigns the Name of every Corresponding Package executed including Master package and child packages. PkgID Internal GUID of every SSIS package ExecStartDT Start time of package execution
  • 19. Demo (contd.) Attributes Definition ExecStopDT End time of package execution TableName Assigns the table name when package executes to define or populate a table. PkgName assigns the Name of every Corresponding Package executed including Master package and child packages. ExecutionInstanceGUID Contains the Global Unique ID for every process, generated by SSIS ExtractRowCnt Contains the Count of records extracted from the source file InsertRowCnt Contains the Count of Inserted Records in Staging and Dimension tables by the ETL process. UpdateRowCnt: Contains the count of updated records, especially in dimension Tables which uses the SCD Type II functionality.
  • 20. Demo (contd.) Attributes Definition ErrorRowCnt Contains the records which were erroneous or not processed in ETL TableInitialRowCnt Contains the number of records initially existing in any staging and Dimension table TableFinalRowCnt Contains the total number of records in any staging and Dimension table after inserted , updated or deleted in the execution process DeleteRowCnt Contains the number records deleted in the ETL process SuccessfullyProcessingInd determines the status of execution of every ETL. If successfully executed then sets ‘Y’. Default is set to ‘N’.
  • 21.  Master package (Capturing Meta data) Demo (contd.): Workflow Execute SQL task that checks for the number of rows affected and inserts a Temporary Dummy row in the beginning of the Audit table Add Audit key and Parent Audit Key variables and add Execute SQL task that Stores the highest value of Audit key in the parameter. Add Execute SQL task which populates the Meta data in the Audit table. In the Task Editor connect to the target database and write a T-SQL query to insert the Meta data to the defined Parameters including Audit and Parent audit keys
  • 22.  Master package (calling child packages in data warehouse) Demo (contd.): Workflow Add the Execute Package Task to call the Child package (e.g Audit package of a Staging table) which processes the loading and auditing of the first Staging table Add the Execute Package Task to call the Child package (e.g Audit package of a Dimension table) which processes the loading and auditing of the firs Dicmension table updates the Metadata specifically the end time of the execution and success status of the execution process in the audit table
  • 23.  SQL Server Integration Services is an exceptionally high performance integration and transformation tool  Customize the Auditing using Execute SQL tasks, Row counts, parameters, system package variables to capture transactional information and metadata (DMLs)  Recommended using an alternative to SCD transform component to preserve historical record and counts in Dimension tables if implementing SCD Type 2  Implement Error capturing strategies in Data flow and Control flow tasks  Unless required, limit the use of Event handlers to OnError and/ or OnTaskFailed events as it carries a large I/O overhead and can slow the application performance dramatically  Use Script component and Script task to customize the error information at the package level and at individual task flow TAKE AWAYS

Editor's Notes

  1. Business Intelligence Development Studio Control Flow Over View Connection Managers Using the Execute SQL Task Using the Script Task Working with Variables Working with Precedence Constraints Using Loop Containers Logging and Error Handling