how to backup and restore database of SQL Server
Back up
1,右键选中需要备份的数据库,Tasks-->Backup

2.General中,Destination,先remove掉之前的,然后再Add
需要注意的是,add的文件,必须要以.bak为后缀名,否则后面restore的话,不会显示出备份的文件
Restore
1.在数据库服务器的Databases上右键,选择Restore Database
1.1 General选项卡
1.1.1选择Device进行浏览,找到之前备份的文件。在查看文件的时候,默认是查看.bak文件。
不过也可以选择all files,那样可以看到所有的文件
1.1.2 General里面,Destination中的Database需要起一个不同的名字,这个名字是显示在ManagementStudio中的
选择路径之后,点击刷新的图标,然后下方会自动筛选

可以同时添加多个备份数据库,但是每一个数据库的restore plan是需要切换选项卡来进行独立设置的
1.2 Files选项卡
在General中,每切换一个数据库,Files选项卡中都需要独立配置一下
Logical File中的Rows Data和Log,都需要进行重命名,确保不重名。Restored as 这个列的里面的数据需要重命名
1.3 Options选项卡
取消勾选Tail-log backup
Restore failed

Restore failed
TITLE: Microsoft SQL Server Management Studio
------------------------------
Restore of database 'd_lisa_Program_dev01_v5000' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The tail of the log for the database "d_lisa_Program_dev01_v5000" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log. (Microsoft.SqlServer.SmoExtended)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=12.0.6024.0+((SQL14_PCU_Main).180907-0056)&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
The error message you are getting tells you exactly what you need to do if you don't care about the existing database or log.
RESTORE DATABASE DAtabaseName FROM DISK = 'C:\DBName-Full Database Backup'
WITH REPLACE
In SQL Server Management Studio (Tasks > Restore), you can add the WITH REPLACE option by opening the page "Options" on the left side and ticking "Overwrite the existing database".
官方文档
https://msdn.microsoft.com/en-us/library/ms187510(v=sql.110).aspx 仅针对于SQL Server 2012
https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/create-a-full-database-backup-sql-server 针对于SQLServer 2016
how to backup and restore database of SQL Server的更多相关文章
- 转载:Character data is represented incorrectly when the code page of the client computer differs from the code page of the database in SQL Server 2005
https://support.microsoft.com/en-us/kb/904803 Character data is represented incorrectly when the cod ...
- [Windows Azure] Managing SQL Database using SQL Server Management Studio
Managing Windows Azure SQL Database using SQL Server Management Studio You can use Windows Azure SQL ...
- 未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包。(转)
今天费了九牛二虎之力,重转好了vs2010之后,打开解决方案,报出下面的错误: ---------------------------Microsoft Visual Studio---------- ...
- Get Error when restoring database in Sql Server 2008 R2
When I restored a database I got an error: "The backup set holds a backup of a database ot ...
- 【数据库-Azure SQL Database】SQL Server 如何将数据库备份到 Azure Storage
打开本地的 SQL Server Management Studio.首先创建 Credentials.命令如下: IF NOT EXISTS (SELECT * FROM sys.credent ...
- Import .bak file to a database in SQL server
https://stackoverflow.com/questions/1535914/import-bak-file-to-a-database-in-sql-server On SQL Serve ...
- Intellij Idea 配置database 连接SQL Server 2012
首先确认通过TCP IP来连接连接SQLServer 2012 确保 Server Authentication选择了SQL Server and Windows Authentication ...
- Restore database use sql `*.bak` file
1.第一步: 2.第二步: 3.第三布: 4.第四步:
- 打开visual studio 2010报错:未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包
1 解决: 运行cmd 2 输入:regsvr32 %windir%\system32\jscript.dll
随机推荐
- WebSocket 前端封装
$.extend({ socketWeb:function (opt) { if("WebSocket" in window){ var setting=$.extend({ ur ...
- java+jsp+sqlserver实现简单的增删改查操作 连接数据库代码
1,网站系统开发需要掌握的技术 (1)网页设计语言,html语言css语言等 (2)Java语言 (3)数据库 (4)等 2,源程序代码 (1) 连接数据库代码 package com.jaovo.m ...
- numpy学习笔记 - numpy常用函数、向量化操作及基本数学统计方法
# -*- coding: utf-8 -*-"""主要记录代码,相关说明采用注释形势,供日常总结.查阅使用,不定时更新.Created on Fri Aug 24 19 ...
- IDEA设置控制台日志 不换行
最新版的IDEA设置控制台不自动换行位置如下:Setting->Editor->General->Console,不要勾选下图项即可.
- 【codeforces 370C】Mittens
[题目链接]:http://codeforces.com/problemset/problem/370/C [题意] 给你n个人,每个人都有一双相同颜色的手套; 然允许在所有人之间交换手套; (每个人 ...
- 【codeforces 128C】Games with Rectangle
[题目链接]:http://codeforces.com/problemset/problem/128/C [题意] 让你一层一层地在n*m的网格上画k个递进关系的长方形;(要求一个矩形是包含在另外一 ...
- CI框架源代码阅读笔记2 一切的入口 index.php
上一节(CI框架源代码阅读笔记1 - 环境准备.基本术语和框架流程)中,我们提到了CI框架的基本流程.这里再次贴出流程图.以备參考: 作为CI框架的入口文件.源代码阅读,自然由此開始. 在源代码阅读的 ...
- XCL-Chart柱形图的期望线/分界线
周日在柱形图上加了两个小功能,当中之中的一个是加上了期望线/分界线,功能非常小,但我个人非常喜欢这个功能(好像之前也没看到别的图表库原生支持这个. ) 主要是加上这些小小的横线后,能非常明显的区分出数 ...
- MYSQL学习笔记三:日期和时间函数
MYSQL学习笔记三:日期和时间函数 1. 获取当前日期的函数和获取当前时间的函数 /*获取当前日期的函数和获取当前时间的函数.将日期以'YYYY-MM-DD'或者'YYYYMMDD'格式返回 */ ...
- OWIN是Open Web Server Interface for .NET
http://owin.org/ Servers and Hosts Katana Nowin Suave Frameworks Jasper Nancy SignalR WebApi WebShar ...
