Components I have used in my projects are Flat File source, Raw File source, Excel source, ADO NET source, XML source, OLE DB source.
When using Excel Source in SSIS, it does not pick up correct data types so I have to convert for example STRING Data type into Unicode String. The reason is SSIS auto determines the data types for when connecting to EXCEL Source. It prioritize data types based on top 8 records.
Some columns becomes NULL even when excel file contains data. We can fix this by adding IMEX=1 (Import Export Mode) property to the connection string.
No, Raw file source is available only to read raw files. It can only read the data from the file.
CSV file will be read by flat file source.
Yes. We can map the parameters of Stored Procedure in OLE DB source by using OLE DB Source editor and by clicking parameters button
The raw file destination writes raw data to a file. The format of the data is native to the sql server. So, it does not have to translate to specific format and data types. Hence it is faster than other destinations like flat file and OLE DB destinations.
|
OLE DB Destination |
SQL Server Destination |
|
It uses TCP/IP and names pipes. |
It uses Shared memory protocol. |
|
Less performance |
Better performance |
|
It does not require in OLE DB Destination. |
It requires users who execute packages must have “create global objects’ permission from local security policy. |
Data converstion , conditional split, derived column, Aggregate, sort
Merge, merge join, union all
fuzzy look up, look up
OLAP is technology used in many Business Intelligence applications which includes complex analytical calculations.OLAP is used for complex calculations,Trends Analysis,sophisticated data modeling.OLAP database is stored in multidimensional database model.OLAP system contains less number of transactions but complex calculations like aggregation- Sum,count,average,min,max e.t.c.
The Aggregated data in OLAP system must be in months,quarters,years,weeks e.t.c. The key purpose to use OLAP system is to reduce the query response time and increase the effectiveness of reporting.If these aggregated calculations are already stored in repository and if user wants fast access of data then user can use OLAP system.OLAP database stores aggregated historical data in multidimensional schema.
Real Example :
If Company head wants information of Resources salary in year 2000.
In spite of using the transactional system we will use OLAP system here where aggregated data of year 2000 for Resources is already present.
OLTP system is known as large number of small daily transactions like insert,update and delete.Operational database is known as OLTP system.OLTP system provides fast query processing as well as it is also responsible to provide data integrity and data consistency.The actual effectiveness of OLTP is measured in number of Transactions per second.OLTP normally contains current data and data normalization is used properly in OLTP system.
Real Example :
If Company head wants transactional report of all Employees In – Out time.
As Company head wants daily report of in-out time we need to provide it using OLTP system.We need to schedule report on daily basis using OLTP system.
Data warehousing is a system which is used for reporting purpose as well as data analysis purpose where data is coming from multiple heterogeneous sources whether it is oracle, sql server, postgres,simple excel sheet.Data warehousing is specially used for reporting historical data.Data warehousing is core component of Business Intelligence.In Data warehouse there is one central mechanism called as repository using which one can fetch the historical reports.In Data warehouse user can store current data as well as historical data on single place called as repository.Data warehouse provides generalized data and consolidated data in multidimensional view.Data warehouse provides Online Analytical tools to analyse the data and reporting purpose.
Data warehousing is subject oriented,time variant,non-volatile collection of data which is used for creation of transactional reports as well as historical reports.
Dashboards are nothing but the arrangement of all the reports and charts graphs on one page.It is nothing but the collection of reports of different formats which has same functionality displayed on the same page.
|
Transactional System(OLTP) |
Data wareouse(OLAP) |
|
1. OLTP (on-line transaction processing) |
1. OLAP (on-line analytical processing) |
|
2. Day-to-day operations: purchasing, inventory, banking, manufacturing, payroll, registration, accounting, etc. |
2. Data analysis and decision making |
|
3. The tables are in the Normalized form |
3. The tables are in the De-Normalized form. |
|
4. We Called the Storage objects as Tables. i.e., All the masters and the Transactions are stored in the tables |
4. We Called the Storage objects as Dimension and Facts. i.e., All the masters Are dimension and the Transactions are Facts. |
|
5. For Designing OLTP we used data modeling. |
5. For Designing OLAP we used Dimension modeling. OLAP is classified into two i.e., MOLAP & ROLAP |
| 6. Operational or Transactional database have insert,update privileges as the data processing and updation needed. | 6.Data warehouse database generally have only read only access means user can only select the data |
Data Mart is a simplest set of Data warehouse which is used to focus on single functional area of the business.We can say Data Mart is a subset of Data warehouse which is oriented to specific line of business or specific functional area of business such as marketing,finance,sales e.t.c. The data come in to Data Mart by different transactional systems,other data warehouse or external sources.
Fact table is central table found in star schema or snowflakes schema which is surrounded by dimension tables.Fact table contains numeric values that are known as measurements.Fact table has two types of columns:
1.Facts
2.Foreign key of dimension tables.
The measures in a fact table are of three types :
1.Additive :
Measures that can be added across any dimension
2.Non-additive:
Measures that can not be added across any dimension
3.Semi-additive:
Measures that can be added across some dimensions.
Real Example :
Following is a fact table which contains all the primary keys of dimensions table and added measures for ITEM,i.e.Product sold.
|
ITEM KEY |
Time key |
Product key |
Date key |
Product Sold |
|
00001 |
T001 |
P001 |
D001 |
100 |
|
00002 |
T002 |
P002 |
D002 |
30 |
|
00003 |
T003 |
P003 |
D003 |
15 |
The fact table contains the foreign keys,time dimensions,product dimension,customer dimension,measurement values.Following are some examples of common facts :
No of unit sold,Margin,Sales revenue and the dimension tables are customer,time and product e.t.c. which is used to analyse data.
Dimension table is table which describes the business entities of an enterprise which describes the objects in a fact table.Dimension table has primary key which uniquely identifies each dimension row.Dimension table is sometimes called as lookup or reference table.The primary key of dimension table is used to associate relationship between fact table which contains foreign key.Dimension tables are normally in de-normalized form because these tables are only used to analyse the data and not used to execute transactions.
The fields in a dimension table is used to complete following 3 important requirement :
Real Life Example :
Consider following table which contains item information.In the following table ITEM KEY is primary key which uniquelly identifies the rows in the dimension table. ITEM KEY will be present in Fact table.
|
ITEM KEY |
ITEM NAME |
BRAND |
SOLD BY |
Category |
|
00001 |
Yellow shirt |
Yazaki |
Amit |
Shirts |
|
00002 |
Football |
Start sports |
Rahul |
Sports |
|
00003 |
Blue Shorts |
Puma |
Amit |
Shorts |
In the image i have explained which are fact and which are dimension tables. You will able to see there are four dimesions :
1.Time
2.Location
3.Item
4.Branch
Aggregate table contains aggregated data which can be calculated by using different aggregated functions like count,avg,min,max.e.t.c.Aggregated tables are most widely used tables in OLAP database.Aggregates are functions where the values of table or column are grouped together and form a single value. Following are some aggregate functions:
1.Average
2.Count
3.MAX
4.MIN
5.Median
6.SUM
Using the above aggregate functions the data will be inserted in aggregate table.The aggregate tables are used for performance optimization and data is coming fast using aggregate table.Aggregations applied on database level improves the performance of the query as the query not hits directly on table it will hit on aggregate table and fetches data.
Real Example:
If table contains the data of year 2016 and 2017 ,User wants a actual count of records in the table monthly,Quarterly and yearly.Then We need to make aggregate table which contains count of records monthly,For Quarterly we need to create other table and push the quarterly count in that table.And we need to use that tables in the reports so that report performance will improve drastically.
Granularity in table represents the level of information stored in the table.In BI granularity is very important concept to check the table data.The granularity is high and low .High granularity data contains the data with high information or you can say it as transaction level data is high granularity data.Low granularity means data has low level information only.Fact table always have low granularity mean we need very low level data in fact table.
Following 2 points are important in defining granularity :
1.Determining the dimensions that are to be included
2.Determining location to place hierarchy of each dimension of information.
Real life Example :
Date Dimension Granularity level :
Year,month,quarter,period,week,day
For a long time in the past and also even today, Data warehouses are built to facilitate reporting on different key business processes of an organization, known as KPI. Today we often call this whole process of reporting data from data warehouses as “Data Analytics”. Data warehouses also help to integrate data from different sources and show a single-point-of-truth values about the business measures (e.g. enabling Master Data Management).
Data warehouse can be further used for data mining which helps trend prediction, forecasts, pattern recognition etc.
Dimensional model consists of dimension and fact tables. Fact tables store different transactional measurements and the foreign keys from dimension tables that qualifies the data. The goal of Dimensional model is not to achieve high degree of normalization but to facilitate easy and faster data retrieval.
Ralph Kimball is one of the strongest proponents of this very popular data modeling technique which is often used in many enterprise level data warehouses.
Non-additive Measures
Non-additive measures are those which can not be used inside any numeric aggregation function (e.g. SUM(), AVG() etc.). One example of non-additive fact is any kind of ratio or percentage. Example, 5% profit margin, revenue to asset ratio etc. A non-numerical data can also be a non-additive measure when that data is stored in fact tables, e.g. some kind of varchar flags in the fact table.
Semi Additive Measures
Semi-additive measures are those where only a subset of aggregation function can be applied. Let’s say account balance. A sum() function on balance does not give a useful result but max() or min() balance might be useful. Consider price rate or currency rate. Sum is meaningless on rate; however, average function might be useful.
Additive Measures
Additive measures can be used with any aggregation function like Sum(), Avg() etc. Example is Sales Quantity etc.
The term Business Intelligence (BI) provides the user with the data and tool to answer the questions which are important to run the business or part of business.In short,the business intelligence is used for reporting the specified data of any business which is very important and using which the higher management of the business will take the decisions for growth of business.Business Intelligence (BI) is used to take following organization level decisions:
1.BI is used to determine whether the business is running as per plan
2.BI is used to identify which things are going wrong
3.BI is used to take and monitor corrective actions
4.BI is used to identify the trends.
SSRS01-ssrs report structure
Microsoft SQL Server, Microsoft SSAS for MDX, DMX, Microsoft Power Pivot and tabular models, Microsoft azure SQL Database, SQL Server SQL Database, Oracle, OLE DB, ODBC, XML, Teradata, Microsoft Sharepoint List, Hyperion Essbase, SAP NetWeaver BI
Embedded data source is accessible to single report.
Shared data source is accessible to multiple reports with in the folder
Drill down reports are displaying summary reports to the detailed reports.
Whereas drill through reports are goto reports in ssrs.
RDL stands for Report Definition Language. When you create the SSRS report, the file is created with rdl extension. The report file is saved in XML format. The rdl file can be divided into three sections:
Click on drop down arrow next to column groups. Then click on static under row groups and press F4 t
to go to properties. Set KeepTogether = True and KeepWithGroup = After.
Page Break is the way to control the contents on each of the page. We can introduce the page between Data Regions, Rectangles and also between the Groups created in the Data Regions, rectangles and also between the groups created in the data regions.
To enable Page Break, we need to click on the Tablix, matrix and rectangle properties and then go to page break and then choose to put page break after the item or before the item.
Go to Row Groups and add Parent group. Then click on fx to write expressions: CEILING(RowNumber(Nothing)/10). Then remove sorting on newly created group. Add page break between group values. But you will see group values as well. So, delete group column.
Go to Row Groups and then click on group to go to Group Properties. Go to page break and then check box: Between each instance of a group and hit ok.
To perform UNION Transformation in SSIS, we can use UNION ALL and then pass output to Sort transformation removing rows with duplicate sort values. We can also use other aggregate transformation with Union All Transformationto perform Union operations in SSIS as well.
In SSIS, Sort transformation can help us to remove the duplicate records if we have small file. But if you want to load millions of records then load it into some staging table and then write T-SQL to extract unique records.
Script component transformation can be used as source, destination and transformation and write our own custom code by using C# or visual studio.
Merge accept sorted input, union all does not have to provide sorted input.
Merge accept only two input. Union allaccept any number of input.
Merge will output sorted data. Union all will usually give unsorted based on data.
[column_name]== “value_check” ? “if_true”:”if_false”
We can also add multiple if else statements all at once.
Copy column transformation create new column for us. It also can add new columns and on top of that e can concatenate columns and implement different functions like string, date or time or null functions on them
Copy column does not support Error output while derive column transformation support error output.
No, we don’t have month-name and day-name in SSISbut we can create two variables in our package with string data types and write on them to use them wherever we need month name and day name. Go to the properties of name variables and then configure using DATEPART and GETDATE for daynamelike : DATEPART(“dw”,GETDATE())==1? “Sunday”: and (MONTH(GETDATE())==1? “Jan”: for monthname.
email notification :Build package with some notification on it like creating error event handler error notification, when it fails it will error code and information to email. In SQL Server Agent job, we can set notification on failure.
EnableData Viewer in Data Flow, redirect row for error output, setbreakpoints like OnPreExecute, OnPostExecute event to see value before and after,
Always create package with logging like SSIS log provider for Text files, SQL Server, SQL Server Profiler, Windows Event Log and XML files.To capture information such as on error and on failure are very imp.Look into logs and try to understand that, and SQL Server Job History.
Smart ETL developer will have on failure email notification and logging for detail error information. If done that, will get email and you can look into problem.
If you haven’t set up error email notification, DBA will send information from job history and error message information from Job History( SQL Server Agent Job).
To further look into error details, check logging file or log records in table. You might need read permission to the folder where log files are created if SSIS Package is logging execution information to file system.
Data viewer can be used between two transformations to see the data. It is available in Data Flow.
Different transformations provide error output in case the operation can not be perform on input data. Yes, we can redirect rows from sources, transformations and destinations. For example in a flat file source, we can go to Error Output and select redirect row for Error and Truncation.
3 options in data flow to work with errors. they are FAIL COMPONENT, IGNORE FAILURE, REDIRECT ROWS
1. Job Frequency Details: explain how package is going to be executed.
2. Email Notification Details: explain type of notification package created. In case of data validation or hard failure like connection failure which team will be notified via email.
3. Audit Process on Package start: audit tables with package name, start time to track which packages are currently running and execution history of different packages.
Extraction process heading into sub heading like source, transformation and business logic, and destination.
4. Audit information on end of package
5. Dependencies: provide list of objects like stored procedure, tables, views, function, child packages on which package depends for successful execution.
6. Trouble shooting: list of common error/failure that can happen
7. Dynamic Package configurations: provide details about connection managers, variables. In case of SQL Server configuration provide database name, table and in case of XML configuration provide file path.
8. Logging and event handling:explain which type of logging is used. What type of event’s information is captured and what actions are done in event handler. Provide text file logging path or database name where log table exists.
9. Important links: provide all important linkif Business Required Document (BRD), Functional required document(FRD) or any documentation provided for package in shared folder or SharePoint site,
By using below code
USE [msdb]
GO
SELECT
Srv.srvnameAS ServerName,
Job.name AS JobName,
JStep.step_id,
JStep.step_nameAS StepName,
JStep.command,
Job.enabled
FROM dbo.sysjobs Job
JOIN dbo.sysjobstepsJStep
ON JStep.job_id= Job.job_id
JOIN MASTER.dbo.sysserversSrv
ON Srv.srvid= Job.originating_server_id
WHERE JStep.subsystem='SSIS'
ORDER BY Job.name,step_id
Checkpointsare used to restart packages from the point of failure instead to rerun the whole package or tasks. To implement checkpoints, select package, go its properties to find SSIS Checkpoint property. Select file name for CheckpointFileName, select IfExists for CheckpointUsage, saveCheckpoints to True and finally in Execution, set FailPackageOnFailure to True.
SSIS include log providers to implement logging in packages, containers and tasks. With logging, we can capture run-time, information about a package, helping you audit and troubleshoot a package every time it is run.
Types of logging Text File Logging, SQL Server Profiler, SQL Server, Windows Event Log and XML File.
Create expression for our Log File Name for each execution. Go to MyLogFile Connection Manager and right click on it. Go to properties and then expression and write expression as:
@[User::VarLogFolderPath]+"\\"+ @[System::PackageName]+"_"+Replace(Replace(Replace(SUBSTRING((DT_WSTR,50)(GETDATE()),1,16),"-","")," ","_"),":","")+".log"
[dbo].[sysssislog] table in system tables will be used to store log information.
Source,starttime, endtime and message are few important column names that sysssisloghave to store log information.
OnError, OnPostExecute, OnPreExecute, OnPreValidate, OnProgress,OnTaskFailed and OnWarning