SlideShare a Scribd company logo
1 of 14
Download to read offline
Optimized Bulk Loadingof Data into
Oracle
Carla Sabotta, Debarchan Sarkar
Summary: SQL Server 2008 and SQL Server 2008 R2 (Enterprise and Developer editions)
support bulk loading Oracle data using Integration Services packages with the Microsoft
Connector for Oracle by Attunity. For SQL Server 2005 and the non-Enterprise and non-
Developer editions of SQL Server 2008 and 2008 R2, there are alternatives for achieving
optimal performance when loading Oracle data. This paper discusses these alternatives.
The Enterprise and Developer editions of SQL Server 2012 also support bulk loading
Oracle data using Integration Services packages with the Microsoft Connector for Oracle
by Attunity.
Category:Quick Step-by-Step
Applies to: SQL Server 2005 (all editions), SQL Server 2008, SQL Server 2008 R2, and
SQL Server 2012 (non-Enterprise and non-Developer editions
Source: White paper (link to source content)
E-book publication data: November 2012
2
Copyright © 2012 by Microsoft Corporation
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means
without the written permission of the publisher.
Microsoft and the trademarks listed at
http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of the
Microsoft group of companies. All other marks are property of their respective owners.
The example companies, organizations, products, domain names, email addresses, logos, people, places, and events
depicted herein are fictitious. No association with any real company, organization, product, domain name, email address,
logo, person, place, or event is intended or should be inferred.
This book expresses the author’s views and opinions. The information contained in this book is provided without any
express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors
will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.
3
Contents
Introduction ............................................................................................................................................4
Alternatives for Optimized Loading and Unloading Oracle Data...............................................................4
Customized Script Component.............................................................................................................5
Third-party Components....................................................................................................................12
Conclusion.............................................................................................................................................12
4
Introduction
SQL Server 2008, 2008 R2, and 2012 (Enterprise and Developer editions) support bulk
loadingOracle data using Integration Services (SSIS) packages. The Microsoft Connector for
Oracle by Attunity provides optimal performance through their high-speed connectors during the
loading or unloading of data from Oracle. For more information, see Using the Microsoft
Connector for Oracle by Attunity with SQL Server 2008 Integration
Services(http://msdn.microsoft.com/en-us/library/ee470675(SQL.100).aspx).
SQL Server 2005 and the non-Enterprise and non-Developer editions of SQL Server 2008,
2008 R2, and 2012don’t provide an out-of-the box option for bulk loadingOracle data.
• The fastload options for the OLE DB destination aren’t available when you use the
Oracle OLE DB provider for Oracle because the provider doesn’t implement
the IRowsetFastLoad (http://msdn.microsoft.com/en-us/library/ms131708.aspx)
interface.
In addition, the current design of SSIS is such that it makes the fast load options
available only for the SQL providers. The options aren’t available for any other provider
even if the provider implements the IRowsetFastLoad interface.
• The Microsoft OLE DB Provider for Oracle is deprecated and not recommended to use
against Oracle versions later than 8i.
http://support.microsoft.com/kb/244661
In SQL Server 2005 and the non-Enterprise and non-Developer editions of SQL Server 2008,
2008 R2, and 2012, the out-of-the box, SSIS componentsimplement single row inserts to load
data to Oracle. When you use single row inserts, the following issues may occur.
• Long load times and poor performance
• Data migration deadlines are not met
• Timeout during the ETL process for large production databases (greater than 500GB)
with complex referential integrity
For these releases, there are alternatives for achieving optimal performance when loading
Oracle data. This paper discussesthese alternatives.
Alternatives for Optimized Loading and Unloading Oracle Data
The following are alternatives foroptimizing the loading of Oracle data.
Alternative SQL Server Versions
Customized Script component SQL Server 2005 and the non-Enterprise and
non-Developer editions of SQL Server 2008,
2008 R2, and 2012.
Third-party components SQL Server 2005 and the non-Enterprise and
5
non-Developer editions of SQL Server 2008
and 2008 R2.
Customized Script Component
In this solution, a Script component is configured as a destination. The component connects to
Oracle using the OLE DB provider from Oracle (OraOLEDB) and bulk loads data to an Oracle
database.The Script component performs the data loadin about half the time that it would take
to perform single row inserts using an OLE DB destination.
The provider is included in the Oracle Data Access Components (ODAC) that is available for
download on the Oracle Data Access Componentssite
(http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html).An Oracle online
account is required to download the software.
Note: You can also configure the Script component to connect to Oracle using the
ODP.Net provider from Oracle.
The System.Data.OleDb namespace(http://tinyurl.com/7zuffuf) is used in the script, as shown in
the Microsoft Visual Basic code example below. The namespace is the .NET Framework Data
Provider for OLE DB.
The PreExecute(http://tinyurl.com/86e4exe) method is overridden to create the OleDbParameter
objects for each of the input columns. The parameters are added to the OleDbCommand
Object, to configure the parameterized command that the destination will use to insert the data.
In the example, the input columns are CustomerID, TerritoryID, AccountNumber, and
ModifiedDate. Then, the database transaction is started.
The AcquireConnections(http://tinyurl.com/7qkkqvq)method is overridden to return a
System.Data.OleDb.OleDbConnection from the connection manager that connects to the Oracle
database.
The ProcessInputRow (http://tinyurl.com/8y7vnh5) method is overridden to process the data in
each input row as it passes through.
6
Toconfigure the Script component
1. Add adata source to the package, such as an OLE DB Source. The data source should
have fields that can be easily loaded into a target table. In this example, we’re using the
Customer table in the AdventureWorks database as the data source, and selecting the
CustomerID, TerritoryID, AccountNumber, and ModifiedDate input columns.
2. Add a Script component and configure the component as a destination. Connect the
component to the data source.
3. Double-click the Script component to open the Script Transformation Editor.
7
4. Click Connection Managers in the left-hand pane.
5. Click Add, and then select <New connection> in the Connection ManagerField. The
Add SSIS Connection Manager dialog box appears.
6. In the Add SSIS Connection Manager dialog box, select ADO.NETin the Connection
manager type area, and then click Add.
8
7. In the Configure ADO.NET Connection Manager dialog box click New to create a new
data connection for the connection manager.
8. In the Connection Managerdialog box, click the arrow next to the Provider drop-down
list.
9
9. Expand the .Net Providers for OleDb folder, click Oracle Provider for OLE DB, and
then click OK.
10. Click Test Connectionto confirm the connection, and then click OK.
11. In the Configure ADO.NET Connection Manager dialog box, click the data connection
you’ve created, and then click OK.
12. In the Script Transformation Editor, click Input Columns in the left-hand pane, and
click the CustomerID, TerritoryID, AccountNumber, and ModifiedDate columns in the
Available Input Columns box.
13. Click Script in the left-hand pane.
10
14. Confirm that the ScriptLanguage property value is Microsoft Visual Basic, and then
Click Edit Script.
NOTE: In SQL Server 2008, theDesign Scriptbutton was renamed toEdit Script and
support was added for the Microsoft Visual C# programming language.
Add the following Visual Basic code.
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.Data.OleDb
Imports System.Data.Common
<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute> _
<CLSCompliant(False)> _
PublicClass ScriptMain
Inherits UserComponent
11
Dim row_count As Int64
Dim batch_size As Int64
Dim connMgr As IDTSConnectionManager100
Dim oledbconn As OleDbConnection
Dim oledbtran As OleDbTransaction
Dim oledbCmd As OleDbCommand
Dim oledbParam As OleDbParameter
PublicOverridesSub PreExecute()
batch_size = 8 * 1024
row_count = 0
oledbCmd = New OleDbCommand("INSERT INTO Customer(CustomerID,
TerritoryID, AccountNumber, ModifiedDate) VALUES(?, ?, ?, ?)", oledbconn)
oledbParam = New OleDbParameter("@CustomerID", OleDbType.Integer, 7)
oledbCmd.Parameters.Add(oledbParam)
oledbParam = New OleDbParameter("@TerritoryID", OleDbType.Integer, 7)
oledbCmd.Parameters.Add(oledbParam)
oledbParam = New OleDbParameter("@AccountNumber", OleDbType.VarChar,
7)
oledbCmd.Parameters.Add(oledbParam)
oledbParam = New OleDbParameter("@ModifiedDate", OleDbType.Date, 7)
oledbCmd.Parameters.Add(oledbParam)
oledbtran = oledbconn.BeginTransaction()
oledbCmd.Transaction = oledbtran
MyBase.PreExecute()
EndSub
PublicOverridesSub AcquireConnections(ByVal Transaction AsObject)
connMgr = Me.Connections.Connection
oledbconn = CType(connMgr.AcquireConnection(Nothing),
OleDb.OleDbConnection)
EndSub
PublicOverridesSub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
With oledbCmd
.Parameters("@CustomerID").Value = Row.CustomerID
.Parameters("@TerritoryID").Value = Row.TerritoryID
.Parameters("@AccountNumber").Value = Row.AccountNumber
.Parameters("@ModifiedDate").Value = Row.ModifiedDate
.ExecuteNonQuery()
EndWith
row_count = row_count + 1
If (row_count Mod batch_size) = 0 Then
oledbtran.Commit()
oledbtran = oledbconn.BeginTransaction()
oledbCmd.Transaction = oledbtran
EndIf
EndSub
PublicOverridesSub PostExecute()
MyBase.PostExecute()
EndSub
12
PublicOverridesSub ReleaseConnections()
MyBase.ReleaseConnections()
EndSub
EndClass
15. Save your changes to the Script component.
The SSIS package now contains the custom script component, configured as a destinationto
bulk load data to the Oracle data source.
Note: The above script component connectsto Oracle, but it can be used to connect to other
third-partydata sources such as Sybase and Informix. The only change that you need to
make is to configure the connection manager to use the correct OLE DB providers available
for Sybase and Informix.
Third-party Components
In addition to the Script component solution discussed in this paper, there are third-party
components that you can use to achieve optimal performance when loading Oracle data. The
following components work with both SQL Server 2005 and SQL Server 2008.
• Oracle Destination and ODBC Destination components from CozyRoc. For more
information, see theCozyRoc web site.
• Oracle Bulk Loader SSIS Connector from Persistent. For more information, contact
Persistent.
• Progress DataDirect Connect and DataDirect Connect64 components from Progress
DataDirect. For more information, see the DataDirect web site.
Conclusion
SQL Server 2008, 2008 R2, and 2012 (Enterpriseand Developer editions) support bulk
loadingOracle data using SSIS packages.
For other SQL Server versions and editions, the following are alternatives for optimizing the
loading of Oracle datawhen using SSIS packages.
Alternative SQL Server versions and editions
Script component bulk loads data to Oracle
using the Oracle OLE DB provider from Oracle
SQL Server 2005 and the non-Enterprise and
non-Developer editions of SQL Server 2008,
2008 R2, and 2012.
Third-party components that connect to
Oracle, from CozyRoc, Persistent, and
DataDirect
SQL Server 2005 and the non-Enterprise and
non-Developer editions of SQL Server 2008
and 2008 R2.
For more information:
13
Connectivity and SQL Server 2005 Integration Services(http://msdn.microsoft.com/en-
us/library/bb332055(SQL.90).aspx )
SSIS with Oracle Connectors
(http://social.technet.microsoft.com/wiki/contents/articles/1957.ssis-with-oracle-connectors.aspx)
SQL Server 2012: Microsoft Connectors V2.0 for Oracle and Teradata
(http://www.microsoft.com/en-us/download/details.aspx?id=29283)
SSIS and Netezza: Loading data using OLE DB Destination (http://www.rafael-
salas.com/2010/06/ssis-and-netezza-loading-data-using-ole.html)
Did this paper help you? Please give us your feedback. Tell us on a scale of 1 (poor) to 5
(excellent), how would you rate this paper and why have you given it this rating? For example:
• Are you rating it high due to having good examples, excellent screen shots, clear writing,
or another reason?
• Are you rating it low due to poor examples, fuzzy screen shots, or unclear writing?
This feedback will help us improve the quality of white papers we release.
Send feedback.

More Related Content

What's hot

Oracle Application Framework Cases
Oracle Application Framework Cases Oracle Application Framework Cases
Oracle Application Framework Cases Feras Ahmad
 
Salesforce command line data loader
Salesforce command line data loaderSalesforce command line data loader
Salesforce command line data loaderjakkula1099
 
Installing ingres enterprise access in a system which already has an ingres i...
Installing ingres enterprise access in a system which already has an ingres i...Installing ingres enterprise access in a system which already has an ingres i...
Installing ingres enterprise access in a system which already has an ingres i...malu42
 
( 5 ) Office 2007 Create A Business Data Catolog
( 5 ) Office 2007   Create A Business Data Catolog( 5 ) Office 2007   Create A Business Data Catolog
( 5 ) Office 2007 Create A Business Data CatologLiquidHub
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6kaashiv1
 
Athena java dev guide
Athena java dev guideAthena java dev guide
Athena java dev guidedvdung
 
BI Publisher Data model design document
BI Publisher Data model design documentBI Publisher Data model design document
BI Publisher Data model design documentadivasoft
 
Kaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions PresentationKaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions Presentationkaashiv1
 
Sql server 2012_licensing_reference_guide
Sql server 2012_licensing_reference_guideSql server 2012_licensing_reference_guide
Sql server 2012_licensing_reference_guideamenus006
 
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...ChristopherBow2
 
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft Private Cloud
 
How to connect sql server to oracle server
How to connect sql server to oracle serverHow to connect sql server to oracle server
How to connect sql server to oracle serverGustavo Bernardo
 

What's hot (16)

Oracle Application Framework Cases
Oracle Application Framework Cases Oracle Application Framework Cases
Oracle Application Framework Cases
 
Salesforce command line data loader
Salesforce command line data loaderSalesforce command line data loader
Salesforce command line data loader
 
Installing ingres enterprise access in a system which already has an ingres i...
Installing ingres enterprise access in a system which already has an ingres i...Installing ingres enterprise access in a system which already has an ingres i...
Installing ingres enterprise access in a system which already has an ingres i...
 
( 5 ) Office 2007 Create A Business Data Catolog
( 5 ) Office 2007   Create A Business Data Catolog( 5 ) Office 2007   Create A Business Data Catolog
( 5 ) Office 2007 Create A Business Data Catolog
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6
 
Ebook6
Ebook6Ebook6
Ebook6
 
Athena java dev guide
Athena java dev guideAthena java dev guide
Athena java dev guide
 
BI Publisher Data model design document
BI Publisher Data model design documentBI Publisher Data model design document
BI Publisher Data model design document
 
Oracle OSB Tutorial 1
Oracle OSB Tutorial 1Oracle OSB Tutorial 1
Oracle OSB Tutorial 1
 
Kaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions PresentationKaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions Presentation
 
Sql server 2012_licensing_reference_guide
Sql server 2012_licensing_reference_guideSql server 2012_licensing_reference_guide
Sql server 2012_licensing_reference_guide
 
Hibernate
HibernateHibernate
Hibernate
 
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
Designing Database Solutions for Microsoft SQL Server 2012 2012 Microsoft 70-...
 
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure WhitepaperMicrosoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
Microsoft SQL Azure - Developing And Deploying With SQL Azure Whitepaper
 
How to connect sql server to oracle server
How to connect sql server to oracle serverHow to connect sql server to oracle server
How to connect sql server to oracle server
 
0065 using sequelink
0065 using sequelink0065 using sequelink
0065 using sequelink
 

Similar to Ob loading data_oracle

SQL Server Integration Services with Oracle Database 10g
SQL Server Integration Services with Oracle Database 10gSQL Server Integration Services with Oracle Database 10g
SQL Server Integration Services with Oracle Database 10gLeidy Alexandra
 
A introduction to oracle data integrator
A introduction to oracle data integratorA introduction to oracle data integrator
A introduction to oracle data integratorchkamal
 
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
 
Configure an Integrated Exchange, Lync, and SharePoint Test Lab
Configure an Integrated Exchange, Lync, and SharePoint Test LabConfigure an Integrated Exchange, Lync, and SharePoint Test Lab
Configure an Integrated Exchange, Lync, and SharePoint Test LabVinh Nguyen
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statementsSteve Xu
 
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...Ravi Kumar Lanke
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012Steve Xu
 
Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10kaashiv1
 
owb-11gr2-new-features-summary-129693
owb-11gr2-new-features-summary-129693owb-11gr2-new-features-summary-129693
owb-11gr2-new-features-summary-129693Carnot Antonio Romero
 
Oracle database edition-12c
Oracle database edition-12cOracle database edition-12c
Oracle database edition-12cAsha BG
 
0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorialKlausePaulino
 
Odi 11g-new-features-overview-1622677
Odi 11g-new-features-overview-1622677Odi 11g-new-features-overview-1622677
Odi 11g-new-features-overview-1622677Sandeep Jella
 
Microsoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now LiveMicrosoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now LiveAmber Moore
 
IBM Flex System Reference Architecture for Microsoft SQL Server 2012 High Ava...
IBM Flex System Reference Architecture for Microsoft SQL Server 2012 High Ava...IBM Flex System Reference Architecture for Microsoft SQL Server 2012 High Ava...
IBM Flex System Reference Architecture for Microsoft SQL Server 2012 High Ava...IBM India Smarter Computing
 
Sql server 2008 r2 performance and scale
Sql server 2008 r2 performance and scaleSql server 2008 r2 performance and scale
Sql server 2008 r2 performance and scaleKlaudiia Jacome
 
application-template-deployment-guide.pdf
application-template-deployment-guide.pdfapplication-template-deployment-guide.pdf
application-template-deployment-guide.pdfamazon4it
 

Similar to Ob loading data_oracle (20)

SQL Server Integration Services with Oracle Database 10g
SQL Server Integration Services with Oracle Database 10gSQL Server Integration Services with Oracle Database 10g
SQL Server Integration Services with Oracle Database 10g
 
A introduction to oracle data integrator
A introduction to oracle data integratorA introduction to oracle data integrator
A introduction to oracle data integrator
 
project_real_wp
project_real_wpproject_real_wp
project_real_wp
 
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...
 
Configure an Integrated Exchange, Lync, and SharePoint Test Lab
Configure an Integrated Exchange, Lync, and SharePoint Test LabConfigure an Integrated Exchange, Lync, and SharePoint Test Lab
Configure an Integrated Exchange, Lync, and SharePoint Test Lab
 
Sql server 2012 tutorials writing transact-sql statements
Sql server 2012 tutorials   writing transact-sql statementsSql server 2012 tutorials   writing transact-sql statements
Sql server 2012 tutorials writing transact-sql statements
 
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...
Oracle endeca information discovery v3.0 integration with the obiee 11g bi se...
 
5 tsssisu sql_server_2012
5 tsssisu sql_server_20125 tsssisu sql_server_2012
5 tsssisu sql_server_2012
 
Sql2008 (1)
Sql2008 (1)Sql2008 (1)
Sql2008 (1)
 
Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10
 
Ebook10
Ebook10Ebook10
Ebook10
 
owb-11gr2-new-features-summary-129693
owb-11gr2-new-features-summary-129693owb-11gr2-new-features-summary-129693
owb-11gr2-new-features-summary-129693
 
Oracle database edition-12c
Oracle database edition-12cOracle database edition-12c
Oracle database edition-12c
 
0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial
 
Odi 11g-new-features-overview-1622677
Odi 11g-new-features-overview-1622677Odi 11g-new-features-overview-1622677
Odi 11g-new-features-overview-1622677
 
Microsoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now LiveMicrosoft Sql Server 2016 Is Now Live
Microsoft Sql Server 2016 Is Now Live
 
IBM Flex System Reference Architecture for Microsoft SQL Server 2012 High Ava...
IBM Flex System Reference Architecture for Microsoft SQL Server 2012 High Ava...IBM Flex System Reference Architecture for Microsoft SQL Server 2012 High Ava...
IBM Flex System Reference Architecture for Microsoft SQL Server 2012 High Ava...
 
User Group3009
User Group3009User Group3009
User Group3009
 
Sql server 2008 r2 performance and scale
Sql server 2008 r2 performance and scaleSql server 2008 r2 performance and scale
Sql server 2008 r2 performance and scale
 
application-template-deployment-guide.pdf
application-template-deployment-guide.pdfapplication-template-deployment-guide.pdf
application-template-deployment-guide.pdf
 

More from Steve Xu

Windows azure sql_database_tutorials
Windows azure sql_database_tutorialsWindows azure sql_database_tutorials
Windows azure sql_database_tutorialsSteve Xu
 
Uwams cloud enable-windows_store_apps_java_script
Uwams cloud enable-windows_store_apps_java_scriptUwams cloud enable-windows_store_apps_java_script
Uwams cloud enable-windows_store_apps_java_scriptSteve Xu
 
Transact sql data definition language - ddl- reference
Transact sql data definition language - ddl- referenceTransact sql data definition language - ddl- reference
Transact sql data definition language - ddl- referenceSteve Xu
 
The entity framework 4.0 and asp.net web forms getting started
The entity framework 4.0 and asp.net web forms   getting startedThe entity framework 4.0 and asp.net web forms   getting started
The entity framework 4.0 and asp.net web forms getting startedSteve Xu
 
Testingfor continuousdeliverywithvisualstudio2012
Testingfor continuousdeliverywithvisualstudio2012Testingfor continuousdeliverywithvisualstudio2012
Testingfor continuousdeliverywithvisualstudio2012Steve Xu
 
Tcpip fund
Tcpip fundTcpip fund
Tcpip fundSteve Xu
 
Sql server community_fa_qs_manual
Sql server community_fa_qs_manualSql server community_fa_qs_manual
Sql server community_fa_qs_manualSteve Xu
 
Sql server distributed replay
Sql server distributed replaySql server distributed replay
Sql server distributed replaySteve Xu
 
Sql server 2012 tutorials reporting services
Sql server 2012 tutorials   reporting servicesSql server 2012 tutorials   reporting services
Sql server 2012 tutorials reporting servicesSteve Xu
 
Share point server for business intelligence
Share point server for business intelligenceShare point server for business intelligence
Share point server for business intelligenceSteve Xu
 
Prism for windows runtime
Prism for windows runtimePrism for windows runtime
Prism for windows runtimeSteve Xu
 
Pdrmsqlsr services share_point_integrated_mode
Pdrmsqlsr services share_point_integrated_modePdrmsqlsr services share_point_integrated_mode
Pdrmsqlsr services share_point_integrated_modeSteve Xu
 
Multidimensional model programming
Multidimensional model programmingMultidimensional model programming
Multidimensional model programmingSteve Xu
 
Multidimensional expressions mdx - reference
Multidimensional expressions   mdx - referenceMultidimensional expressions   mdx - reference
Multidimensional expressions mdx - referenceSteve Xu
 
Moving apps to the cloud 3rd edition
Moving apps to the cloud 3rd editionMoving apps to the cloud 3rd edition
Moving apps to the cloud 3rd editionSteve Xu
 
Monitor and tune for performance
Monitor and tune for performanceMonitor and tune for performance
Monitor and tune for performanceSteve Xu
 
Migrating data centric applications to windows azure
Migrating data centric applications to windows azureMigrating data centric applications to windows azure
Migrating data centric applications to windows azureSteve Xu
 
Microsoft project silk
Microsoft project silkMicrosoft project silk
Microsoft project silkSteve Xu
 
Microsoft office 365 for professionals and small businesses help and how to
Microsoft office 365 for professionals and small businesses   help and how toMicrosoft office 365 for professionals and small businesses   help and how to
Microsoft office 365 for professionals and small businesses help and how toSteve Xu
 
Master data services
Master data servicesMaster data services
Master data servicesSteve Xu
 

More from Steve Xu (20)

Windows azure sql_database_tutorials
Windows azure sql_database_tutorialsWindows azure sql_database_tutorials
Windows azure sql_database_tutorials
 
Uwams cloud enable-windows_store_apps_java_script
Uwams cloud enable-windows_store_apps_java_scriptUwams cloud enable-windows_store_apps_java_script
Uwams cloud enable-windows_store_apps_java_script
 
Transact sql data definition language - ddl- reference
Transact sql data definition language - ddl- referenceTransact sql data definition language - ddl- reference
Transact sql data definition language - ddl- reference
 
The entity framework 4.0 and asp.net web forms getting started
The entity framework 4.0 and asp.net web forms   getting startedThe entity framework 4.0 and asp.net web forms   getting started
The entity framework 4.0 and asp.net web forms getting started
 
Testingfor continuousdeliverywithvisualstudio2012
Testingfor continuousdeliverywithvisualstudio2012Testingfor continuousdeliverywithvisualstudio2012
Testingfor continuousdeliverywithvisualstudio2012
 
Tcpip fund
Tcpip fundTcpip fund
Tcpip fund
 
Sql server community_fa_qs_manual
Sql server community_fa_qs_manualSql server community_fa_qs_manual
Sql server community_fa_qs_manual
 
Sql server distributed replay
Sql server distributed replaySql server distributed replay
Sql server distributed replay
 
Sql server 2012 tutorials reporting services
Sql server 2012 tutorials   reporting servicesSql server 2012 tutorials   reporting services
Sql server 2012 tutorials reporting services
 
Share point server for business intelligence
Share point server for business intelligenceShare point server for business intelligence
Share point server for business intelligence
 
Prism for windows runtime
Prism for windows runtimePrism for windows runtime
Prism for windows runtime
 
Pdrmsqlsr services share_point_integrated_mode
Pdrmsqlsr services share_point_integrated_modePdrmsqlsr services share_point_integrated_mode
Pdrmsqlsr services share_point_integrated_mode
 
Multidimensional model programming
Multidimensional model programmingMultidimensional model programming
Multidimensional model programming
 
Multidimensional expressions mdx - reference
Multidimensional expressions   mdx - referenceMultidimensional expressions   mdx - reference
Multidimensional expressions mdx - reference
 
Moving apps to the cloud 3rd edition
Moving apps to the cloud 3rd editionMoving apps to the cloud 3rd edition
Moving apps to the cloud 3rd edition
 
Monitor and tune for performance
Monitor and tune for performanceMonitor and tune for performance
Monitor and tune for performance
 
Migrating data centric applications to windows azure
Migrating data centric applications to windows azureMigrating data centric applications to windows azure
Migrating data centric applications to windows azure
 
Microsoft project silk
Microsoft project silkMicrosoft project silk
Microsoft project silk
 
Microsoft office 365 for professionals and small businesses help and how to
Microsoft office 365 for professionals and small businesses   help and how toMicrosoft office 365 for professionals and small businesses   help and how to
Microsoft office 365 for professionals and small businesses help and how to
 
Master data services
Master data servicesMaster data services
Master data services
 

Recently uploaded

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 

Recently uploaded (20)

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 

Ob loading data_oracle

  • 1.
  • 2. Optimized Bulk Loadingof Data into Oracle Carla Sabotta, Debarchan Sarkar Summary: SQL Server 2008 and SQL Server 2008 R2 (Enterprise and Developer editions) support bulk loading Oracle data using Integration Services packages with the Microsoft Connector for Oracle by Attunity. For SQL Server 2005 and the non-Enterprise and non- Developer editions of SQL Server 2008 and 2008 R2, there are alternatives for achieving optimal performance when loading Oracle data. This paper discusses these alternatives. The Enterprise and Developer editions of SQL Server 2012 also support bulk loading Oracle data using Integration Services packages with the Microsoft Connector for Oracle by Attunity. Category:Quick Step-by-Step Applies to: SQL Server 2005 (all editions), SQL Server 2008, SQL Server 2008 R2, and SQL Server 2012 (non-Enterprise and non-Developer editions Source: White paper (link to source content) E-book publication data: November 2012
  • 3. 2 Copyright © 2012 by Microsoft Corporation All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Microsoft and the trademarks listed at http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx are trademarks of the Microsoft group of companies. All other marks are property of their respective owners. The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred. This book expresses the author’s views and opinions. The information contained in this book is provided without any express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.
  • 4. 3 Contents Introduction ............................................................................................................................................4 Alternatives for Optimized Loading and Unloading Oracle Data...............................................................4 Customized Script Component.............................................................................................................5 Third-party Components....................................................................................................................12 Conclusion.............................................................................................................................................12
  • 5. 4 Introduction SQL Server 2008, 2008 R2, and 2012 (Enterprise and Developer editions) support bulk loadingOracle data using Integration Services (SSIS) packages. The Microsoft Connector for Oracle by Attunity provides optimal performance through their high-speed connectors during the loading or unloading of data from Oracle. For more information, see Using the Microsoft Connector for Oracle by Attunity with SQL Server 2008 Integration Services(http://msdn.microsoft.com/en-us/library/ee470675(SQL.100).aspx). SQL Server 2005 and the non-Enterprise and non-Developer editions of SQL Server 2008, 2008 R2, and 2012don’t provide an out-of-the box option for bulk loadingOracle data. • The fastload options for the OLE DB destination aren’t available when you use the Oracle OLE DB provider for Oracle because the provider doesn’t implement the IRowsetFastLoad (http://msdn.microsoft.com/en-us/library/ms131708.aspx) interface. In addition, the current design of SSIS is such that it makes the fast load options available only for the SQL providers. The options aren’t available for any other provider even if the provider implements the IRowsetFastLoad interface. • The Microsoft OLE DB Provider for Oracle is deprecated and not recommended to use against Oracle versions later than 8i. http://support.microsoft.com/kb/244661 In SQL Server 2005 and the non-Enterprise and non-Developer editions of SQL Server 2008, 2008 R2, and 2012, the out-of-the box, SSIS componentsimplement single row inserts to load data to Oracle. When you use single row inserts, the following issues may occur. • Long load times and poor performance • Data migration deadlines are not met • Timeout during the ETL process for large production databases (greater than 500GB) with complex referential integrity For these releases, there are alternatives for achieving optimal performance when loading Oracle data. This paper discussesthese alternatives. Alternatives for Optimized Loading and Unloading Oracle Data The following are alternatives foroptimizing the loading of Oracle data. Alternative SQL Server Versions Customized Script component SQL Server 2005 and the non-Enterprise and non-Developer editions of SQL Server 2008, 2008 R2, and 2012. Third-party components SQL Server 2005 and the non-Enterprise and
  • 6. 5 non-Developer editions of SQL Server 2008 and 2008 R2. Customized Script Component In this solution, a Script component is configured as a destination. The component connects to Oracle using the OLE DB provider from Oracle (OraOLEDB) and bulk loads data to an Oracle database.The Script component performs the data loadin about half the time that it would take to perform single row inserts using an OLE DB destination. The provider is included in the Oracle Data Access Components (ODAC) that is available for download on the Oracle Data Access Componentssite (http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html).An Oracle online account is required to download the software. Note: You can also configure the Script component to connect to Oracle using the ODP.Net provider from Oracle. The System.Data.OleDb namespace(http://tinyurl.com/7zuffuf) is used in the script, as shown in the Microsoft Visual Basic code example below. The namespace is the .NET Framework Data Provider for OLE DB. The PreExecute(http://tinyurl.com/86e4exe) method is overridden to create the OleDbParameter objects for each of the input columns. The parameters are added to the OleDbCommand Object, to configure the parameterized command that the destination will use to insert the data. In the example, the input columns are CustomerID, TerritoryID, AccountNumber, and ModifiedDate. Then, the database transaction is started. The AcquireConnections(http://tinyurl.com/7qkkqvq)method is overridden to return a System.Data.OleDb.OleDbConnection from the connection manager that connects to the Oracle database. The ProcessInputRow (http://tinyurl.com/8y7vnh5) method is overridden to process the data in each input row as it passes through.
  • 7. 6 Toconfigure the Script component 1. Add adata source to the package, such as an OLE DB Source. The data source should have fields that can be easily loaded into a target table. In this example, we’re using the Customer table in the AdventureWorks database as the data source, and selecting the CustomerID, TerritoryID, AccountNumber, and ModifiedDate input columns. 2. Add a Script component and configure the component as a destination. Connect the component to the data source. 3. Double-click the Script component to open the Script Transformation Editor.
  • 8. 7 4. Click Connection Managers in the left-hand pane. 5. Click Add, and then select <New connection> in the Connection ManagerField. The Add SSIS Connection Manager dialog box appears. 6. In the Add SSIS Connection Manager dialog box, select ADO.NETin the Connection manager type area, and then click Add.
  • 9. 8 7. In the Configure ADO.NET Connection Manager dialog box click New to create a new data connection for the connection manager. 8. In the Connection Managerdialog box, click the arrow next to the Provider drop-down list.
  • 10. 9 9. Expand the .Net Providers for OleDb folder, click Oracle Provider for OLE DB, and then click OK. 10. Click Test Connectionto confirm the connection, and then click OK. 11. In the Configure ADO.NET Connection Manager dialog box, click the data connection you’ve created, and then click OK. 12. In the Script Transformation Editor, click Input Columns in the left-hand pane, and click the CustomerID, TerritoryID, AccountNumber, and ModifiedDate columns in the Available Input Columns box. 13. Click Script in the left-hand pane.
  • 11. 10 14. Confirm that the ScriptLanguage property value is Microsoft Visual Basic, and then Click Edit Script. NOTE: In SQL Server 2008, theDesign Scriptbutton was renamed toEdit Script and support was added for the Microsoft Visual C# programming language. Add the following Visual Basic code. Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper Imports Microsoft.SqlServer.Dts.Runtime.Wrapper Imports System.Data.OleDb Imports System.Data.Common <Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute> _ <CLSCompliant(False)> _ PublicClass ScriptMain Inherits UserComponent
  • 12. 11 Dim row_count As Int64 Dim batch_size As Int64 Dim connMgr As IDTSConnectionManager100 Dim oledbconn As OleDbConnection Dim oledbtran As OleDbTransaction Dim oledbCmd As OleDbCommand Dim oledbParam As OleDbParameter PublicOverridesSub PreExecute() batch_size = 8 * 1024 row_count = 0 oledbCmd = New OleDbCommand("INSERT INTO Customer(CustomerID, TerritoryID, AccountNumber, ModifiedDate) VALUES(?, ?, ?, ?)", oledbconn) oledbParam = New OleDbParameter("@CustomerID", OleDbType.Integer, 7) oledbCmd.Parameters.Add(oledbParam) oledbParam = New OleDbParameter("@TerritoryID", OleDbType.Integer, 7) oledbCmd.Parameters.Add(oledbParam) oledbParam = New OleDbParameter("@AccountNumber", OleDbType.VarChar, 7) oledbCmd.Parameters.Add(oledbParam) oledbParam = New OleDbParameter("@ModifiedDate", OleDbType.Date, 7) oledbCmd.Parameters.Add(oledbParam) oledbtran = oledbconn.BeginTransaction() oledbCmd.Transaction = oledbtran MyBase.PreExecute() EndSub PublicOverridesSub AcquireConnections(ByVal Transaction AsObject) connMgr = Me.Connections.Connection oledbconn = CType(connMgr.AcquireConnection(Nothing), OleDb.OleDbConnection) EndSub PublicOverridesSub Input0_ProcessInputRow(ByVal Row As Input0Buffer) With oledbCmd .Parameters("@CustomerID").Value = Row.CustomerID .Parameters("@TerritoryID").Value = Row.TerritoryID .Parameters("@AccountNumber").Value = Row.AccountNumber .Parameters("@ModifiedDate").Value = Row.ModifiedDate .ExecuteNonQuery() EndWith row_count = row_count + 1 If (row_count Mod batch_size) = 0 Then oledbtran.Commit() oledbtran = oledbconn.BeginTransaction() oledbCmd.Transaction = oledbtran EndIf EndSub PublicOverridesSub PostExecute() MyBase.PostExecute() EndSub
  • 13. 12 PublicOverridesSub ReleaseConnections() MyBase.ReleaseConnections() EndSub EndClass 15. Save your changes to the Script component. The SSIS package now contains the custom script component, configured as a destinationto bulk load data to the Oracle data source. Note: The above script component connectsto Oracle, but it can be used to connect to other third-partydata sources such as Sybase and Informix. The only change that you need to make is to configure the connection manager to use the correct OLE DB providers available for Sybase and Informix. Third-party Components In addition to the Script component solution discussed in this paper, there are third-party components that you can use to achieve optimal performance when loading Oracle data. The following components work with both SQL Server 2005 and SQL Server 2008. • Oracle Destination and ODBC Destination components from CozyRoc. For more information, see theCozyRoc web site. • Oracle Bulk Loader SSIS Connector from Persistent. For more information, contact Persistent. • Progress DataDirect Connect and DataDirect Connect64 components from Progress DataDirect. For more information, see the DataDirect web site. Conclusion SQL Server 2008, 2008 R2, and 2012 (Enterpriseand Developer editions) support bulk loadingOracle data using SSIS packages. For other SQL Server versions and editions, the following are alternatives for optimizing the loading of Oracle datawhen using SSIS packages. Alternative SQL Server versions and editions Script component bulk loads data to Oracle using the Oracle OLE DB provider from Oracle SQL Server 2005 and the non-Enterprise and non-Developer editions of SQL Server 2008, 2008 R2, and 2012. Third-party components that connect to Oracle, from CozyRoc, Persistent, and DataDirect SQL Server 2005 and the non-Enterprise and non-Developer editions of SQL Server 2008 and 2008 R2. For more information:
  • 14. 13 Connectivity and SQL Server 2005 Integration Services(http://msdn.microsoft.com/en- us/library/bb332055(SQL.90).aspx ) SSIS with Oracle Connectors (http://social.technet.microsoft.com/wiki/contents/articles/1957.ssis-with-oracle-connectors.aspx) SQL Server 2012: Microsoft Connectors V2.0 for Oracle and Teradata (http://www.microsoft.com/en-us/download/details.aspx?id=29283) SSIS and Netezza: Loading data using OLE DB Destination (http://www.rafael- salas.com/2010/06/ssis-and-netezza-loading-data-using-ole.html) Did this paper help you? Please give us your feedback. Tell us on a scale of 1 (poor) to 5 (excellent), how would you rate this paper and why have you given it this rating? For example: • Are you rating it high due to having good examples, excellent screen shots, clear writing, or another reason? • Are you rating it low due to poor examples, fuzzy screen shots, or unclear writing? This feedback will help us improve the quality of white papers we release. Send feedback.