DAC Usage4:从 Backup Package(.bacpac)还原DB
使用DAC,能够将database的schema 和 data 从一个server 或 cloud 上复制到另外一个server上,存储schema 和 data的文件是 .bacpac 文件。
方法一,使用SSMS Wizard
右击Databases,打开“Import Data-tier Application”,打开Wizard,按照UI提示配置即可

方法二,使用SqlPackage.exe 实现自动Import DAC
Import the bacpac file to SQLAzure
“C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe” /a:Import /sf:C:\DataExtraction\Tailspintoys.bacpac /tsn:cgrd7z8kac.database.windows.net /tdn:Tailspintoys /tu:mysysadmin@cgrd7z8kac /tp:Pa55w0rd
sf – Specifies a source file to be used as the source of action instead of database.
tsn – Specifies the name of the server that hosts the target database.
tdn – Specifies the name of the target database.
tu – SQL Server user that is used to get access to the target database.
tp – specifies password that is used to get access to the target database.
如果使用Windows 验证方式登陆,可以使用ttsc差数代替 tu 和 tp。
C:\Program Files (x86)\Microsoft SQL Server\\DAC\bin\SqlPackage.exe -a:Import -sf:C:\TestDAC\dac_name.bacpac -tsn:server_name -tdn:db_name -ttsc:true
ttsc:{True | False} Specifies whether to use Secure Socket Layer (SSL) to encrypt the source database connection and bypass walking the certificate chain to validate trust.
在SSIS中使用Execute Process Task 调用SqlPackage.exe ,设置相应的Arguments,创建Schedule,能够实现从bacpac文件自动还原db。

Appendix
Backup Package (.bacpac)
A BACPAC is an artifact that encapsulates the database schema as well as the data stored in the database. The BACPAC is a Windows file with a .bacpac extension. Similar to the DACPAC, the BACPAC file format is open – the schema contents of the BACPAC are identical to that of the DACPAC. The data is stored in JSON format.
DACPAC and BACPAC are similar but they target different scenarios. A DACPAC is focused on capturing and deploying schema, including upgrading an existing database. The primary use case for a DACPAC is to deploy a tightly defined schema to development, test, and then production environments, and the reverse: capturing production’s schema and applying it to back to test and development environments.
A BACPAC, on the other hand, is focused on capturing schema and data. A BACPAC is the logical equivalent of a database backup and cannot be used to upgrade existing databases. The primary use case for a BACPAC is to move a database from one server to another - or from a local server to the cloud - and archiving an existing database in an open format.
A BACPAC supports two main operations:
EXPORT– The user can export the schema and the data of a database to a BACPAC.
IMPORT – The user can import the schema and the data into a new database in the host server.
参考doc:
DAC Usage4:从 Backup Package(.bacpac)还原DB的更多相关文章
- ylb: 数据库备份(Backup)和还原(Restore)
ylbtech-SQL Server:SQL Server- 数据库备份(Backup)和还原(Restore) -- ======================================== ...
- How to backup a remote PostgreSQL db and restore it locally?
pg_dump and pg_restore 来备份和恢复数据库中的数据. 原文: https://ksearch.wordpress.com/2012/09/28/how-to-backup-a- ...
- DAC Usage2:通过DAC实现DB Schema的Migration和Upgrade
一,Introduce Extract DAC 是从现存的DB中创建DAC,抽取DB Object的definition 和 与之相关的实例级别的元素,比如Login,以及Login 和User之间的 ...
- Aras Innovator DB备份与还原
错误信息 确认到该问题是因为孤立帐号的问题,在解决孤立帐号之前,可以通过语句查看,另外,还原了DB后,系统不会自动创建原来的登陆帐号的,需要手动新增登陆帐号 #查看孤立帐号列表exec sp_chan ...
- SQLServer批量备份与还原
原文地址:http://www.cnblogs.com/fygh/archive/2011/09/09/2172546.html 备份与还原是数据库避不开的主题,而作为DBA,经常会面临将一台机器上的 ...
- mysql数据库的备份和还原的总结
mysql数据库的备份和还原的总结 (来自一运维同事的总结) 1. 备份方式: 热备:数据库在线进行备份,不影响读和写的在线备份方式! 温备:数据库在线进行备份,对表备份时先锁定写操作,仅可以执行读操 ...
- SQLServer 批量备份与还原
备份与还原是数据库避不开的主题,而作为DBA,经常会面临将一台机器上的所有数据库重新构建到一台新机器上的要求: 在现在都讲究自动化管理的时代,传统的界面操作备份还原的做法不仅浪费时间和精力,而且还很容 ...
- mysql数据库-备份与还原-Percona XtraBackup 2.4备份工具使用
目录 xtrabackup 特点 备份生成的相关文件 xtrabackup 安装 xtrabackup 用法 1 备份 2 预备份 3 还原 4 其他 还原注意事项 xtrabackup实现完全备份及 ...
- 通过innobackupex实现对MySQL的完整备份与还原
备份 新建一个用于存放备份的目录 mkdir /backup 执行以下命令: innobackupex --password=test /backup/ 执行完后你会看到“completed OK!” ...
随机推荐
- ubuntu 安装phpstorm
1.清除 sudo apt-get purge openjdk* 2.添加源及更新源列表 sudo add-apt-repository ppa:webupd8team/java sudo apt-g ...
- mac linux 删除一个文件下边所有文件和文件夹
sudo rm -r -f 目录
- js中substr,substring,indexOf,lastIndexOf的用法小结
第一组:str.substr(start,length) 和 str.substring(start,end) 定义: str.substr(start,length) substr(start,le ...
- tornado学习笔记18 _RequestDispatcher 请求分发器
根据Application的配置,主要负责将客户端的请求分发到具体的RequestHandler.这个类实现了HTTPMessageDelegate接口. 18.1 构造函数 定义: def __in ...
- Python框架之Tornado(二)请求阶段
概述 上图是tornado程序启动以及接收到客户端请求后的整个过程,对于整个过程可以分为两大部分: 启动程序阶段,又称为待请求阶段(上图1.2所有系列和3.0) 接收并处理客户端请求阶段(上图3系列) ...
- 通读SDWebImage②--视图分类
本文目录 UIView+WebCacheOperation UIImageView+WebCache.UIImageView+HighlightedWebCache.MKAnnotationView+ ...
- firefox浏览器无法显示bootstrap图标问题总结
在学习bootstrap的时候,有一个问题始终非常疑惑和困扰,就是firefox无法显示bootstrap自带的那套名为“glyphicon”的图标,在图标的引用处显示的是一个小方块,如图所示(4前面 ...
- 【LabVIEW技巧】路径依赖解除方法
前言 LabVIEW程序开发,让我们的程序设计变的简单容易,但是设计过程中也不乏大量的重复性工作,其中最让人头痛的莫过于依赖冲突问题. 事实上,只要你对文件进行了修改或者移动,必不可少的依赖冲突就会产 ...
- Apache与Nginx区别
1.nginx相对于apache的优点: 轻量级,同样起web 服务,比apache占用更少的内存及资源 抗并发,nginx 处理请求是异步非阻塞的,而apache 则是阻塞型的,在高并发下nginx ...
- IRP完成例程返回值理解
第一,完成例程里面直接返回STATUS_SUCCESS,这时候IRP已经继续向上回卷,失去了对IRP的控制. 第二,完成例程里面返回STATUS_MORE_PROCESSING_REQUIRED,仍具 ...