undo

MySQL --12 备份的分类

人盡茶涼 提交于 2019-12-04 19:09:19
目录 物理备份(Xtrabackup) 1.全量备份 2.增量备份及恢复 3.差异备份及恢复 4.实战:企业级增量恢复实战 物理备份(Xtrabackup) Xtrabackup安装 #下载epel源 wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-6.repo #安装依赖 yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL #下载Xtrabackup wget httpss://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.4/binary/redhat/6/x86_64/percona-xtrabackup-24-2.4.4-1.el6.x86_64.rpm 备份方式(物理备份) 1)对于非innodb表(比如myisam)是直接锁表cp数据文件,属于一种温备。 2)对于innodb的表(支持事务),不锁表,cp数据页最终以数据文件方式保存下来,并且把redo和undo一并备走,属于热备方式。 3)备份时读取配置文件/etc/my.cnf 1.全量备份 #全备 [root@db01 data]#

【转】Mysql中事务ACID实现原理

时光怂恿深爱的人放手 提交于 2019-12-04 18:58:32
转自: https://www.cnblogs.com/rjzheng/p/10841031.html 作者:孤独烟 引言 照例,我们先来一个场景~ 面试官:"知道事务的四大特性么?" 你:"懂,ACID嘛,原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)、持久性(Durability)!" 面试官:"你们是用mysql数据库吧,能简单说说innodb中怎么实现这四大特性的么?“ 你:"我只知道隔离性是怎么做的balabala~~" 面试官:"还是回去等通知吧~" OK,回到正题。说到事务的四大特性原子性( Atomicity )、一致性( Consistency )、隔离性( Isolation )、持久性( Durability ),懂的人很多。但是稍微涉及细节一点,这四大特性在数据库中的实现原理是怎么样的?那就没有几个人能够答得上来了。因此,我们这篇文章着重讨论一下四大特性在Mysql中的实现原理。 正文 我们以从A账户转账50元到B账户为例进行说明一下ACID,四大特性。 原子性 根据定义,原子性是指一个事务是一个不可分割的工作单位,其中的操作要么都做,要么都不做。即要么转账成功,要么转账失败,是不存在中间的状态! 如果无法保证原子性会怎么样? OK,就会出现 数据不一致 的情形,A账户减去50元,而B账户增加50元操作失败

WPF TextBox Intercepting RoutedUICommands

柔情痞子 提交于 2019-12-04 18:05:24
问题 I am trying to get Undo/Redo keyboard shortcuts working in my WPF application (I have my own custom functionality implemented using the Command Pattern). It seems, however, that the TextBox control is intercepting my "Undo" RoutedUICommand. What is the simplest way to disable this so that I can catch Ctrl+Z at the root of my UI tree? I would like to avoid putting a ton of code/XAML into each TextBox in my application if possible. The following briefly demonstrates the problem: <Window x:Class

How do I implement a simple undo/redo for actions in java?

家住魔仙堡 提交于 2019-12-04 17:31:45
问题 I've created an XML editor and I'm stuck at the last phase: adding undo/redo functionality. I've only got to add undo/redo for when users add elements, attributes, or text to the JTree. I'm still quite new at this but in school today I attempted (unsuccessfully) to create two stack object []'s called undo and redo and to add the actions performed into them. FOr instance, I have: Action AddElement() { // some code public void actionPerformed(ActionEvent e) { performElementAction(); } } the

mysql备份

泄露秘密 提交于 2019-12-04 13:29:25
一.备份的原因 运维工作的核心简单概括就两件事: 1)第一个是保护公司的数据. 2)第二个是让网站能7*24小时提供服务(用户体验)。 1)备份就是为了恢复。 2)尽量减少数据的丢失(公司的损失) 二.备份的类型 冷备份: 这些备份在用户不能访问数据时进行,因此无法读取或修改数据。这些脱机备份会阻止执行任何使用数据的活动。这些类型的备份不会干扰正常运行的系统的性能。但是,对于某些应用程序,会无法接受必须在一段较长的时间里锁定或完全阻止用户访问数据。 停库,停服务,备份 温备份: (锁表) 这些备份在读取数据时进行,但在多数情况下,在进行备份时不能修改数据本身。这种中途备份类型的优点是不必完全锁定最终用户。但是,其不足之处在于无法在进行备份时修改数据集,这可能使这种类型的备份不适用于某些应用程序。在备份过程中无法修改数据可能产生性能问题。 热备份: 这些动态备份在读取或修改数据的过程中进行,很少中断或者不中断传输或处理数据的功能。使用热备份时,系统仍可供读取和修改数据的操作访问。 三.备份的方式 逻辑备份: 基于SQL语句的备份 1)binlog 2)into outfile mysql> select * from world.city into outfile '/tmp/world_city.data'; #配置文件中创建/tmp 3)mysqldump只支持全备 4

