简体   繁体   English

DB2在线数据库备份

[英]DB2 Online Database Backup

I have currently 200+ GB database that is using the DB2 built in backup to do a daily backup (and hopefully not restore - lol) But since that backup now takes more than 2.5 hours to complete I am looking into a Third party Backup and Restore utility. 我目前有200多GB的数据库正在使用DB2内置的备份进行日常备份(并且希望不能恢复 - 大声笑)但是由于该备份现在需要超过2.5小时才能完成,我正在研究第三方备份和还原效用。 The version is 8.2 FP 14 But I will be moving soon to 9.1 and I also have some 9.5 databases to backup and restore. 版本是8.2 FP 14但是我将很快转到9.1并且我还有一些9.5个数据库来备份和恢复。 What are the best tools that you have used for this purpose? 您为此目的使用了哪些最佳工具?

Thanks! 谢谢!

One thing that will help is going to DB2 version 9 and turn on compression. 有一点将有助于进入DB2版本9并打开压缩。 The size of the backup will then decrease (by up to 70-80% on table level) which should shorten the backup time. 然后,备份的大小将减少(表级别上最多70-80%),这应缩短备份时间。 Of course, if your database is continuosly growing you'll soon run into problems again, but then data archiving might be the thing for you. 当然,如果您的数据库持续增长,您很快就会遇到问题,但数据存档可能适合您。

Before looking at third party tools, which I doubt would help too much, I would consider a few optimizations. 在看第三方工具之前,我怀疑它会有多大帮助,我会考虑一些优化。

1) Have you used REORG on your tables and indexes? 1)您是否在表和索引上使用了REORG? This would compact the information and minimize the amount of pages used; 这样可以压缩信息并最大限度地减少使用的页面数量;

2) If you can, backup on multiple disks at the same time. 2)如果可以,请同时备份多个磁盘。 This can easily be achieved by running db2 backup db mydb /mnt/disk1 /mnt/disk2 /mnt/disk3 ... 这可以通过运行db2 backup db mydb /mnt/disk1 /mnt/disk2 /mnt/disk3 ...轻松实现db2 backup db mydb /mnt/disk1 /mnt/disk2 /mnt/disk3 ...

3) DB2 should do a good job at fine tuning itself, but you can always experiment with the WITH num_buffers BUFFERS , BUFFER buffer-size and PARALLELISM n options. 3)DB2应该在微调本身方面做得很好,但是你总是可以尝试使用WITH num_buffers BUFFERSBUFFER buffer-sizePARALLELISM n选项。 But again, usually DB2 does a better job on its own; 但同样,DB2通常会自己做得更好;

4) Consider performing daily incremental backups, and a full backup once on Saturdays or Sundays; 4)考虑在星期六或星期日执行每日增量备份和一次完整备份;

5) UTIL_IMPACT_PRIORITY and UTIL_IMPACT_LIM let you throttle the backup process so that it doesn't affect your regular workload too much. 5) UTIL_IMPACT_PRIORITYUTIL_IMPACT_LIM可以限制备份过程,使其不会过多地影响您的常规工作负载。 This is useful if your main concern is not the time per se, but rather the performance of your datasever while you backup; 如果主要关注的不是时间本身,而是备份时数据集的性能,那么这非常有用;

6) DB2 9's data compression can truly do wonders when it comes to reducing the dimensions of the data that needs to be backed up. 6)在减少需要备份的数据维度时,DB2 9的数据压缩确实可以创造奇迹。 I have seen very impressive results and would highly recommend it if you can migrate to version 9.1 or, even better, 9.5. 我已经看到了非常令人印象深刻的结果,如果您可以迁移到9.1版本,甚至更好,9.5,我会强烈推荐它。

There really are only two ways to make backup, and more important recovery, run faster: 1. backup less data and/or 2. have a bigger pipe to the backup media 实际上只有两种方法可以进行备份,更重要的是恢复,运行速度更快:1。备份更少的数据和/或2.拥有更大的管道到备份媒体

I think you got a lot of suggestions on how to reduce the amount of data that you back up. 我认为你有很多关于如何减少备份数据的建议。 Basically, you should be creating a backup strategy that relies on relatively infrequent full backup and much more frequent backups of changed (since last full backup) data. 基本上,您应该创建一个备份策略,该策略依赖于相对不频繁的完全备份以及更改(自上次完全备份以来)数据的更频繁备份。 I encourage you to take a look at the "Configure Automatic Maintenance" wizard in the DB2 Control Center. 我建议您查看DB2 Control Center中的“配置自动维护”向导。 It will help you with creating automatic backups and with other utilities like REORG that Antonio suggested. 它将帮助您创建自动备份以及安东尼奥建议的REORG等其他实用程序。 Things like compression obviously can help as the amount of data is much lower. 像压缩这样的东西显然可以提供帮助,因为数据量要低得多。 However, not all DB2 editions offer compression. 但是,并非所有DB2版本都提供压缩。 For example, DB2 Express-C does not. 例如, DB2 Express-C没有。 Frankly, doing compression on a 200GB database may not be worth while anyway and that is precisely why free DBMS like DB2 Express-C don't offer compression. 坦率地说,无论如何,在200GB数据库上进行压缩可能是不值得的,这正是为什么像DB2 Express-C这样的免费DBMS不提供压缩的原因。

