二:Recovery models(恢复模式)
For each database that you create in SQL Server, with the exception of the system databases, you can configure it to use one of three possible recovery models (simple, full, bulk-logged). Here is a simple script to display the recovery models of all on-line databases:
在数据库中创建的每个数据库,除了系统数据之外,你都能配置三种恢复模式(简单、完全、大量日志)中的一个。如下是显示在线数据库的恢复模式:
SELECT name, (SELECT DATABASEPROPERTYEX(name, 'RECOVERY')) RecoveryModel FROM master..sysdatabases ORDER BY name
If you are running SQL Server 2005 or later, you can use this script instead:
如果你运行在SQL Server 2005或者更高的版本上,你可以使用如下脚本代替:
SELECT name, recovery_model_desc FROM master.sys.databases ORDER BY name
This is how you can change a database's recovery model to the simple recovery model:
如下是教你改变数据库的恢复模式成简单恢复模式:
ALTER DATABASE AdventureWorks SET RECOVERY SIMPLE
to the full recovery model:
改成完全恢复模式:
ALTER DATABASE AdventureWorks SET RECOVERY FULL
and to the bulk-logged recovery model:
改成大日志恢复模式:
ALTER DATABASE AdventureWorks SET RECOVERY BULK_LOGGED
Which recovery model do you need to use? It depends on how much data you can afford to lose. Let's use the following diagram to illustrate the difference between the recovery models, where a full database backup is performed at 9:00 a.m, and 11 a.m.
你要使用哪种恢复模式?那是取决于你能承担的起丢失多少数据。让我们用下面的图来解释恢复模式之前的区别,下面这张图是一个数据库在9:00am 和11:00am完成的完全备份。

The simple recovery model(简单恢复模式)
Assume that there was a hardware failure at 10:45 a.m. If the database was using the simple recovery model, you would have lost 105 minutes of work. The latest point at which you can recover the database to is 9:00 a.m, since that was the time the last full backup that was made. You could schedule differential backups to run periodically e.g.
假设硬件在 10:45am坏了。如果数据库采用的是简单恢复模式,你将丢失105分钟的数据。你最近的恢复时间点是你在9:00am做的完全备份。你可以规划差异备份定期进行。例如:

