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
------------------------------

https://stackoverflow.com/questions/12370944/the-tail-of-the-log-for-the-database-dbname-has-not-been-backed-up

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的更多相关文章

  1. 转载: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 ...

  2. [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 ...

  3. 未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包。(转)

    今天费了九牛二虎之力,重转好了vs2010之后,打开解决方案,报出下面的错误: ---------------------------Microsoft Visual Studio---------- ...

  4. 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 ...

  5. 【数据库-Azure SQL Database】SQL Server 如何将数据库备份到 Azure Storage

    打开本地的 SQL Server Management Studio.首先创建 Credentials.命令如下:   IF NOT EXISTS (SELECT * FROM sys.credent ...

  6. 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 ...

  7. Intellij Idea 配置database 连接SQL Server 2012

    首先确认通过TCP IP来连接连接SQLServer 2012     确保 Server Authentication选择了SQL Server and Windows Authentication ...

  8. Restore database use sql `*.bak` file

    1.第一步: 2.第二步: 3.第三布: 4.第四步:

  9. 打开visual studio 2010报错:未能正确加载“VSTS for Database Professionals Sql Server Data-tier Application”包

    1  解决: 运行cmd 2  输入:regsvr32 %windir%\system32\jscript.dll

随机推荐

  1. Oracle日期的加减运算

    无论是DATE还是timestamp都可以进行加减操作.可以对当前日期加年.月.日.时.分.秒,操作不同的时间类型,有三种方法: 1 使用内置函数numtodsinterval增加小时,分钟和秒2 加 ...

  2. 网页里如何使用js屏蔽鼠标右击事件

    图片.png 在后台管理系统里面,遇到了这样的一个问题,右击ztree菜单,弹出修改界面,但是,现在确实这样的,右击默认弹出功能提示的框框,看上去似乎很影响自己想要的功能,只能禁用了,那么,网页里如何 ...

  3. redhat下搭建jdk+tomcat环境

    由于redhat自带安装了jdk,我们需要现将其进行卸载 卸载系统自带的jdk版本: 查看自带的jdk: 输入命令:rpm -qa|grep gcj 可能看到如下类似的信息: libgcj-4.1.2 ...

  4. pythonweb django的学习

    Django 环境搭建及创建项目 首先安装django包,我使用的是pycharm,所以直接在IDE中就可以直接安装,但是django还需要手动配置系统变量 找到python根目录下的django文件 ...

  5. 【BZOJ 1089】[SCOI2003]严格n元树

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 设fi表示深度为i的树个数,si是fi的前缀和,即si为深度不超过i树的个数. 那么si=s[i-1]^n + 1 就是说 先选一个 ...

  6. 【codeforces 335A】Banana

    [题目链接]:http://codeforces.com/contest/335/problem/A [题意] 让你构造一个长度为n的字符串; 每次你可以从这个字符串中任意取走字符; 让你求出取的次数 ...

  7. Android里使用正則表達式

    在Android里怎样使用正則表達式: 以验证username为例.username一般字母开头,同意字母数字下划线.5-16个字节: String regEx = "^[a-zA-Z][a ...

  8. [Python]Use Flask-Admin with PostgreSQL

    This code recipe gives you an idea of how to use Flask-Admin with postgresql database. from flask im ...

  9. 我在SharePoint行业的从业经历(一)

      大约10年前,我刚刚毕业的时候,找到了一个试用的机会.那个时候的我对软件根本没有概念.编程学的也非常少.仅仅是在系里学过一点VB和C++,以为软件就是像QQ或者游戏之类的.我从来没想到会认 ...

  10. Windows API Hook

    原文地址:http://blog.sina.com.cn/s/blog_628821950100xmuc.html 原文对我的帮助极大,正是由于看了原文.我才学会了HOOK.鉴于原文的排版不是非常好, ...