As far as openign a bigger pipe for your backup you first have to decide if you are going to backup to disk or to tape. 至于openign更大的备份管道,您首先要确定是要备份到磁盘还是磁带。 There is a big difference in speed (obviously disk is a lot faster). 速度有很大差异(显然磁盘速度快得多)。 Second, DB2 can paralelize backups. 其次,DB2可以对备份进行并行化。 So, if you have multiple devices to back to, it will backup to all of them at the same time ie your elapsed time will be a lot less depending how many devices you have to throw at the problem. 因此,如果您有多个设备可以返回,它将同时备份到所有设备,即您的经过时间将会少得多,具体取决于您需要为问题投入多少设备。 Again, DB2 Control Center can help you have it set up. 同样,DB2 Control Center可以帮助您进行设置。

尝试高性能卸载(HPU) - 这是Infotel的独立产品,现在作为Optim数据工作室的一部分提供 - 在这里发布https://www.ibm.com/developerworks/mydeveloperworks/blogs/idm/date/200910?郎= EN

It's not a "third-party" product but anyone that I have ever seen using DB2 is using Tivoli Storage Manager to store their database backups. 它不是“第三方”产品,但我见过使用DB2的任何人都在使用Tivoli Storage Manager来存储他们的数据库备份。

Most shops will set up archive logging to TSM so you only have to take the "big" backup every week or so. 大多数商店都会将存档日志记录设置为TSM,因此您每周只需要进行“大”备份。

Since it's also an IBM product you won't have to worry about it working with all the different flavors of DB2 that you have. 由于它也是一个IBM产品,因此您不必担心它与您拥有的所有不同版本的DB2一起工作。

The downside is it's an IBM product. 缺点是它是IBM的产品。 :) Not sure if that ($) makes a difference to you. :)不确定($)是否会对您产生影响。

I doubt that you can speed things up using another backup tool. 我怀疑你可以使用其他备份工具加快速度。 As Mike mentions, you can add TSM to the stack, but that will hardly make the backup run any faster. 正如Mike提到的,您可以将TSM添加到堆栈中,但这几乎不会使备份运行得更快。

If I were you, I'd look into where backup files are stored: Are they using the same disk spindles as the database itself? 如果我是你,我会查看备份文件的存储位置:它们是否使用与数据库本身相同的磁盘轴? If so: See if you can store the backup files on a storage area which isn't contented for access during your backup window. 如果是这样:查看是否可以将备份文件存储在备份窗口期间无法访问的存储区域中。

And consider using incremental backups for daily backups, and then a long full backup on Saturdays. 并考虑使用增量备份进行日常备份,然后在星期六进行长时间的完整备份。

(I assume that you are already running online backups, so that your data aren't unavailable during backup.) (我假设您已经在运行在线备份,因此在备份期间您的数据不可用。)

A third party backup package probably won't help your speed much. 第三方备份包可能无法帮助您提高速度。 Making sure that you are not doing full backups every 2 hours is probably the first step. 确保您没有每2小时进行一次完整备份可能是第一步。

After that, look at where you are writing your backup to. 之后,查看您编写备份的位置。 Is it a local drive, instead of a network drive? 它是本地驱动器,而不是网络驱动器? Are the spindles used for anything else? 主轴是否用于其他任何事情? Backups don't involve a lot of seek activity, but do involve a lot of big writes, so you probably want to avoid RAID 5 and go for large stripe sizes to help maximize throughput. 备份不涉及大量的搜索活动,但确实涉及大量的大写操作,因此您可能希望避免使用RAID 5并选择较大的条带大小来帮助最大化吞吐量。

Naturally, you have to do full backups sooner or later, but hopefully you can find a window when load is light and you can live with a longer time period between backups. 当然,您必须迟早进行完整备份,但希望您可以在负载较轻时找到一个窗口,并且您可以在备份之间使用更长的时间。 Do your full backup during a 4-6 hour period when the normal incrementals are off and then do incrementals based off of that the rest of the time. 在正常增量关闭的4-6小时内完成备份,然后根据其余时间进行增量备份。

Also, until you get your backup copied to a completely separate system you really aren't backed up. 此外,在将备份复制到完全独立的系统之前,您确实无法备份。 You'll have to experiment to figure out if you're better off compressing it before, during or after sending. 您必须尝试弄清楚在发送之前,期间或之后是否最好压缩它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM