Migrate Database to SQL Server Database

Similar documents
Migrate a Database to Microsoft SQL Server Database

Database Mirroring: High Availability (HA) and Disaster Recovery (DR) Technology

Install and Configure SQL Server Database Software Interview Questions and Answers

HA/Disaster and Recovery Solution Mirroring Review & Log Shipping

Only for Data Group Students Do not share with outsiders and do not use for commercial purposes.

Virtualization and Cloud Computing

Jolly Server Getting Started Guide

How to Connect to CDL SQL Server Database via Internet

CIMHT_006 How to Configure the Database Logger Proficy HMI/SCADA CIMPLICITY

Querying Databases Using the DB Query and JDBC Query Nodes

Migrating helpdesk to a new server

Aradial Installation Guide

Review of SwisSQL Data Migration Tool

Connecting to SQL server

General Tips: Page 1 of 20. By Khaled Elshaer.

These notes are for upgrading the Linko Version 9.3 MS Access database to a SQL Express 2008 R2, 64 bit installations:

FileMaker 12. ODBC and JDBC Guide

Guide to the MySQL Workbench Migration Wizard: From Microsoft SQL Server to MySQL

Cloud Services ADM. Agent Deployment Guide

FileMaker 11. ODBC and JDBC Guide

INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO:

Installing SQL Express. For CribMaster 9.2 and Later

FmPro Migrator - FileMaker to SQL Server

Immotec Systems, Inc. SQL Server 2005 Installation Document

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

Converting InfoPlus.21 Data to a Microsoft SQL Server 2000 Database

Migrating a Database from Legi for Windows 2.X to MS Access

StoreGrid Backup Server With MySQL As Backend Database:

CounterPoint SQL and Magento ecommerce Interface

Avatier Identity Management Suite

2.3 - Installing the moveon management module - SQL version

Active Directory Management. Agent Deployment Guide

Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL

Connect to MySQL or Microsoft SQL Server using R

NovaBACKUP xsp Version 15.0 Upgrade Guide

Active Directory Management. Agent Deployment Guide

ilaw Server Migration Guide

ODBC (Open Database Communication) between the ElevateDB Database and Excel

FileMaker 14. ODBC and JDBC Guide

Tech Note 663 HMI Reports: Creating Alarm Database (WWALMDB) Reports

Database Assistant. Once Database Assistant is installed you must login to gain access to the database. Copyright 2009

Suite. How to Use GrandMaster Suite. Exporting with ODBC

SpectraPro. SLQ Server databases

Setting up SQL Translation Framework OBE for Database 12cR1

Install MS SQL Server 2012 Express Edition

Transferring Your Hosting Account

Setting Up ALERE with Client/Server Data

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

Video Administration Backup and Restore Procedures

NovaBACKUP xsp Version 12.2 Upgrade Guide

Moving the TRITON Reporting Databases

Setting up a database for multi-user access

FileMaker 13. ODBC and JDBC Guide

STATISTICA VERSION 10 STATISTICA ENTERPRISE SERVER INSTALLATION INSTRUCTIONS

SEER Enterprise Shared Database Administrator s Guide

How to move a SQL database from one server to another

Setting up an MS SQL Server for IGSS

MyNetFone Virtual Fax. Virtual Fax Installation

for Networks Installation Guide for the application on a server September 2015 (GUIDE 2) Memory Booster version 1.3-N and later

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

HP Client Automation Standard Fast Track guide

How-To: MySQL as a linked server in MS SQL Server

Matisse Installation Guide for MS Windows

Installation / Migration Guide for Windows 2000/2003 Servers

How to gain direct access to SQL Server at Garching via SSH

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later

Voyager Reporting System (VRS) Installation Guide. Revised 5/09/06

Synchronization with Microsoft Team Foundation Server 2010

Installation of MSSQL Server 2005 Express Edition and Q-Monitor 3.x.x

Matisse Installation Guide for MS Windows. 10th Edition

Configuring Avaya Aura Communication Manager and Avaya Call Management System Release 16.3 with Avaya Contact Center Control Manager Issue 1.

INFORMATION TECHNOLOGY IT SPECIALIST PROGRAMS

EventSentry Overview. Part I Introduction 1 Part II Setting up SQL 2008 R2 Express 2. Part III Setting up IIS 9. Part IV Installing EventSentry 11

Sage Intelligence Financial Reporting for Sage ERP X3 Version 6.5 Installation Guide

Linking Access to SQL Server

How to Backup Your Eclipse.Net Database Automatically. To clearly document a specific automatic SQL database backup method for Eclipse.net.

MS SQL Server Database Management

Server Installation, Administration and Integration Guide

DB Administration COMOS. Platform DB Administration. Trademarks 1. Prerequisites. MS SQL Server 2005/ Oracle. Operating Manual 09/2011

Linko Software Express Edition Typical Installation Guide

TO SQL DB. Manual. Page 1 of 7. Manual. Tel & Fax: info@altiliagroup.com Web:

Microsoft SQL Server Express 2005 Install Guide

Data Warehouse Center Administration Guide

AWS Schema Conversion Tool. User Guide Version 1.0

Set Up Setup with Microsoft Outlook 2007 using POP3

MX-Contact Instruction Sheet: Importing Data Business Contact Manager

LockView 4.2 CompX Database & Network Configuration & Installation Manual

MICROSTRATEGY 9.3 Supplement Files Setup Transaction Services for Dashboard and App Developers

Toad for Data Analysts, Tips n Tricks

Installing Cobra 4.7

AWS Schema Conversion Tool. User Guide Version 1.0

ACCESSING IBM iseries (AS/400) DB2 IN SSIS

Installation manual SAP Business Objects Data Services XI 3.2 on a Microsoft Windows 7-64-bit machine

Technical Bulletin. SQL Express Backup Utility

Microsoft SQL Server Installation Guide

Upgrade ProTracker Advantage Access database to a SQL database

Installation of MSSQL Server 2008 Express Edition and Q-Monitor 3.x.x

LockView CompX Database & Network Configuration & Installation Manual

Business Intelligence Getting Started Guide

Transcription:

Written by Zakir Hossain, CS Graduate (OSU) CEO, Data Group Fed Certifications: PFA (Programming Foreign Assistance), COR (Contracting Officer), AOR (Assistance Officer) Oracle Certifications: OCP (Oracle Certified Professional), OCA (Oracle Certified Associate), Oracle RAC-Admin, Oracle Backup/Recovery-Admin, Oracle Performance/Monitoring-Admin, Oracle App Server-Admin Microsoft Certifications: MCDBA (Microsoft Certified Database Admin), MCITP: SQL Database Admin, MCITP: SharePoint Admin System Admin Certifications: MCITP: Windows Server 2012 Admin, RHCSA (Red Hat Certified System Admin) Programming Certifications: SCJP (Sun Certified Java Programmer) Other Certifications: Security+, ITIL V3.. Please Read License Agreement.. You are allowed to use this document only for your personal and job related uses. Under no circumstances, you are not allowed to share this document nor are you allowed to use for commercial or training purposes. You are allowed to neither sharing nor altering this document with any institute/organization and individual, business entity, and students either current or discontinued ie with anybody without written permission is 100% prohibited and violation of Federal Law of Intelligence Product. If you need our books, notes, documents, please contact directly with Zakir Hossain (ZHossain@DataGroupUSA.com, 703-203-2325) It is a Federal Copy Right Violation of Intelligence Product. Violators will be prosecuted with the fullest Extent of Federal Law. Introduction: Your company may have different types of databases running to support different functions. It could be because they do not have a standard platform to manage databases. Before we can migrate a database, we need to have appropriate driver for it. For an example, if you need to migrate Oracle, SQL Server, DB2, UDB, MySQL, and Sybase databases to a different type of database you need to have a driver for that specific database software. For an example, if you need to migrate MySQL database to SQL Server database, you need to have a driver of MySQL database and if you need to migrate Oracle database to SQL Server database, you need to have a driver of Oracle database. The good news for SQL Server DBA is if you need to migrate Oracle database to SQL Server database, Oracle driver comes with the SQL Server database software. So, you do not need to install the Oracle driver separately, in most cases. However, you need to have a right version Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 1/9

of driver to migrate a database. For an example, migrating Oracle 10g vs Oracle 11g database to SQL Server 2008, you need to have the right version of Oracle driver for Oracle 10g and 11g. Different methods of database migration to SQL Server: There are so many RDBMS (Relational Database Management System). Examples of some of the popular RDBMS are Oracle, SQL Server, DB2, UDB, MySQL, and Sybase. Now a day, MS Access is also considered as RDBMS. However, MS Access is has so many limitations like number of concurrent connections, database size, performance, types of data it can support etc. Any databases that we need to migrate, we can use following methods. 1. Using ODBC connection 2. Using DTS/SSIS package 3. Using Data Modeling Tool 4. Using third party tool Migrate Database Using ODBC Connection: Follow the steps below to migrate a database to SQL Server using ODBC connection: 1. Create ODBC connection to database that needs to migrate Here we will migrate MySQL database using ODBC connection method. 2. Create a database link from SQL Server to MySQL database 3. Create database objects (like tables, views etc) using T-SQL command Details of the steps: Step 1: Create ODBC Connection to MySQL Database: Before you proceed, you need to ensure that you have installed MySQL ODBC Driver/Connector. Here we will be using MySQL ODBC Connector 5.1. Steps to create ODBC connection: Open ODBC Data Source using following steps: Start > Settings > Control Panel > Administrative Tools > Data Sources (ODBC) > Click on tab "System DSN > Click on Add button as shown below: Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 2/9

