DacImportExportCli : Import / Export Data from SQL Azure to SQL Server (vice versa)

來源:互聯網
上載者:User

 

SQL Azure Database Import / Export v 2.0 is a command line interface to create DacPac for importing / exporting data from SQL Azure to SQL Server and vice versa.

Its available for download from
https://www.sqlazurelabs.com/DacImportExportCli.zip (Note: You need to register for SQL Azure Labs for downloading beta programs)

This tool is built upon SQL Server “Denali”

It supports the following versions of SQL Servers

1. SQL Azure

2. SQL Server “Denali”

3. SQL Server 2008 SP1 or above / 2008 R2

4. SQL Server 2005 SP4 and above

5. SQL Server 2000 (Only Export is supported, Import is not supported)

To install and run this, you need the following list of components

1. .Net Framework 4.0

2. SQLSysClrTypes.msi –

https://www.sqlazurelabs.com/SQLSysClrTypes.msi

3. SharedManagementObjects.msi –

https://www.sqlazurelabs.com/SharedManagementObjects.msi

4. DACFramework.msi –

https://www.sqlazurelabs.com/DACFramework.msi

5. SQLDom.msi – https://www.sqlazurelabs.com/SqlDom.msi

6. TSQLLanguageService.msi –

https://www.sqlazurelabs.com/TSqlLanguageService.msi

After installing the prerequisites, extract the DacImportExportCli.zip to any directory ex. C:\DacImportExportCLI

Parameters Supported

-s – Server name

-d – Database name

-e – Integrated Authentication (For on-premise SQL Server)

-u – SQL User Name

-p – Password for SQL User name

-x – Export Schema and Data to bacpac file

-i – Import Schema and Data from bacpac file

-f – bacpac file , can be used as input and out based on –x or -i

-edition (Used for SQL Azure, Supported Values “business” or “web”)

-size – specify the Size of database in Gb ex. 1 (Used for SQL Azure to specify database size limit)

To Export Data and Schema

DacImportExportCli.exe –s ServerA.database.windows.net –d Northwind_DB –u dbuser –p password –f C:\DacImportExportCli\Northwind_DB_Backup.bacpac
–x

To Import Data and Schema

DacImportExportCli.exe –s ServerB.database.windows.net –d Northwind_DB –u dbuser –p password –f C:\DacImportExportCli\Northwind_DB_Backup.bacpac
–i

DacImportExportCli.exe –s ServerB.database.windows.net –d Northwind_DB –u dbuser –p password –f C:\DacImportExportCli\Northwind_DB_Backup.bacpac
–i –edition web –size 1

To Remove a Database created using DAC Import

DacImportExportCli.exe –s ServerB.database.windows.net –drop Northwind_DB –u dbuser –p password

If you manually dropped a database using “DROP DATABASE” command for the database created using bacpac, the bacpac registration will still be available in server, you so you need to use –drop option to clear the registration, before reimporting it again

Advantages:

1. Helps automating backup and restore process for SQL Azure

2. Helps automatic synchronizing between SQL Azure and SQL Server (On Premise) easily

Disadvantages:

1. The exported bacpac file contains the schema and data, not the log files, so it’s a not a real backup like the regular SQL Server backup file

For more information about DAC read the below white paper
http://msdn.microsoft.com/en-us/library/ff381683(SQL.100).aspx

Notes:

Do not install this if you have already installed SQL Server “Denali” CTP1

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.