database DB2:如何备份 DB2 数据库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/12738765/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
DB2: How to backup a DB2 database?
提问by intertex
DB2 v10.1 database on WINDOWS 7.
WINDOWS 7 上的 DB2 v10.1 数据库。
Can somebody share about creating a database backup of the DB2? I could not find detailed instructions.
有人可以分享有关创建 DB2 数据库备份的信息吗?我找不到详细说明。
Thanks in advance for any help in this matter
在此先感谢您对此事的任何帮助
回答by Ian Bjorhovde
Have you tried looking at the documentation? Perhaps the "Data Recovery Reference"?
您是否尝试查看文档?也许是“数据恢复参考”?
http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/topic/com.ibm.db2.luw.admin.ha.doc/doc/c0006150.html
http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/topic/com.ibm.db2.luw.admin.ha.doc/doc/c0006150.html
回答by Steven Lowenthal
In a db2cmd window type \DB2 HELP BACKUP\ for more complete command syntax. The simplest form of the command is
在 db2cmd 窗口中输入 \DB2 HELP BACKUP\ 以获得更完整的命令语法。命令的最简单形式是
DB2 BACKUP DATABASE <database name>
Optim Studio in 9.7 and 10.1 and Control Center in 9.7 have GUI's to assist with these tasks as well.
9.7 和 10.1 中的 Optim Studio 以及 9.7 中的控制中心也有 GUI 来协助完成这些任务。
回答by Reigo
For a local backup you can use a simple command line command also provided in the other answers:
对于本地备份,您可以使用其他答案中也提供的简单命令行命令:
db2 backup database <name>
If you want a more automated solution that's more for "enterprise" then you should look into IBM Tivoli Storage Manager for example. DB2 supports making backups to network storaged TSM on the fly with incremental backups without disrupting the local database from working. I.e. you can run queries while the backup is running.
如果您想要一个更适合“企业”的更自动化的解决方案,那么您应该查看 IBM Tivoli Storage Manager 例如。DB2 支持使用增量备份动态备份到网络存储 TSM,而不会中断本地数据库的工作。即您可以在备份运行时运行查询。
For TSM you need log archiving enabled on the database, you can do that with command should be:
对于 TSM,您需要在数据库上启用日志归档,您可以使用以下命令执行此操作:
db2 update db cfg using LOGARCHMETH1 TSM
After you have enabled log archiving you can create a backup script and schedule it:
启用日志归档后,您可以创建备份脚本并安排它:
set DB2INSTANCE=DB2
"C:\IBM\ProductName\db2\BIN\db2cmd.exe" /c DB2.EXE backup db WPSDB user <DOMAINUSERNAME> using <DOMAINUSERPASSWORD> online use tsm include logs
Here's a link to a full tutorial: http://www.codeyouneed.com/db2-backup-using-tsm/
这是完整教程的链接:http: //www.codeyouneed.com/db2-backup-using-tsm/
回答by saurabh sharma
For detailed step by step guide to configure DB2 backup, you can refer:
有关配置 DB2 备份的详细分步指南,您可以参考:
DB2 v9.7 on AIX(x64) backup configuration for TSM v7.1
TSM v7.1 的 AIX(x64) 备份配置上的 DB2 v9.7
Every step form planning, preparation and execution is explained with diagrams.
计划、准备和执行的每一步都用图表解释。
Basic steps are:
基本步骤是:
- Download Appropriate TSM API 32/64 bit based on db2level from passport advantage
- Extract TSMCLI_AIX.tar
- Login as root and enter "SMITTY INSTALL"
- Select required components: - tivoli.tsm.client.ba.64bit, tivoli.tsm.client.api.64bitetc. 
- 从护照优势下载基于 db2level 的适当 TSM API 32/64 位
- 解压 TSMCLI_AIX.tar
- 以 root 身份登录并输入“SMITTY INSTALL”
- 选择所需的组件: - tivoli.tsm.client.ba.64bit、 tivoli.tsm.client.api.64bit等。 
If not using TSM client GUI then no need to install
如果不使用 TSM 客户端 GUI 则无需安装
Tivoli.tsm.client.jbb.64bit
Tivoli.tsm.filepath
- Now apply steps mention in the link as example to configure for File level and DB2 level backup as per your environment.
- 现在应用链接中提到的步骤作为示例,根据您的环境配置文件级和 DB2 级备份。

