innobackupex备份工具

Top

NSD DBA1 DAY07

  1. innobackupex备份工具

1 innobackupex备份工具

1.1 问题

  • 安装percona软件包
  • innobackupex完整备份、增量备份操作。
  • 恢复数据

1.2 步骤

实现此案例需要按照如下步骤进行。

步骤一:安装XtraBackup软件包

1)了解软件包描述信息

  1. [root@dbsvr1 pub]# rpm -qpi percona-xtrabackup-24-2.4.6-2.el7.x86_64.rpm
  2. Name : percona-xtrabackup-24
  3. Version : 2.4.6
  4. Release : 2.el7
  5. Architecture: x86_64
  6. Install Date: (not installed)
  7. Group : Applications/Databases
  8. Size : 32416340
  9. License : GPLv2
  10. Signature : DSA/SHA1, 2017年02月27日 星期一 20时28分17秒, Key ID 1c4cbdcdcd2efd2a
  11. Source RPM : percona-xtrabackup-24-2.4.6-2.el7.src.rpm
  12. Build Date : 2017年02月27日 星期一 20时27分21秒
  13. Build Host : vps-centos7-x64-01.ci.percona.com
  14. Relocations : (not relocatable)
  15. URL : http://www.percona.com/software/percona-xtrabackup
  16. Summary : XtraBackup online backup for MySQL / InnoDB
  17. Description :
  18. Percona XtraBackup is OpenSource online (non-blockable) backup solution for InnoDB and XtraDB engines

2)安装依赖包perl-DBD-MySQL perl-Digest-MD5 libev

使用RHEL 7自带的即可,yum方式安装:

  1. [root@dbsvr1 pub]# yum -y install perl-DBD-MySQL perl-Digest-MD5
  2. libev使用网上找的rpm包 libev-4.15-1.el6.rf.x86_64.rpm //该包由讲师提供
  3. [root@dbsvr1 pub]#rpm –ivh libev-4.15-1.el6.rf.x86_64.rpm

如果未安装这些依赖包,则直接安装percona-xtrabackup时会报错:

代码

3)安装percona-xtrabackup

  1. [root@dbsvr1 pub]#rpm -ivh percona-xtrabackup-*.rpm
  2. 警告:percona-xtrabackup-24-2.4.6-2.el7.x86_64.rpm: 头V4 DSA/SHA1 Signature, 密钥 ID cd2efd2a: NOKEY
  3. 准备中... ################################# [100%]
  4. 正在升级/安装...
  5. 1:percona-xtrabackup-24-2.4.6-2.el7################################# [ 33%]
  6. 2:percona-xtrabackup-test-24-2.4.6-################################# [ 67%]
  7. 3:percona-xtrabackup-24-debuginfo-2################################# [100%]

4)确认安装的主要程序/脚本

  1. [root@dbsvr1 pub]# rpm -ql percona-xtrabackup-24-2.4.6-2.el7.x86_64
  2. /usr/bin/innobackupex
  3. /usr/bin/xbcloud
  4. /usr/bin/xbcloud_osenv
  5. /usr/bin/xbcrypt
  6. /usr/bin/xbstream
  7. /usr/bin/xtrabackup
  8. /usr/share/doc/percona-xtrabackup-24-2.4.6
  9. /usr/share/doc/percona-xtrabackup-24-2.4.6/COPYING
  10. /usr/share/man/man1/innobackupex.1.gz
  11. /usr/share/man/man1/xbcrypt.1.gz
  12. /usr/share/man/man1/xbstream.1.gz
  13. /usr/share/man/man1/xtrabackup.1.gz

步骤二:innobackupex完整备份、增量备份操作

--host 主机名

--port 3306

--user 用户名

--password 密码

--databases="库名"

--databases="库1 库2"

--databases="库.表"

--no-timestamp 不用日期命名备份文件存储的子目录,使用备份的数据库名做备份目录名

--no-timestmap 不使用日期命名备份目录名

