Migrate a Database to Microsoft SQL Server Database



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

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

Jolly Server Getting Started Guide

HA/Disaster and Recovery Solution Mirroring Review & Log Shipping

Install and Configure SQL Server Database Software Interview Questions and Answers

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

Querying Databases Using the DB Query and JDBC Query Nodes

How to Connect to CDL SQL Server Database via Internet

Migrating helpdesk to a new server

Installing SQL Express. For CribMaster 9.2 and Later

Aradial Installation Guide

Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL

Review of SwisSQL Data Migration Tool

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

StoreGrid Backup Server With MySQL As Backend Database:

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:

SEER Enterprise Shared Database Administrator s Guide

FileMaker 12. ODBC and JDBC Guide

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

FileMaker 11. ODBC and JDBC Guide

INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO:

ilaw Server Migration Guide

Transferring Your Hosting Account

Video Administration Backup and Restore Procedures

Immotec Systems, Inc. SQL Server 2005 Installation Document

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

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

Moving the TRITON Reporting Databases

Avatier Identity Management Suite

2.3 - Installing the moveon management module - SQL version

NovaBACKUP xsp Version 15.0 Upgrade Guide

Setting up a database for multi-user access

Connect to MySQL or Microsoft SQL Server using R

STATISTICA VERSION 10 STATISTICA ENTERPRISE SERVER INSTALLATION INSTRUCTIONS

Cloud Services ADM. Agent Deployment Guide

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

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

FmPro Migrator - FileMaker to SQL Server

Suite. How to Use GrandMaster Suite. Exporting with ODBC

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

SpectraPro. SLQ Server databases

Setting up an MS SQL Server for IGSS

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

CounterPoint SQL and Magento ecommerce Interface

Setting Up ALERE with Client/Server Data

Matisse Installation Guide for MS Windows

MS SQL Server Database Management

QUANTIFY INSTALLATION GUIDE

Matisse Installation Guide for MS Windows. 10th Edition

Technical Bulletin. SQL Express Backup Utility

NovaBACKUP xsp Version 12.2 Upgrade Guide

Active Directory Management. Agent Deployment Guide

FileMaker 14. ODBC and JDBC Guide

FileMaker 13. ODBC and JDBC Guide

Setting up SQL Translation Framework OBE for Database 12cR1

Setup and configuration for Intelicode. SQL Server Express

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

Upgrade ProTracker Advantage Access database to a SQL database

Active Directory Management. Agent Deployment Guide

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

LockView 4.2 CompX Database & Network Configuration & Installation Manual

AWS Schema Conversion Tool. User Guide Version 1.0

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

Installation / Migration Guide for Windows 2000/2003 Servers

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

SafeCom G2 Enterprise Disaster Recovery Manual

AWS Schema Conversion Tool. User Guide Version 1.0

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

Migrating MSDE to Microsoft SQL 2005 Express SP4

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

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

Implementing Microsoft Windows 2000 Clustering

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

SQL Express to SQL Server Database Migration Goliath Performance Monitor v11.5

Install MS SQL Server 2012 Express Edition

Using Windows Task Scheduler instead of the Backup Express Scheduler

Synchronization with Microsoft Team Foundation Server 2010

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

Installation Instruction STATISTICA Enterprise Small Business

LockView CompX Database & Network Configuration & Installation Manual

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

Moving the Web Security Log Database

How to protect, restore and recover SQL 2005 and SQL 2008 Databases

Linking Access to SQL Server

Database Maintenance Guide

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

Installation Instruction STATISTICA Enterprise Server

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

STATISTICA VERSION 12 STATISTICA ENTERPRISE SMALL BUSINESS INSTALLATION INSTRUCTIONS

Installing and configuring Microsoft Reporting Services

SOFTWARE INSTALLATION INSTRUCTIONS CLIENT/SERVER EDITION AND WEB COMPONENT VERSION 10

Installation / Backup \ Restore of a Coffalyser.Net server database using SQL management studio

Microsoft SQL Server Express 2005 Install Guide

Simple Disaster Recovery

VirtualCenter Database Maintenance VirtualCenter 2.0.x and Microsoft SQL Server

Set Up Setup with Microsoft Outlook 2007 using POP3

Transcription:

-: NOTE :- Altering, printing, sharing with anybody, any training institute or commercial use without written permission is 100% prohibited. Please see the copy right information. Written by Zakir Hossain, Manager Enterprise Architecture Configuration & Database, US Dept. of Defense CEO, Data Group CS Graduate (OSU), ITIL V3, OCP, OCA, MCDBA, MCIPT (Database Admin), Security+ Other Certifications: Oracle RAC Admin, Oracle Backup & Recovery Admin, Oracle Performance & Monitoring Admin, Oracle Application Server Admin, System Admin (Windows/RedHat), Certified Java Programmer Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 1/10

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 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: Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 2/10

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: Double click on Data Sources (ODBC). This will bring the next screen as shown below: Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 3/10

Now click on System DSN tab and click on Add button. This will open the next screen as shown below: Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 4/10

Now select the MySQL ODBC 5.1 Driver and click on Finish. This will bring the next screen as shown below: Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 5/10

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 Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 6/10

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. 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: Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 7/10

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') Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 8/10

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 Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 9/10

2. Visio 3. Oracle SQL Developer Follow the steps below to migrate a database using Data Modeling Tool: 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. Web: www.datagroupusa.com/helpdesk Phone: 703-986-9944 10/10