Copying data from SQL Server database to an Oracle Schema. White Paper



Similar documents
Terminal Services vs. Remote Desktop Connection in Windows 2000 and Windows White Paper

There are three common ways to get data from Oracle into SQL Server:

Video Administration Backup and Restore Procedures

RJS Monitor. User Guide RJS Software Systems Document Version

Microsoft SQL Server for Oracle DBAs Course 40045; 4 Days, Instructor-led

HYPERION SYSTEM 9 N-TIER INSTALLATION GUIDE MASTER DATA MANAGEMENT RELEASE 9.2

SQL Server Replication Guide

Database migration using Wizard, Studio and Commander. Based on migration from Oracle to PostgreSQL (Greenplum)

MS SQL 2000 Server with CDR DICOM 3.5 and Recommended WAN Configuration

Oracle Data Integrator 12c: Integration and Administration

Oracle Data Integrator 11g: Integration and Administration

HOW TO SILENTLY INSTALL CLOUD LINK REMOTELY WITHOUT SUPERVISION

SQL Server Integration Services with Oracle Database 10g

PATROL From a Database Administrator s Perspective

QAD Enterprise Applications. Training Guide Demand Management 6.1 Technical Training

Data Migration between Document-Oriented and Relational Databases

Cúram Business Intelligence Reporting Developer Guide

StreamServe Persuasion SP4

SSIS Training: Introduction to SQL Server Integration Services Duration: 3 days

Job Automation. Why is job automation important?

Implementing Microsoft SQL Server 2008 Exercise Guide. Database by Design

How to Use PIPS Access to/from SQL Database Utility Program. By PIPSUS Support Team Dr. Chouikha

How to Copy A SQL Database SQL Server Express (Making a History Company)

Visual Studio.NET Database Projects

Moving the Web Security Log Database

Dell Boomi : Efficient Database Integration using Dell Boomi

Database Administrator Certificate Capstone Project Evaluation Checklist

Backing up and restoring HP Systems Insight Manager 6.0 or greater data files in a Windows environment

Microsoft SQL Server Installation Guide

Using Microsoft Windows Authentication for Microsoft SQL Server Connections in Data Archive

Promap V4 ActiveX MSI File

Microsoft SQL Server Installation Guide

KonyOne Server Installer - Linux Release Notes

SQL SERVER DEVELOPER Available Features and Tools New Capabilities SQL Services Product Licensing Product Editions Will teach in class room

enicq 5 System Administrator s Guide

Monitoring Oracle Enterprise Performance Management System Release Deployments from Oracle Enterprise Manager 12c

Optimizing Your Database Performance the Easy Way

Web Security Log Server Error Reference

MobiLink Synchronization with Microsoft SQL Server and Adaptive Server Anywhere in 30 Minutes

Print Audit 6 Network Installation Guide

Moving the TRITON Reporting Databases

A Scheme for Automation of Telecom Data Processing for Business Application

Implementing a Data Warehouse with Microsoft SQL Server 2012

Two new DB2 Web Query options expand Microsoft integration As printed in the September 2009 edition of the IBM Systems Magazine

Implementing and Maintaining Microsoft SQL Server 2008 Integration Services

Connecting to Manage Your MS SQL Database

MIGRATING TO AVALANCHE 5.0 WITH MS SQL SERVER

PROGRESS OPENEDGE PRO2 DATA REPLICATION

LearnFromGuru Polish your knowledge

Accounts Receivable: Importing Remittance Data

Implementing a Data Warehouse with Microsoft SQL Server

DEPLOYMENT ROADMAP March 2015

SQL Server Integration Services Using Visual Studio 2005

Business Intelligence Tutorial

Alert Notification of Critical Results (ANCR) Public Domain Deployment Instructions

DBX. SQL database extension for Splunk. Siegfried Puchbauer

2. Unzip the file using a program that supports long filenames, such as WinZip. Do not use DOS.

Insight Video Net. LLC. CMS 2.0. Quick Installation Guide

COURSE 20463C: IMPLEMENTING A DATA WAREHOUSE WITH MICROSOFT SQL SERVER

Specops Command. Installation Guide

W I S E. SQL Server 2012 Database Engine Technical Update WISE LTD.

Implementing a Data Warehouse with Microsoft SQL Server

EnterpriseLink Benefits

How To Load Data Into An Org Database Cloud Service - Multitenant Edition

Microsoft SQL Server Features that can be used with the IBM i

Business Intelligence Tutorial: Introduction to the Data Warehouse Center

AVALANCHE MC 5.3 AND DATABASE MANAGEMENT SYSTEMS

SQL Server Administrator Introduction - 3 Days Objectives

Informatica Corporation Proactive Monitoring for PowerCenter Operations Version 3.0 Release Notes May 2014

SEER Enterprise Shared Database Administrator s Guide

Consolidate by Migrating Your Databases to Oracle Database 11g. Fred Louis Enterprise Architect