In this case, you would lose 45 minutes of work. Now, assuming that a user deleted a critical table at 9:50 a.m. Can you recover to the point in time just before the deletion? No. The differential backup contains only the changed data pages. It cannot be used to restore to a specific point in time. You'll have to restore the database to its 9 a.m state, and redo 49 minutes of work. Then, you'll also need to redo the work that was performed after the deletion up to the time the error was discovered.
在这种情况下,你将丢失45分钟的数据。现在,我们假设用户在9:50删除了主要的表。你能恢复到删除的那个时间点前数据吗?不能。差异备份只包含了数据的变化页,他不能用于去恢复特定时间点的数据。你将不得不去将数据库恢复到9:00am,然后重做49分钟的工作。此刻,你也必须去完成删除数据时间之后到发现错误之间的工作。
The full recovery model(完全恢复模式)
If no transaction log backups are made between 9 a.m and 11 a.m, you would face the same situation as you would if the database had been using the simple recovery model. In addition, your transaction log file would be much larger, as SQL Server will not truncate committed and checkpointed transactions until they have been backed up.
如果你没做事物日志备份在 9:00至11:00之前,你将面对的同样的情况就和你使用的简单恢复模式一样。另外,你的事务日志会非常大,因为SQL Server不会删除已经提交和已经CheckPoint的事务,直到它们被备份。
二:Recovery models(恢复模式)的更多相关文章
- 教你正确进入DFU及恢复模式 无敌重刷模式
苹果分为两种恢复模式,一种叫做DFU模式,另一种是恢复模式.DFU的全称是Development FirmwareUpgrade,实际意思就是iPhone固件的强制升降级模式.而恢复模式则是屏幕上会显 ...
- 故障恢复和恢复模式(Crash Recovery & Recovery Models)
数据库的恢复模型是否影响故障恢复,在简单恢复模式里,你是否会丢失事务?在今天的文章里我想谈下这点,详细讨论下. 恢复模式(Recovery Models) 对于这个问题的最简单的答案是不会:恢复模型不 ...
- Mac OS 10.12 - 在VMwear Workstation12.5.2中以两种方式进入恢复模式(Recovery)!!!
注意:如果你打算安装Mac OS10.12 到虚拟机里面学习,那么我强烈建议你在没有安装任何其它软件之前,按照我这篇博客来进入恢复模式(Recovery),禁用Rootless机制!!!这样处理后,你 ...
- 在VMwear 11中的Mac OS X 10.11+ 进入恢复模式(Recovery HD)
1,选中要启动的虚拟机,随后点击VM菜单的启动按钮后面向下箭头,随后点击菜单项”打开电源时进入固件“. 2,在虚拟机里面,用上下键移动到”Enter setup“上,随后继续下一步! 3,选中”Boo ...
- Android设备运用Clockworkmod Recovery恢复模式安装定制的Rom
Clockworkmod Recovery是一个由Cyanogen团队开发的用于Android设备的第三方定制Recovery恢复模式,也称为CWM Recovery,具体它有什么用处呢?请看关于Go ...
- 关于Google Android平台的ClockworkMod Recovery恢复模式
lockworkMod Recovery,它也被称为Clockwork与CWM,它是装载Google Android操作系统设备的一个自定义的Recovery恢复模式,它可以使得相关Android设备 ...
- 进入恢复模式(Recovery HD)
进入恢复模式(Recovery HD) 1,选中要启动的虚拟机,随后点击VM菜单的启动按钮后面向下箭头,随后点击菜单项”打开电源时进入固件“. 2,在虚拟机里面,用上下键移动到”Enter setup ...
- 转 一篇关于sql server 三种恢复模式的文章,从sql server 的机制上来写的,感觉很不错,转了
简介 SQL Server中的事务日志无疑是SQL Server中最重要的部分之一.因为SQL SERVER利用事务日志来确保持久性(Durability)和事务回滚(Rollback).从而还部分确 ...
- sql server 备份与恢复系列三 简单恢复模式下的备份与还原
一.概述 前面讲了备份的一些理论知识,这篇开始讲在简单恢复模式下的备份与还原.在简单模式下是不能做日志备份的,发生灾难后,数据库最后一次备份之后做的数据修改将是全部丢失的,所以在生产环境下,数据又很重 ...
随机推荐
- tkinter简单使用
第一个运行程序 # -*- coding: utf-8 -*- import tkinter as tk //引入 root = tk.Tk() // 实例化root T大写k小写 root.titl ...
- IE兼容性问题的总结
一.IE6/IE7对display:inline-block的支持欠缺 1.表现描述 这个应该算是很经典的ie兼容性问题了,inline-block作用就是将块级元素以行的等式显示.在主流浏览器中水平 ...
- web分页打印
添加css: page-break-before:always 实现分页 window.print()//实现打印
- win10安装tomcat9
环境:win10 64bit.tomcat 时间:2016年9月6日 15:11:47 一.下载tomcat 用浏览器打开tomcat官网:http://tomcat.apache.org/ 在左侧的 ...
- Eclipse svn 项目 星号
上图: 明明没有文件修改过就是无脑显示有提交的文件,有强迫症受不了. 而且每次提交你都点开看有没有漏掉啥文件.很麻烦.也很难受 .很容易漏提交 把本地文件跟SVN同步对比一下. 果然有文件. 添加规则 ...
- Mac技巧之苹果电脑Mac OS X系统自带的鼠标所在点颜色RGB值查看工具:数码测色计
转自http://www.mac52ipod.cn/post/show-mouse-point-rgb-color-by-apple-mac-os-x-tool.php
- python入门-直方图
使用的是pygal函数库 所以需要先安装 1 安装库文件 pip install pygal=1.7 2 创建骰子类 from random import randint class Die(): # ...
- EditText被键盘遮得住
如果在Activity中的布局的下方有EditText,获取焦点弹出软键盘的时候,如果不做处理,软键盘可能会遮挡输入框,用户提现不好,网上也有很多人提出结局方案,这里就分析一下解决的效果. 需要用到E ...
- python学习笔记_week20
note 1.Django请求的生命周期 路由系统 -> 视图函数(获取模板+数据=>渲染) -> 字符串返回给用户 2.路由系统 /index/ -> 函数或类.as_vie ...
- python学习笔记_week15
note 上节作业问题: 1.css重用 <style> 如果整个页面的宽度 > 900px时: { .c{ 共有 } .c1{ 独有 } } .c2{ 独有 } </styl ...