Double click on Data Sources (ODBC). This will bring the next screen as shown below: Now click on System DSN tab and click on Add button. This will open the next screen as shown below: Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 3/9

Now select the MySQL ODBC 5.1 Driver and click on Finish. This will bring the next screen as shown below: Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 4/9

Fill this configuration options, based on your server. Here MySQL database is running on server DataGroup210. You can use sever name or IP address of the server. Press the "Test" button to ensure your connection settings are set properly and then the "OK" button when you're done. Configuration description: Data Source Name: DataGroup210 (It could be any name you like.) Description: Optional TCP/IP Server: MySQL database Server name or IP address Port: 3306 (Default port for MySQL database. Use right port based your server running) Named Pipe: Most cases, it does not work. So, do not use this option User: user name in MySQL database. Must have right privilege to this user, otherwise it will fail. Password: Type password for the user you are using Database: Select database your planning to create connection for. It may not be available in the drop down box. In that case, you can just type the name of the database. Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 5/9

Test/OK: Now click on Test button before you click on OK button. If you click on OK button OK, it will create the ODBC connection even it does not work. Step 2: Create a DB Link from SQL Server to MySQL Database: Before you can start migrating MySQL database to SQL Server, you must have to create a DB link to MySQL database from SQL Server. To create to a DB link from SQL Server, you can use following tools: 1. Management Studio/Enterprise Manager 2. Query Analyzer Here we will use Query Analyzer tool of SQL Server database. Open the Query Analyzer tool and run the following code: EXEC master.dbo.sp_addlinkedserver @server = N'DataGroup210_SMS, @srvproduct=n'mysql', @provider=n'msdasql', @provstr=n'driver={mysql ODBC 5.1 Driver}; SERVER=DataGroup210; DATABASE=sms; USER=root; PASSWORD=root; OPTION=3' Explanation of above code: -- @server: DataGroup210_SMS: Link Name to SMS database on DataGroup210 Server. This name will show in SQL Server Database as Database Link. It could be any name you like -- @srvproduct: Product Type. Example, MySQL, Oracle -- @provider: Provider, MSDASQL: Microsoft Data Access for SQL Server -- @ provstr: SERVER= DataGroup210: MySQL Server Name, Could be IP also This script will create a link to your MySQL database through the ODBC connection in SQL Server database. The link will appear in the Microsoft SQL Server Management Studio like this: Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 6/9

If it doesn't show up in Linked Server view, you may need to refresh your management studio. Step 3: Migrate Objects from MySQL to SQL Server Databases: Now to migrate the objects from MySQL database to SQL Server, you must need to follow the steps: 1. Create a database, where you would like to migrate the database from MySQL. Here we are migrating SMS database from MySQL Database to SQL Server database. So, we have created SMS database in SQL Server 2. Run the following T-SQL statement to migrate database objects: Here we are migrating following tables: note attendance candidate invoice payment openquery(datagroup210_sms, 'SELECT * sms.note') Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 7/9

openquery(datagroup210_sms, 'SELECT * sms.attendance) openquery(datagroup210_sms, 'SELECT * sms.attendance') openquery(datagroup210_sms, 'SELECT * sms.payment') openquery(datagroup210_sms, 'SELECT * sms.invoice') openquery(datagroup210_sms, 'SELECT * sms.invoice') Explanation of above code: : DB and Table Name in SQL Server openquery(datagroup210_sms, 'SELECT * sms.note') DataGroup210_SMS: DB Link name you have created in previous step sms.note: DB and table name in MySQL database Migrate Database Using Data Modeling Tool: There are so many tools in the market can be used to migrate MySQL database to any database systems. Some of the popular tools can be used for this purpose: 1. ERWin 2. Visio 3. Oracle SQL Developer Follow the steps below to migrate a database using Data Modeling Tool: Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 8/9

1. Create Logical Data Model (E-R Diagram): Here you have the physical database of the database that you need to migrate. So, you need to use the backward engineering/reverse engineering technique to create the Logical Data Model of the respective database. 2. Data Transformation: After creating the Logical Data Model, you should verify data types, length, primary key, foreign key and other constraints as needed. Based on your need and supported data types of the destination/target database, change to appropriate data type and then check and change other information like length, primary key, foreign key and other constraints as needed. 3. Create Physical Database: Now you have the Logical data model of the database that you are ready to migrate. Now you need to use the forward engineering technique to create the Physical Database in the destination database on destination server. Email: ZHossain@DataGroupUSA.com Web: www.datagroupusa.com/portal Phone: 703-203-2325 9/9