Setting up the Oracle Warehouse Builder Project. Topics. Overview. Purpose

Implementing a Data Warehouse with Microsoft SQL Server 2012 MOC 10777

Configuring an Alternative Database for SAS Web Infrastructure Platform Services

Print Audit 4 Network Install Guide

Implementing a Data Warehouse with Microsoft SQL Server

About database backups

SmartConnect Users Guide

McAfee epolicy Orchestrator Software

Upgrading MySQL from 32-bit to 64-bit

Selecting the Right Change Management Solution Key Factors to Consider When Evaluating Change Management Tools for Your Databases and Teams

Integrating VoltDB with Hadoop

Oracle BI 10g: Analytics Overview

Implementing a Data Warehouse with Microsoft SQL Server MOC 20463

COURSE OUTLINE MOC 20463: IMPLEMENTING A DATA WAREHOUSE WITH MICROSOFT SQL SERVER

Implementing a Data Warehouse with Microsoft SQL Server 2012

$99.95 per user. SQL Server 2008/R2 Database Administration CourseId: 157 Skill level: Run Time: 47+ hours (272 videos)

Implement a Data Warehouse with Microsoft SQL Server 20463C; 5 days

Published. Technical Bulletin: Use and Configuration of Quanterix Database Backup Scripts 1. PURPOSE 2. REFERENCES 3.

HansaWorld SQL Training Material

epolicy Orchestrator Log Files

XenClient Enterprise Synchronizer Installation Guide

Status Monitoring. Using Drivers by Seagull to Display Printer Status Information WHITE PAPER

About This Guide Signature Manager Outlook Edition Overview... 5

Comparing Microsoft SQL Server 2005 Replication and DataXtend Remote Edition for Mobile and Distributed Applications

Setting up a database for multi-user access

BlackBerry Enterprise Server Resource Kit

Alteryx Predictive Analytics for Oracle R

Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC

Cisco Process Orchestrator Installation Guide

Transcription:

Copying data from SQL Server database to an Oracle Schema White Paper

Copyright Decipher Information Systems, 2005. All rights reserved. The information in this publication is furnished for information use only, does not constitute a commitment from Decipher Information Systems of any features or functions discussed and is subject to change without notice. Decipher Information Systems assumes no responsibility or liability for any errors or inaccuracies that may appear in this publication. Last revised: June 2006

Table of Contents Copying data from SQL Server database to an Oracle Schema... 4 Abstract... 4 Different Options Available... 4 Script Framework and the steps involved... 5 Summary... 8

Copying data from SQL Server database to an Oracle Schema Abstract Usage of multiple RDBMS is becoming a norm and a necessity in many IT shops. Oracle, DB2 UDB and Microsoft SQL Server are the three top-most RDBMS that are deployed in the shops today. In future whitepapers we will cover the hurdles that are faced in such shops that use heterogeneous RDBMS and the different tools and techniques that can be used to make work easier. One of the many asks that DBAs in these shops face, is data movement between an Oracle Schema to a SQL Server database or vice-versa. That needs to be done efficiently and in the minimum amount of time. In this whitepaper, we will look at a framework of scripts that will make the movement of data from a SQL Server Database to an Oracle schema feasible and we will look at the different options that can be deployed to make that happen and why we opted for choosing the framework scripts approach. Different Options Available There are a couple of options that are available for copying over the data from a SQL Server database to an Oracle Schema: 1. Linked Servers: Linked servers can be set up on the SQL Server instance and then data can be pushed out to an Oracle schema. This works fine when you are dealing with smaller sub-sets of data but has several limitations in terms of: a. the data-types supported by the provider/odbc driver that has been used for creating the linked server, b. Performance is not good for decent size tables. Advantage of this approach is that this is all SQL based and you can specify different criteria, put filters etc. in order to classify your data sub-set. 2. Oracle Heterogeneous Services: This is Oracle s answer to Microsoft s linked servers. By setting it up, one can use it to pull data from a SQL Server database and load it up in an Oracle Schema. This has the same limitations and advantages as those of option #1 mentioned above. 3. DTS (Data Transformation Services) or SSIS (SQL Server Integration Services): Microsoft SQL Server 2000 ships with DTS and SQL 2005 ships with SSIS. SSIS is way robust than DTS for this kind of work and can be used to load the data up in an Oracle Schema. These tools can be used to provide a real ETL process for the data loading process. Usage of SSIS will be covered in a future white-paper. 4. Scripting Framework: Scripts can be written to bcp the data out from a SQL Server database and then use SQL *LDR (SQL Loader) to load the data into an Oracle Schema. 5. Third party tools: A couple of third party tools also provide these options.