1)做一个完整备份

默认情况下,备份文件存储的子目录会用日期命名,

innobackupex作为客户端工具,以mysql协议连入mysqld,将数据备份到/backup文件夹:

  1. [root@dbsvr1 ~]# innobackupex --user=root --password=1234567 /backup/mysql –no-timestamp
  2. 170425 11:05:44 innobackupex: Starting the backup operation
  3. IMPORTANT: Please check that the backup run completes successfully.
  4. At the end of a successful backup run innobackupex
  5. prints "completed OK!".
  6. Unrecognized character \x01; marked by <-- HERE after <-- HERE near column 1 at - line 1374.
  7. 170425 11:05:45 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: not set
  8. Using server version 5.7.17
  9. innobackupex version 2.4.6 based on MySQL server 5.7.13 Linux (x86_64) (revision id: 8ec05b7)
  10. xtrabackup: uses posix_fadvise().
  11. xtrabackup: cd to /var/lib/mysql
  12. xtrabackup: open files limit requested 0, set to 1024
  13. xtrabackup: using the following InnoDB configuration:
  14. xtrabackup: innodb_data_home_dir = .
  15. xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
  16. xtrabackup: innodb_log_group_home_dir = ./
  17. xtrabackup: innodb_log_files_in_group = 2
  18. xtrabackup: innodb_log_file_size = 50331648
  19. InnoDB: Number of pools: 1
  20. 170425 11:05:45 >> log scanned up to (2543893)
  21. xtrabackup: Generating a list of tablespaces
  22. InnoDB: Allocated tablespace ID 2 for mysql/plugin, old maximum was 0
  23. 170425 11:05:45 [01] Copying ./ibdata1 to /backup/ibdata1
  24. 170425 11:05:45 [01] ...done
  25. 170425 11:05:46 [01] Copying ./mysql/plugin.ibd to /backup/mysql/plugin.ibd
  26. 170425 11:05:46 [01] ...done
  27. 170425 11:05:46 [01] Copying ./mysql/servers.ibd to /backup/mysql/servers.ibd
  28. 170425 11:05:46 [01] ...done
  29. 170425 11:05:46 [01] Copying ./mysql/help_topic.ibd to /backup/mysql/help_topic.ibd
  30. 170425 11:05:46 [01] ...done
  31. 170425 11:05:46 >> log scanned up to (2543893)
  32. .. ..
  33. 170425 11:06:00 [01] Copying ./sys/x@0024waits_global_by_latency.frm to /backup/sys/x@0024waits_global_by_latency.frm
  34. 170425 11:06:00 [01] ...done
  35. 170425 11:06:00 [01] Copying ./sys/session_ssl_status.frm to /backup/sys/session_ssl_status.frm
  36. 170425 11:06:00 [01] ...done
  37. 170425 11:06:00 [01] Copying ./db1/db.opt to /backup/db1/db.opt
  38. 170425 11:06:00 [01] ...done
  39. 170425 11:06:00 [01] Copying ./db1/tb1.frm to /backup/db1/tb1.frm
  40. 170425 11:06:00 [01] ...done
  41. 170425 11:06:00 Finished backing up non-InnoDB tables and files
  42. 170425 11:06:00 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
  43. xtrabackup: The latest check point (for incremental): '2543884'
  44. xtrabackup: Stopping log copying thread.
  45. .170425 11:06:00 >> log scanned up to (2543893)
  46. 170425 11:06:00 Executing UNLOCK TABLES
  47. 170425 11:06:00 All tables unlocked
  48. 170425 11:06:00 [00] Copying ib_buffer_pool to /backup/ib_buffer_pool
  49. 170425 11:06:00 [00] ...done
  50. 170425 11:06:00 Backup created in directory '/backup/'
  51. 170425 11:06:00 [00] Writing backup-my.cnf
  52. 170425 11:06:00 [00] ...done
  53. 170425 11:06:00 [00] Writing xtrabackup_info
  54. 170425 11:06:00 [00] ...done
  55. xtrabackup: Transaction log of lsn (2543884) to (2543893) was copied.
  56. 170425 11:06:01 completed OK

