SlideShare a Scribd company logo
1 of 24
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

What's hot

Building a Modern Data Warehouse - Deep Dive on Amazon Redshift
Building a Modern Data Warehouse - Deep Dive on Amazon RedshiftBuilding a Modern Data Warehouse - Deep Dive on Amazon Redshift
Building a Modern Data Warehouse - Deep Dive on Amazon RedshiftAmazon Web Services
 
Data Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesData Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesIvo Andreev
 
Data analytics introduction
Data analytics introductionData analytics introduction
Data analytics introductionamiyadash
 
Virtual Flink Forward 2020: Netflix Data Mesh: Composable Data Processing - J...
Virtual Flink Forward 2020: Netflix Data Mesh: Composable Data Processing - J...Virtual Flink Forward 2020: Netflix Data Mesh: Composable Data Processing - J...
Virtual Flink Forward 2020: Netflix Data Mesh: Composable Data Processing - J...Flink Forward
 
Informatica partitions
Informatica partitionsInformatica partitions
Informatica partitionssingh100
 
DMBOK 2.0 and other frameworks including TOGAF & COBIT - keynote from DAMA Au...
DMBOK 2.0 and other frameworks including TOGAF & COBIT - keynote from DAMA Au...DMBOK 2.0 and other frameworks including TOGAF & COBIT - keynote from DAMA Au...
DMBOK 2.0 and other frameworks including TOGAF & COBIT - keynote from DAMA Au...Christopher Bradley
 
Data and AI summit: data pipelines observability with open lineage
Data and AI summit: data pipelines observability with open lineageData and AI summit: data pipelines observability with open lineage
Data and AI summit: data pipelines observability with open lineageJulien Le Dem
 
DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...
DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...
DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...Lace Lofranco
 
Business Intelligence & Data Analytics– An Architected Approach
Business Intelligence & Data Analytics– An Architected ApproachBusiness Intelligence & Data Analytics– An Architected Approach
Business Intelligence & Data Analytics– An Architected ApproachDATAVERSITY
 
Building a modern data warehouse
Building a modern data warehouseBuilding a modern data warehouse
Building a modern data warehouseJames Serra
 
Date warehousing concepts
Date warehousing conceptsDate warehousing concepts
Date warehousing conceptspcherukumalla
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeDatabricks
 
Data Streaming in Big Data Analysis
Data Streaming in Big Data AnalysisData Streaming in Big Data Analysis
Data Streaming in Big Data AnalysisVincenzo Gulisano
 
Intro to Data Vault 2.0 on Snowflake
Intro to Data Vault 2.0 on SnowflakeIntro to Data Vault 2.0 on Snowflake
Intro to Data Vault 2.0 on SnowflakeKent Graziano
 
How does Apache DolphinScheduler (Incubator) support scheduling 100,000-level...
How does Apache DolphinScheduler (Incubator) support scheduling 100,000-level...How does Apache DolphinScheduler (Incubator) support scheduling 100,000-level...
How does Apache DolphinScheduler (Incubator) support scheduling 100,000-level...li David
 
Idiro Analytics - Analytics & Big Data
Idiro Analytics - Analytics & Big DataIdiro Analytics - Analytics & Big Data
Idiro Analytics - Analytics & Big DataIdiro Analytics
 
Data Quality Best Practices
Data Quality Best PracticesData Quality Best Practices
Data Quality Best PracticesDATAVERSITY
 
Informatica Pentaho Etl Tools Comparison
Informatica Pentaho Etl Tools ComparisonInformatica Pentaho Etl Tools Comparison
Informatica Pentaho Etl Tools ComparisonRoberto Espinosa
 

What's hot (20)

Building a Modern Data Warehouse - Deep Dive on Amazon Redshift
Building a Modern Data Warehouse - Deep Dive on Amazon RedshiftBuilding a Modern Data Warehouse - Deep Dive on Amazon Redshift
Building a Modern Data Warehouse - Deep Dive on Amazon Redshift
 
Data Warehouse Design and Best Practices
Data Warehouse Design and Best PracticesData Warehouse Design and Best Practices
Data Warehouse Design and Best Practices
 
Data analytics introduction
Data analytics introductionData analytics introduction
Data analytics introduction
 
Virtual Flink Forward 2020: Netflix Data Mesh: Composable Data Processing - J...
Virtual Flink Forward 2020: Netflix Data Mesh: Composable Data Processing - J...Virtual Flink Forward 2020: Netflix Data Mesh: Composable Data Processing - J...
Virtual Flink Forward 2020: Netflix Data Mesh: Composable Data Processing - J...
 
Informatica partitions
Informatica partitionsInformatica partitions
Informatica partitions
 
Informatica slides
Informatica slidesInformatica slides
Informatica slides
 