In this white-paper, we will introduce a scripting framework that can be used to copy data from any SQL Server database to any Oracle schema as long as the schema structures for the tables and their columns are the same i.e. the underlying assumption of this scripting framework is that the DBA in the IT shop is maintaining the application that runs on multiple RDBMS and as a result of that the Oracle schema (structure wise) is the same as the one used for SQL Server or DB2 UDB. Script Framework and the steps involved Assumptions: Steps: 1) As mentioned before, the assumption is that the schema is the same between SQL Server and Oracle. 2) The script framework uses a python script to parse through the output to generate multiple control files for the Oracle schema to facilitate the easy loading of the data using sql *ldr. You can download python (for windows) software from: http://www.python.org/download If you do not intend to use the parser DISBulk.py, then there is no need to download it. In that case, you will need to either manually split the control files or write a parser of your own. 1) Take the Script: "Create_DIS_Conversion_Objects.sql" and run it in the destination Oracle schema to create the truncate_table, disable_fks and other objects. a. Run truncate_table in the Oracle Schema: exec truncate_table b. Run disable_fks and disable_triggers in the Oracle Schema: i. exec disable_fks ii. exec disable_trigger 2) Take the files supplied and copy them to the SQL Server database Server or Alternatively, you can also run this from any client machine (the only difference would be that once the data files have been generated, then you would need to copy over the data files into that client machine folder). For the sake of Simplicity, you can adhere to this folder naming convention (though if you want, you can change it and then change the scripts accordingly): C:\DIS_CONV \Oracle \Bad \Data

\Log Copy all the scripts under the \Oracle directory. 3) In Query Analyzer, copy the "GEN_BCP_DATA_FILES.SQL" script and change the name of the database to be the name of the source database that resides on that instance. a. Make the changes for the configuration information i.e. the login-id, path where the data files should be generated etc. b. Execute it. This will dump all the tables from that database into their separate data files in the folder that you specify (this folder will be on the DB Server) --> alternatively a UNC naming path can be followed as well if the client has an issue (though I don't see why anyone would have an issue with this). Copy all these data files into the \Oracle\Data folder mentioned above. 4) Now, take the SQL script: "GEN_CONTROL_FILES.SQL" and change the name of the database to be the name of the source database that resides on that instance. Run that in Query Analyzer using the text mode (Ctrl-T). This script will generate all the control files that you need for loading up of the data that you generated in the previous step into Oracle. Copy the entire set and put them into a file called: "DISBULK.def" (a sample file has been provided -- replace the contents from your execution run). NOTE: Please use WORDPAD for copying and pasting since notepad will ruin the formatting. Then copy this file in the Oracle directory above. 5) After the file DISBULK.def has been copied, double-click on the DISBULK.py python script which will parse through that file and dump out the control files for each of the tables in the same directory i.e. under the Oracle folder. 6) Now, take the script: "GEN_BATCH_FILES.SQL" and change the name of the database to be the name of the source database that resides on that instance. Run that in Query Analyzer using the text mode (Ctrl-T). a. Make the changes for the configuration information i.e. path where the data files should be generated, the Oracle connection information etc. b. Execute it. This will generate the batch file contents. "DIS_ORA_DATA_LOAD.BAT" file as is. Copy these contents into the NOTE: Turn off Word-Wrap (under the format option in notepad).

7) Double-click the batch file to start the data load from SQL Server to Oracle. a. Check for the bad data records and the logs for any errors. b. Fix any issues that are noticed and selectively re-import the data. 8) Run enable_fks and enable_triggers in the Oracle Schema and check for any violations that result from it : a. exec enable_fks b. exec enable_trigger Run DIS_update_sequences in the Oracle Schema: Exec DIS_update_sequences 9) Run the script "Gather_Stats.sql" to gather the stats on the tables and their indexes. 10) Once that has been done, you can get the number of rows per table using this SQL: select table_name, num_rows from user_tables where num_rows > 0 order by table_name / Checking for Errors: You should check the contents of the BAD and the LOG folders to fix any data related errors that you might have encountered during the data loading process. Checking for the rowcounts: You can also establish a link between SQL Server and Oracle and run this SQL to ensure that you have the right object counts for your tables. You can use the script: DIS_Check_Rowcounts.sql in order to establish the linked server between SQL Server instance and Oracle and then query the schemas and get the information. Be sure to change the names of the instance, the user-name etc. appropriately. Also, that particular script is dependent upon whether proper statistics have been collected on the SQL Server database and the Oracle Schema. There are other ways also to count the number of rows in the tables in a schema (look into the How-To documents on our site : http://www.decipherinfosys.com/faq-home.htm ). All the scripts that are used for this framework are present as a separate download see Het_RDBMS_1.zip file.

Summary We introduced a scripting framework in this white-paper that can be used to copy data from a SQL Server database to an Oracle Schema given that the schema structures are the same between the two. Further information on the bcp command utility can be obtained from SQL Server Books Online and information on SQL *LDR (SQL Loader) utility from Oracle can be obtained from the Oracle online documentation at OTN. We hope that you would found this useful for your work.