确认备份好的文件数据:

  1. [root@dbsvr1 ~]#ls /backup/
  2. backup-my.cnf ib_buffer_pool mysql sys xtrabackup_info
  3. db1 ibdata1 performance_schema xtrabackup_checkpoints xtrabackup_logfile

2)做一个增量备份(基于前一步的完整备份)

随意做一些新增或更改库表的操作,比如在db1库中新建一个mytb的表:

  1. mysql> USE db1;
  2. Database changed
  3. mysql> CREATE TABLE mytb(id int(4), name varchar(24));
  4. Query OK, 0 rows affected (0.38 sec)
  5. mysql> INSERT INTO tb1 VALUES
  6. -> (1,'bon'),
  7. -> (2,'bo'),
  8. Query OK, 2 rows affected (0.12 sec)
  9. Records: 2 Duplicates: 0 Warnings: 0
  10. mysql> SELECT * FROM tb1;
  11. +------+------+
  12. | id | name |
  13. +------+------+
  14. | 1 | bob |
  15. | 2 | bo |
  16. +------+------+
  17. 2 rows in set (0.00 sec)

以前一次保存到/backup的完整备份为基础,做一个增量备份,保存到/incr01/,指定增量备份参照的基本目录(完整备份目录)需要用到选项--incremental-basedir。相关操作如下:

  1. [root@dbsvr1 ~]# innobackupex --user=root --password=12345678 --incremental /incr01 --incremental-basedir=/backup/ --no-timestamp
  2. 170425 11:30:14 innobackupex: Starting the backup operation
  3. IMPORTANT: Please check that the backup run completes successfully.
  4. At the end of a successful backup run innobackupex
  5. prints "completed OK!".
  6. Unrecognized character \x01; marked by <-- HERE after <-- HERE near column 1 at - line 1374.
  7. 170425 11:30:14 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: not set
  8. Using server version 5.7.17
  9. innobackupex version 2.4.6 based on MySQL server 5.7.13 Linux (x86_64) (revision id: 8ec05b7)
  10. incremental backup from 2543884 is enabled.
  11. xtrabackup: uses posix_fadvise().
  12. xtrabackup: cd to /var/lib/mysql
  13. xtrabackup: open files limit requested 0, set to 1024
  14. xtrabackup: using the following InnoDB configuration:
  15. xtrabackup: innodb_data_home_dir = .
  16. xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
  17. xtrabackup: innodb_log_group_home_dir = ./
  18. xtrabackup: innodb_log_files_in_group = 2
  19. xtrabackup: innodb_log_file_size = 50331648
  20. InnoDB: Number of pools: 1
  21. 170425 11:30:14 >> log scanned up to (2549933)
  22. xtrabackup: Generating a list of tablespaces
  23. InnoDB: Allocated tablespace ID 2 for mysql/plugin, old maximum was 0
  24. xtrabackup: using the full scan for incremental backup
  25. 170425 11:30:15 [01] Copying ./ibdata1 to /incr01/ibdata1.delta
  26. 170425 11:30:15 [01] ...done
  27. 170425 11:30:15 >> log scanned up to (2549933)
  28. 170425 11:30:15 [01] Copying ./mysql/plugin.ibd to /incr01/mysql/plugin.ibd.delta
  29. 170425 11:30:15 [01] ...done
  30. ... ...
  31. 170425 11:30:35 Executing UNLOCK TABLES
  32. 170425 11:30:35 All tables unlocked
  33. 170425 11:30:35 [00] Copying ib_buffer_pool to /incr01/ib_buffer_pool
  34. 170425 11:30:35 [00] ...done
  35. 170425 11:30:35 Backup created in directory '/incr01/'
  36. 170425 11:30:35 [00] Writing backup-my.cnf
  37. 170425 11:30:35 [00] ...done
  38. 170425 11:30:35 [00] Writing xtrabackup_info
  39. 170425 11:30:35 [00] ...done
  40. xtrabackup: Transaction log of lsn (2549924) to (2549933) was copied.
  41. 170425 11:30:35 completed OK!