DMBOK 2.0 and other frameworks including TOGAF & COBIT - keynote from DAMA Au...
DMBOK 2.0 and other frameworks including TOGAF & COBIT - keynote from DAMA Au...DMBOK 2.0 and other frameworks including TOGAF & COBIT - keynote from DAMA Au...
DMBOK 2.0 and other frameworks including TOGAF & COBIT - keynote from DAMA Au...
 
Data and AI summit: data pipelines observability with open lineage
Data and AI summit: data pipelines observability with open lineageData and AI summit: data pipelines observability with open lineage
Data and AI summit: data pipelines observability with open lineage
 
DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...
DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...
DataOps for the Modern Data Warehouse on Microsoft Azure @ NDCOslo 2020 - Lac...
 
Business Intelligence & Data Analytics– An Architected Approach
Business Intelligence & Data Analytics– An Architected ApproachBusiness Intelligence & Data Analytics– An Architected Approach
Business Intelligence & Data Analytics– An Architected Approach
 
Building a modern data warehouse
Building a modern data warehouseBuilding a modern data warehouse
Building a modern data warehouse
 
Date warehousing concepts
Date warehousing conceptsDate warehousing concepts
Date warehousing concepts
 
Making Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta LakeMaking Apache Spark Better with Delta Lake
Making Apache Spark Better with Delta Lake
 
Data Streaming in Big Data Analysis
Data Streaming in Big Data AnalysisData Streaming in Big Data Analysis
Data Streaming in Big Data Analysis
 
Intro to Data Vault 2.0 on Snowflake
Intro to Data Vault 2.0 on SnowflakeIntro to Data Vault 2.0 on Snowflake
Intro to Data Vault 2.0 on Snowflake
 
Hadoop hdfs
Hadoop hdfsHadoop hdfs
Hadoop hdfs
 
How does Apache DolphinScheduler (Incubator) support scheduling 100,000-level...
How does Apache DolphinScheduler (Incubator) support scheduling 100,000-level...How does Apache DolphinScheduler (Incubator) support scheduling 100,000-level...
How does Apache DolphinScheduler (Incubator) support scheduling 100,000-level...
 
Idiro Analytics - Analytics & Big Data
Idiro Analytics - Analytics & Big DataIdiro Analytics - Analytics & Big Data
Idiro Analytics - Analytics & Big Data
 
Data Quality Best Practices
Data Quality Best PracticesData Quality Best Practices
Data Quality Best Practices
 
Informatica Pentaho Etl Tools Comparison
Informatica Pentaho Etl Tools ComparisonInformatica Pentaho Etl Tools Comparison
Informatica Pentaho Etl Tools Comparison
 

Similar to Ssis event handler

Ssis2008 120710214348-phpapp02
Ssis2008 120710214348-phpapp02Ssis2008 120710214348-phpapp02
Ssis2008 120710214348-phpapp02sumitkumar3201
 
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 Portfoliobwoodward
 
Microsoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbaiMicrosoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbaiUnmesh Baile
 
MMYERS Portfolio
MMYERS PortfolioMMYERS Portfolio
MMYERS PortfolioMike 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 Braunsqlserver.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 TaskPramod Singla
 
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 1Skillwise Group
 
Building the DW - ETL
Building the DW - ETLBuilding the DW - ETL
Building the DW - ETLganblues
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14Syed Asrarali
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMark Leith
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMark Leith
 
David Weston SSIS Portfolio
David Weston SSIS PortfolioDavid Weston SSIS Portfolio
David Weston SSIS Portfoliodlweston
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005rainynovember12
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012Steve Xu
 
Test Strategy Utilising Mc Useful Tools
Test Strategy Utilising Mc Useful ToolsTest Strategy Utilising Mc Useful Tools
Test Strategy Utilising Mc Useful Toolsmcthedog
 

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 unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
 
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

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 constraintsKiki Noviandi
 
Developing (KPI) Key Performance Indicators
Developing (KPI) Key Performance IndicatorsDeveloping (KPI) Key Performance Indicators
Developing (KPI) Key Performance IndicatorsKiki Noviandi
 
Sql server master data services
Sql server master data servicesSql server master data services
Sql server master data servicesKiki Noviandi
 
SSIS : Ftp and script task
SSIS : Ftp and script taskSSIS : Ftp and script task
SSIS : Ftp and script taskKiki Noviandi
 
Cyber crime Bani Umar bintaro
Cyber crime   Bani Umar bintaroCyber crime   Bani Umar bintaro
Cyber crime Bani Umar bintaroKiki Noviandi
 
Query and operators optimization
Query and operators optimizationQuery and operators optimization
Query and operators optimizationKiki Noviandi
 
Sql in memory database
Sql in memory databaseSql in memory database
Sql in memory databaseKiki Noviandi
 
Sql performance tools
Sql performance toolsSql performance tools
Sql performance toolsKiki 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

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durbanmasabamasaba
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationShrmpro
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

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