Undo and redo in Canvas for Android

你说的曾经没有我的故事 提交于 2019-12-04 12:22:51
问题 I am using a customized version of FingerPaint for Android with some other features, like inserting images and moving them. I decided to implement an Undo&Redo, since it will make life just easier. In order to implement it, I finally decided to use a Stack where I push the Drawing Cache of the view, and from where I push the content every time I want to go back to a previous state. So, using the FingerPaint as a basis, I have the following: private void touch_up() { mPath.lineTo(mX, mY); //

Disable Chrome's text input undo/redo (CTRL+Z / CTRL+Y)

吃可爱长大的小学妹 提交于 2019-12-04 08:59:16
i'm currently developing a web application and i encounter a problem. As you might know or not, chrome has a feature that gives <input> (especially text inputs) an "undo" function when you hit CTRL+Z and "redo" with CTRL+Y it may seem like a good feature in normal websites, but currently i'm making an image editor that also uses those keyboard shortcuts (CTRL+Z & CTRL+Y). in my app i also have a text input, so when i change the text input's content and then hit CTRL+Z to undo the changes in my image editor, it would undo the change in the text editor instead! here is a Codepen that would

How do I do redo (i.e. “undo undo”) in Vim?

谁说胖子不能爱 提交于 2019-12-04 07:17:54
问题 In Vim, I did too much undo. How do I undo this (that is, redo)? 回答1: Ctrl + r 回答2: Also check out :undolist , which offers multiple paths through the undo history. This is useful if you accidentally type something after undoing too much. 回答3: Strange nobody mentioned :earlier / :later . To redo everything you just need to do later 9999999d (assuming that you first edited the file at most 9999999 days ago), or, if you remember the difference between current undo state and needed one, use Nh ,

MySQL事务隔离级别

二次信任 提交于 2019-12-04 07:08:50
  事务有 ACID 四个基本属性:原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)和持久性(Durability)   数据库事务(简称:事务)是数据库管理系统执行过程中的一个逻辑单位,由一个有限的数据库操作序列构成。—— 维基百科 事务的概念看上去不难,但是需要注意以下几个点: 1、首先,事务就是要保证一组数据库操作,要么全部成功,要么全部失败; 2、在 MySQL 中,事务支持是在 引擎层 实现的; 3、并不是所有引擎都支持事务,如 MyISAM 就不支持,InnoDB 就支持; 今天,我们的主角是 隔离性 ,隔离性是指当多个用户并发操作数据库时,数据库为每一个用户开启不同的事务,这些事务之间相互不干扰,相互隔离。 脏读   脏读(dirty read),简单来说,就是一个事务在处理过程中读取了另外一个事务未提交的数据。这种未提交的数据我们称之为脏数据。依据脏数据所做的操作肯能是不正确的。 不可重复读   不可重复读(non-repeatable read), 是指一个事务范围内,多次查询某个数据,却得到不同的结果 。 在第一个事务中的两次读取数据之间,由于第二个事务的修改, 第一个事务两次读到的数据可能就是不一样的。   脏读和不可重复读的区别: 脏读 是某一事务 读取了 另外一个事务 未提交 的数据, 不可重复读

Hide certain actions from Swing's undo manager

邮差的信 提交于 2019-12-04 06:58:40
I am trying to write a JTextPane which supports some sort of coloring: as the user is typing the text, I am running some code that colors the text according to a certain algorithm. This works well. The problem is that the coloring operations is registered with the undo manager (a DefaultDocumentEvent with EventType.CHANGE). So when the user clicks undo the coloring disappears. Only at the second undo request the text itself is rolled back. (Note that the coloring algorithm is somewhat slow so I cannot color the text as it is being inserted). If I try to prevent the CHANGE events from reaching