linux db2 归档,DB2的归档模式设置方法

当做在线备份,即加上online参数后,可以看到如下告警:

[db2inst1@localhost backup]$ db2 backup db sample online to /dev/null

SQL2413N Online backup is not allowed because the database is not recoverable

or a backup pending condition is in effect.

很简单,只要改成offline的默认备份方式即可:

[db2inst1@localhost backup]$ db2 backup db sample to /dev/null

Backup successful. The timestamp for this backup image is : 20131125221418

再次连接DB,就OK了:

[db2inst1@localhost backup]$ db2 connect to sample

Database Connection Information

Database server = DB2/LINUX 9.7.5

SQL authorization ID = DB2INST1

Local database alias = SAMPLE

这时我们可以测试下日志归档是否成功:

[db2inst1@localhost backup]$ db2 terminate

DB20000I The TERMINATE command completed successfully.

[db2inst1@localhost backup]$ db2 archive log for db sample

DB20000I The ARCHIVE LOG command completed successfully.

再去LOGARCHMETH1设置的目录下可以发现有如下路径,日志成功归档:

[db2inst1@localhost C0000000]$ pwd

/db2src/TS/backup/db2inst1/SAMPLE/NODE0000/C0000000

[db2inst1@localhost C0000000]$ ls

S0000000.LOG

这样就完成了日志归档到磁盘的设置工作,可以看到工作还是相当简化的,只要配置了归档方式,重启DB2后还需要做一个离线备份,即可完成DB2的归档配置,这样DB2在被启动手工归档或者日志空间不足的时候就会自动归档到这个目录。0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值