确认备份好的文件数据:

  1. [root@dbsvr1 ~]# ls /incr01/
  2. backup-my.cnf ib_buffer_pool ibdata1.meta performance_schema xtrabackup_checkpoints xtrabackup_logfile
  3. db1 ibdata1.delta mysql sys

对比完整备份、增量备份的大小:

  1. [root@dbsvr1 ~]# du -sh /backup/ /incr01/
  2. 142M    /backup/ //完整备份的大小
  3. 3.5M    /incr01/ //增量备份的大小

步骤三:恢复数据

通过XtraBackup工具备份的数据库目录,若要恢复到另一个MySQL服务器,需要先做一个“--apply-log --redo-only ”的准备操作。

1)准备恢复“完整备份”

完成准备以后,最终/backup可用来重建MySQL服务器。这种情况下,需要先做一个“--apply-log --redo-only ”的准备操作,以确保数据一致性:

  1. [root@dbsvr1 ~]#innobackupex --user=root --password=12345678 --apply-log --redo-only /backup/
  2. 170425 11:42:19 innobackupex: Starting the apply-log operation
  3. IMPORTANT: Please check that the apply-log run completes successfully.
  4. At the end of a successful apply-log run innobackupex
  5. prints "completed OK!".
  6. innobackupex version 2.4.6 based on MySQL server 5.7.13 Linux (x86_64) (revision id: 8ec05b7)
  7. xtrabackup: cd to /backup/
  8. xtrabackup: This target seems to be already prepared.
  9. InnoDB: Number of pools: 1
  10. xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.
  11. xtrabackup: using the following InnoDB configuration for recovery:
  12. xtrabackup: innodb_data_home_dir = .
  13. xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
  14. xtrabackup: innodb_log_group_home_dir = .
  15. xtrabackup: innodb_log_files_in_group = 2
  16. xtrabackup: innodb_log_file_size = 50331648
  17. xtrabackup: using the following InnoDB configuration for recovery:
  18. xtrabackup: innodb_data_home_dir = .
  19. xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
  20. xtrabackup: innodb_log_group_home_dir = .
  21. xtrabackup: innodb_log_files_in_group = 2
  22. xtrabackup: innodb_log_file_size = 50331648
  23. xtrabackup: Starting InnoDB instance for recovery.
  24. xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
  25. InnoDB: PUNCH HOLE support available
  26. InnoDB: Mutexes and rw_locks use GCC atomic builtins
  27. InnoDB: Uses event mutexes
  28. InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
  29. InnoDB: Compressed tables use zlib 1.2.7
  30. InnoDB: Number of pools: 1
  31. InnoDB: Not using CPU crc32 instructions
  32. InnoDB: Initializing buffer pool, total size = 100M, instances = 1, chunk size = 100M
  33. InnoDB: Completed initialization of buffer pool
  34. InnoDB: page_cleaner coordinator priority: -20
  35. InnoDB: Highest supported file format is Barracuda.
  36. xtrabackup: starting shutdown with innodb_fast_shutdown = 1
  37. InnoDB: Starting shutdown...
  38. InnoDB: Shutdown completed; log sequence number 2544177
  39. InnoDB: Number of pools: 1
  40. 170425 11:42:20 completed OK!

