DB2数据库的备份测试 --实例讲解

1、做一个在线全备操作:


[db2inst1@db2 ~]$ db2 backup db sample online to /tmp/db2inst1/sample/off_back include logs
Backup successful. The timestamp for this backup image is : 20090917061921


2、创建一个表,并插入数据:


db2 => connect to sample

Database Connection Information

Database server
= DB2/LINUX 9.1.3
SQL authorization ID
= DB2INST1

Local database alias
= SAMPLE
db2 => insert into sales1 select * from sales
DB20000I
The SQL command completed successfully.
db2 => insert into sales1 select * from sales1
DB20000I
The SQL command completed successfully.
db2 => insert into sales1 select * from sales1
DB20000I
The SQL command completed successfully

db2 => select * from sales1
SALES_DATE SALES_PERSON
REGION
SALES

---------- --------------- --------------- -----------
12/31/2005 LUCCHESSI
Ontario-South
1
12/31/2005 LEE
Ontario-South

3
12/31/2005 LEE
Quebec
1
12/31/2005 LEE
Manitoba
2
12/31/2005 GOUNOT
Quebec
1
03/29/2006 LUCCHESSI
Ontario-South
3
03/29/2006 LUCCHESSI
Quebec

。。。。。。。。。。。

 

3、做增量备份:


[db2inst1@db2 ~]$ db2 backup db sample online incremental to /tmp/db2inst1/sample/off_back include logs
Backup successful. The timestamp for this backup image is : 20090917062532


4、删除表操作:


[db2inst1@db2 off_back]$ db2stop force
09/17/2009 06:26:47
0
0
SQL1064N
DB2STOP processing was successful.
SQL1064N
DB2STOP processing was successful.
[db2inst1@db2 off_back]$ db2start
09/17/2009 06:26:57
0
0
SQL1063N
DB2START processing was successful.
SQL1063N
DB2START processing was successful.

db2 => connect to sample

Database Connection Information

Database server
= DB2/LINUX 9.1.3

SQL authorization ID
= DB2INST1

Local database alias
= SAMPLE
db2 => drop table sales1
DB20000I
The SQL command completed successfully.
db2 => select * from sales1
SQL0204N
"DB2INST1.SALES1" is an undefined name.
SQLSTATE=42704

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15082138/viewspace-629301/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15082138/viewspace-629301/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值