准备恢复“增量备份”

  1. [root@dbsvr1 ~]#innobackupex --user=root --password=12345678 --apply-log --redo-only /backup/ --incremental-dir=/incr01
  2. 170425 11:42:55 innobackupex: Starting the apply-log operation
  3. IMPORTANT: Please check that the apply-log run completes successfully.
  4. At the end of a successful apply-log run innobackupex
  5. prints "completed OK!".
  6. innobackupex version 2.4.6 based on MySQL server 5.7.13 Linux (x86_64) (revision id: 8ec05b7)
  7. incremental backup from 2543884 is enabled.
  8. xtrabackup: cd to /backup/
  9. xtrabackup: This target seems to be already prepared with --apply-log-only.
  10. InnoDB: Number of pools: 1
  11. xtrabackup: xtrabackup_logfile detected: size=8388608, start_lsn=(2549924)
  12. xtrabackup: using the following InnoDB configuration for recovery:
  13. xtrabackup: innodb_data_home_dir = .
  14. xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
  15. xtrabackup: innodb_log_group_home_dir = /incr01/
  16. xtrabackup: innodb_log_files_in_group = 1
  17. xtrabackup: innodb_log_file_size = 8388608
  18. xtrabackup: Generating a list of tablespaces
  19. InnoDB: Allocated tablespace ID 2 for mysql/plugin, old maximum was 0
  20. xtrabackup: page size for /incr01//ibdata1.delta is 16384 bytes
  21. Applying /incr01//ibdata1.delta to ./ibdata1...
  22. ... ...
  23. 170425 11:43:09 [01] Copying /incr01/performance_schema/global_status.frm to ./performance_schema/global_status.frm
  24. 170425 11:43:09 [01] ...done
  25. 170425 11:43:09 [01] Copying /incr01/performance_schema/session_status.frm to ./performance_schema/session_status.frm
  26. 170425 11:43:09 [01] ...done
  27. 170425 11:43:09 [00] Copying /incr01//xtrabackup_info to ./xtrabackup_info
  28. 170425 11:43:09 [00] ...done
  29. 170425 11:43:10 completed OK!

2)关闭mysql服务,并将/var/lib/mysql/下的文件删除,假设数据被删除。

  1. [root@dbsvr1 ~]#systemctl stop mysqld
  2. [root@dbsvr1 ~]#rm -rf /var/lib/mysql

3)恢复“完整备份+增量备份”

完成准备以后,最终仍然是/backup用来重建MySQL服务器,但这种情况下需提前合并相关增量备份的数据

  1. [root@dbsvr1 ~]# innobackupex --user=root --password=12345678 --copy-back /backup/
  2. ... ...
  3. 170425 11:51:39 [01] Copying ./performance_schema/global_status.frm to /var/lib/mysql/performance_schema/glo.frm
  4. 170425 11:51:39 [01] ...done
  5. 170425 11:51:39 [01] Copying ./performance_schema/session_status.frm to /var/lib/mysql/performance_schema/seus.frm
  6. 170425 11:51:39 [01] ...done
  7. 170425 11:51:39 [01] Copying ./ib_buffer_pool to /var/lib/mysql/ib_buffer_pool
  8. 170425 11:51:39 [01] ...done
  9. 170425 11:51:39 [01] Copying ./ibtmp1 to /var/lib/mysql/ibtmp1
  10. 170425 11:51:39 [01] ...done
  11. 170425 11:51:39 [01] Copying ./xtrabackup_info to /var/lib/mysql/xtrabackup_info
  12. 170425 11:51:39 [01] ...done
  13. 170425 11:51:39 completed OK!

4)修改/var/lib/mysql/下文件属主与属组,查看数据:

恢复后,/var/lib/mysql下文件属组与属主皆为root,需要更改为mysql

  1. [root@dbsvr1 ~]#chown -R mysql:mysql /var/lib/mysql
  2. [root@dbsvr1 ~]#systemctl start mysqld.service
  3. [root@dbsvr1 ~]#mysql -uroot -p12345678 -e "select * from db1.tb1"
  4. mysql: [Warning] Using a password on the command line interface can be insecure.
  5. +------+------+
  6. | id | name |
  7. +------+------+
  8. | 1 | bob |
  9. | 2 | bo |
  10. +------+------+

转载于:https://www.cnblogs.com/tiki/p/10783402.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/462744.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

计算机网络读书笔记(1)

传输控制协议TCP最主要特点&#xff1a; 1、 面向连接的传输层协议&#xff0c;类似于打电话 2、 点对点&#xff08;一对一&#xff09;&#xff0c;每一条TCP只能有两个端点 3、 提供可靠交付的服务 4、 全双工通信 5、 面向字节流&#xff08;所谓流&#xff1a;流入到…

网卡驱动收发包过程图解

网卡 网卡工作在物理层和数据链路层&#xff0c;主要由PHY/MAC芯片、Tx/Rx FIFO、DMA等组成&#xff0c;其中网线通过变压器接PHY芯片、PHY芯片通过MII接MAC芯片、MAC芯片接PCI总线 PHY芯片主要负责&#xff1a;CSMA/CD、模数转换、编解码、串并转换 MAC芯片主要负责&#x…

Cisco路由器全局、接口、协议调试指南

全局调试 在配置Cisco路由器时&#xff0c;全局和接口命令的界限是十分明显的。在这种情况下&#xff0c;我们使用“全局”来标识那些不能用于接口调试或者特定的传输介质类型 和协议调试的命令。例如&#xff0c;在2500系列路由器中&#xff0c;就可以使用调试命令分析Cisco发…

发送带颜色的MSG

作者&#xff1a;深渊野鱼 来源&#xff1a;博客园 发布时间&#xff1a;2008-01-09 15:04 阅读&#xff1a;245 次 原文链接 [收藏] 用户经常发送MESSAGE,MESSAGE的颜色往往是绿色的&#xff0c;其实是可以发送彩色的MESSAGE的。解答 1.创建SNDCOLMSG CLP程序。SNDCOL…

在c++中,如果派生类没有重写基类中对应virtual函数会怎样?

在c中&#xff0c;如果一个派生类没有重写基类中对应的虚函数&#xff0c;那么在派生类的构造函数中依然会创建虚指针&#xff0c;但是该虚指针指向的是基类的虚表。 #include <iostream> #include <string>class Base { public:virtual void foo() {std::cout &l…

哪些类继承了Collection接口

Collection集合的基本结构&#xff1a; 1、Collection接口 Collection是最基本集合接口&#xff0c;它定义了一组允许重复的对象。Collection接口派生了两个子接口Set和List&#xff0c;分别定义了两种不同的存储方式&#xff0c;如下&#xff1a; 2、 Set接口 Set接口继承于Co…

陶哲轩实分析 定理 13.1.5

设 $(X,d_X)$ 是度量空间,并设 $(Y,d_Y)$ 是另一个度量空间.设 $f:X\to Y$是函数,那么 $f$ 是连续的可以推出 (c)只要 $V$ 是 $Y$ 中的开集,集合 $f^{-1}(V):\{x\in X:f(x)\in V\}$ 就 是 $X$ 中的开集.\begin{proof} 为了证明 $f^{-1}(V)$ 是开集,我们只用证明对于 $f^{-1}(V)…

安装Orchard错误

直接使用Visual Studio2010运行没有任何问题&#xff0c;但是配置到IIS就报如下的错误&#xff1a; 错误摘要 HTTP 错误 500.19 - Internal Server Error 无法访问请求的页面&#xff0c;因为该页的相关配置数据无效。 模块 IIS Web Core 通知 BeginRequest 处理程序 尚未确定 …

在c++中一个空类占用的字节数

结论&#xff1a; 在c中一个空类占用&#xff1a;1Byte。 有的同学认为一个空类占0Byte&#xff0c;那么定义一个空类时&#xff0c;他存放到哪里呢&#xff1f;为此&#xff0c;在c编译器中&#xff0c;为空类设置了占用1Byte内存。 #include <iostream> // std::c…

SpringBoot整合Mybatis-plus实现增删查改

今天给大家分享一下SpringBoot整合Mybatis-plus的增删查改案例。 pom.xml <?xml version"1.0" encoding"UTF-8"?> <project xmlns"http://maven.apache.org/POM/4.0.0" xmlns:xsi"http://www.w3.org/2001/XMLSchema-instance&qu…

Web Service security UserNameToken 使用

一: Web Service security UserNameToken 概念 原理&#xff1a;用户在发送请求的时候&#xff0c;在Soap head中加入自己的用户名以及密码&#xff0c;接受请求的Service通过之前与Client建立的共享密码来验证密码的合法性从而实现鉴别用户的功能。 <wsse:UsernameToken>…

使用Mule ESB与Groovy编排RESTful服务【转】很适合我们当前的架构

http://www.infoq.com/cn/articles/restful-services-mule 在过去几年中&#xff0c;REST风格的软件架构获得了越来越多的认可&#xff0c;这主要是因为它减少了系统对动件的需求、同时使系统耦合性更低&#xff0c;弹性更好。 目前越来越多的REST资源出现在企业应用中&#xf…

《领域驱动设计》第二部分:模型驱动设计的构造块 第四章:分离领域 阅读笔记...

内容概述 将领域对象与系统中的其他功能分离 第一小节 介绍了分离领域的技术&#xff1a;Layered Architecture。 第二小节 指出大部分软件系统都会采用分层的架构&#xff0c;但是分层方案有很多种。领域驱动设计只要求领域层存在即可&#xff0c;并且领域模型在领域层中表现不…

Starling框架帮助手册中文版(PDF下载)

什么是Statling&#xff1f;Starling 是一个基于Stage3D&#xff08;这是Flash Player11及Adobe AIR 3中新增的为3D加速功能所提供的API&#xff09;所开发的一个能够使用GPU来加速的2D Flash应用程序的ActionScript3框架。Starling主要是为游戏开发而设计的, 但是它的用途不仅…

在X32与X64下,每种数据类型占用的字节数

在X32与X64下&#xff0c;每种数据类型占用的字节数分别如下&#xff1a; X32 X64 指针 4Byte 8Byte char 1Byte …

一个Setup Factory的Lua脚本

需求是把安装路径中的反斜杠转义成斜杠并写入到配置文件特定的地方去。 读取配置文件 由于配置文件不大 一次性的读入到内存中 local f io.input(SessionVar.Expand("%AppFolder%\\Common\\conf.xml"), "r");local r f:read("*all");io.close()…

20190501-编写一个函数来查找字符串数组中的最长公共前缀。如果不存在公共前缀,返回空字符串...

题目描述 编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀&#xff0c;返回空字符串 ""。 示例 1: 输入: ["flower","flow","flight"] 输出: "fl" 示例 2: 输入: ["dog","racecar"…

MySQL幻读及解决方法

这是一篇数据库隔离级别的科普文章&#xff0c;旨在了解数据库中著名的幻读现象&#xff0c;为了专注&#xff0c;对脏读、不可重复读不作讨论。 事务隔离级别 MySQL有四级事务隔离级别: 读未提交 READ-UNCOMMITTED&#xff1a; 存在脏读&#xff0c;不可重复读&#xff0c;幻…

SVN trunk branches tags 的用法 - 摘自网络

Subversion有一个很标准的目录结构&#xff0c;是这样的。比如项目是proj&#xff0c;svn地址为svn://proj/&#xff0c;那么标准的svn布局是svn://proj/|-trunk-branches-tags这是一个标准的布局&#xff0c;trunk为主开发目录&#xff0c;branches为分支开发目录&#xff0c;…

数据结构学习方法

在网上搜集到的数据结构学习方法&#xff0c;请同学们参考。 谈数据结构学习方法&#xff08;转帖&#xff09;我在这里只是谈谈自己的学习体会现在咱们学的的数据结构是C版本的 所以C的一些基础知识应该先看会 尤其是指针那一部分 很多人对指针只是一知半解 由于一直对指针概念…